Currently the “Reset Instance Changes To Blueprint Default” button on an actor instance doesn’t respect the NoResetToDefault tag, as the tag only seems to affect whether the reset button is shown in the details panel.
In our case, we have some properties which we don’t want users to be able to reset, often because they’re EditInstanceOnly and don’t have a sensible default, or they’re filled out programmatically, but we still want them to be UProperties for serialisation purposes, or so users can still see them. Removing the reset button from the property works to prevent that, but the button mentioned above gets around it.
For now we’ve tried to solve it by adding a check for the meta tag to EditorUtilities::CopyActorProperties, which mostly works (I haven’t managed to prevent it resetting struct properties), but might also affect other undesired editor functions that copy actor properties…
I’m curious whether Epic have a different solution to this problem, or just haven’t really run into it (Don’t really use NoResetToDefault, the mentioned button, or just don’t have similar use cases)?
Thanks!
Hi Daniel,
I took a look on the source code history, and it seems that the “Reset Instance Changes To Blueprint Default” button was created in 01/2015, while the “NoResetToDefault” meta tag was created later in 09/2016. The meta tag was created as a way to facilitate hiding the “Reset to Default” button on property editors, and its interaction with the “Reset Instance to Blueprint” button might or might not have been considered at that time.
I also searched the current codebase for usages of the “NoResetToDefault” meta tag, and I noticed that it is used mainly for non-actor uproperties (asset editors, tool windows, preferences windows etc). Its usage inside pre-built actors is extremely rare, so I believe it is likely that this behavior has not been an issue to Epic.
The current implementation of “Reset Instance Changes To Blueprint Default” can be found in file [Engine\Source\Editor\SubobjectEditor\Private\SSubobjectInstanceEditor.cpp:598], function SSubobjectInstanceEditor::OnResetToBlueprintDefaults(). It calls function EditorUtilities::CopyActorProperties() from the CDO to the instance with a hardcoded option “OnlyCopyEditOrInterpProperties”. There is an option “SkipInstanceOnlyProperties” available for that function, so if you are building the engine from source, you could probably include it on the call site to achieve the behavior you want without editing the internals of CopyActorProperties() directly, which could indeed affect other engine systems.
I hope this is helpful. Please let me know if you need further assistance.
Best regards,
Vitor