BP not updated after changing UPROPERTY() enum

Hello there, i have a question regarding this enum i created which dictates what StaticMesh is going to be loaded for what instance of the same BP.

It works when i manually change the enum property inside the BP editor and populates the mesh slot correctly.

I want to do that on engine startup since I am automating it and i need it to load all necessary meshes when engine is starting up, which doesn’t happen, instead, the mesh slot is populated with the latest mesh that was there even if i set the enum value in c++ to something different. To be more exact I would like to have this enum have different default values for each instance of the BP and update mesh slot accordingly.

Why is this the case and why does it only work with the property changed manually inside the editor while the engine is running but not updating the BP when the enum property is set to a different value in c++.

In case you need more info I will provide necessary code and snippets.

Thanks :smiley:

There’s no easy way to do this as far as I know, but you can override PreSave on your class and do the necessary changes based on the enum value there, and then you can just find your blueprints in the editor and save them, which will run PreSave and do what you want it to do

Alright I will check this out.

Thanks for quick reply :smiley:

You can search for all blueprints of a given class in the content browser by searching for ParentClass:YourParentC++Class and then just select all of them and right click save, should do the trick