In the world, we have hundreds of instances of a blueprint actor placed. I would like to reset to default one property of all those instances. Just changing the value back to the default value is not enough because I need each instance to use the value specified in the blueprint.
I’m trying to find a way to do that in C++ with no success.
From a world, i’m getting all the concerned actors and i would like to call something like
void SDetailSingleItemRow::OnResetToDefaultClicked() conston a specific property.
Unfortunately, mimicking the behavior of most features found in the Details Panel and other Property Editors is usually not trivial. However, there is a quick-and-dirty shortcut you can use. You can basically “borrow” a lot of functionality from the Property Editor Module by creating a temporary “Single Property View” observing the property you are interested in. This does internally create temporary Slate Widgets just to throw them away, but it exposes a powerful API based on IPropertyHandle. Property Handles refer to nodes in a property tree that contains all the necessary information to handle the many property operations supported by Property Editor UIs. Here’s some code I just tested successfully:
`#include “MyEditorLibrary.h”
include “Modules/ModuleManager.h” include “PropertyEditorModule.h” include “ISinglePropertyView.h” include “PropertyHandle.h”