Meta Data and the Transaction and Undo Systems

Hi!

We have a plugin that modifies the meta data of assets (we are adding/removing some custom tags).

I noticed that this doesn’t create any entries in the Undo history, so I spent some time stepping through the entire transaction system, and couldn’t find a spot where it would consider meta data at all.

This results in any transactions being discarded, and no Undo steps being created, since all modified objects are considered to be unchanged.

I also checked the User Asset Tags system built into Unreal. And while in UserAssetTagMenuHelpers.cpp it does go through the entire transaction spiel and creates e.g. “Added User Asset Tags” or “Removed User Asset Tags” transactions, those also never show up in the Undo history.

So I guess this is just a bug/missing piece in Unreal?

I for now worked around this by using the FChangeTransactor and inserting manual changes into the undo history. This works but is quite a bit of extra footwork.

Is this the way to go for now?

Ciao, Daniel!

[Attachment Removed]

Hi,

FChangeTransactor is the way to go here, your approach sounds correct. The transaction system is tied to UObject serialization, which makes metadata a bit of a special case since it’s purpose is to exist outside of that framework to let you query it without deserializing the object. It may be a bit tedious, but for the sake of your plugin you could perhaps write a helper function for setting metadata that encapsulates the manual change, to make it a bit easier on yourself.

Best,

Cody

[Attachment Removed]

Thanks for confirming this is the current way to handle this.

Ciao, Daniel!

[Attachment Removed]