Download

Marking an asset as modified dirty via Editor Utility Widgets or Blutility?

I have an Editor Utility Widget that modifies assets.
However, it seems that it doesn’t actually mark the asset as “dirty” (modified / unsaved) when it does this, so the changes will not be saved and don’t even show up in the list of files to save.

Any ideas how to get around that?

I noticed that Python scripting has a modify() function, but there doesn’t appear to be an equivalent for Blueprints.

According to https://docs.unrealengine.com/en-US/Engine/Content/AssetMetadata/index.html there should be a “Save Asset” node somewhere. But I can’t find it.
I ran into the same problem. My very ugly workaround is to rename the asset to the same name. This also saves the file.
It’s ugly, but it works until a proper solution is found:

The Save Asset node is there for me in 4.24 when working with an Editor Utility Widget.

My problem is that I don’t actually want to save the asset after modifications, I just want to mark it as modified so that the user can choose to save the changes (or not) later.

I could just force-save like you’re suggesting, but it annoys me because it breaks the usual flow of the editor where you expect to be able to change something, and then close the editor without saving if you did something wrong.

Not sure if it’s required to be inside of a ‘Transaction’ to be flagged as dirty, doing it would give you not only the ability to mark it dirty but also undo actions.

This is excellent. Thank you!
Just gave it a try and it appears to solve all my issues.

A bit strange that you can’t call Modify directly, but this works just well.

Thanks [USER=“3523238”]Andreas Rånman[/USER]!
This works outside of Editor Utility Widgets, too.

Hi,

I’ve been trying to apply this to a Data Asset that gets modified by my in-game level editor and it doesn’t seem to mark the asset as dirty. Is there something else I need to consider, or am I barking up the wrong tree here?

Thanks.

EDIT: This does all happen at editor-time so I don’t expect it to work at run-time.