Tips on using TransactionalArrays?

Guys, in a plugin i’m creating i need to be able to UNDO/REDO changes to an array.
It seems that TArray doesn’t have this capabilities but instead TTransArray can do that.

Am i right or am i doing something wrong?

Besides TTransArray isn’t a UCLASS, so it can’t be used as a UPROPERTY, nor serialized in a normal way.

How would i resolve this issue? i can imagine some cases.

  1. Use TTransArray, but without UPROPERTY, use a custom serialization with it.
  2. Inherit from TTransArray and make that class be UPROPERTY, not sure it will work.
  3. Use TArray in some way that i don’t understand, using maybe PostUndo.

Thoughts?
Thanks a lot, i have asked everywhere but to no avail.

Ok guys, i’m almost there…

First the TransArrays work very well, but do require more configuration.

First, they don’t posses a default constructor, so one has to manually create the constructor used for serialization (per update on UE 4.8).

UMyClass(FVTableHelper& Helper)
: Super(Helper),
MyTransArray(this) // and here you can initialize your members
{
}

With this, the problem of compiling the project is kinda solved, but another problem arrised. I cannot make this be a UPROPERTY, the error i get is
“type must be a UCLASS, USTRUCT or UENUM”

So, the problem is that UnrealHeaderTool doesn’t recognize the object, even though i’m including it on the file.

Any ideas ?

Ok, here’s the solution

Good luck