Modifying an asset from code

I want to do some preprocessing on one of my blueprints to compute some values ahead of time. It could be computed in the InitializeComponent but given that won’t change would be better to do in in the editor and save the values into the blueprint.

My plan was to use a command to run the code in the editor and use the AssetRegistry to get the Blueprint. The property I want to change is a property of a component that exists on the Blueprint. I’ve found the ComponentTemplates property of a given blueprint but it is empty.

I have a solution using the SimpleConstructionScript which I will write up tomorrow unless any UE staffers know of any problem with this (essentially looping through the USCS_Nodes and modifying the values & finally marking blueprint as changed with Modify)

Hi ,

When/where in the editor do you need to see these values updated/saved? Is the calculation of this value dependent on other values of this class or another class? Another function to look at would be PostEditChangeProperty, which will be run any time a property is changed in the editor.

More information: Programming with C++ in Unreal Engine | Unreal Engine 5.1 Documentation under "Extending C++ class via Blueprints