I can set a text property just fine. For example blueprint_class_default.set_editor_property(“Name”,“Tesy”)
But the Heightmap property accepts a texture file. I have already imported a texture file called alphabrush and can manually set Heightmap to this texture. However, when I try to do it in code it fails.
Here is a picture of the Heightmap property in the editor. I want to set this property to an existing texture via Python.
Current code that does not work.
# get the generated class
blueprint_generated = unreal.EditorAssetLibrary.load_blueprint_class(out_asset)
# from that, get the class default object ( the actual template for the blueprint )
blueprint_class_default = unreal.get_default_object(blueprint_generated)
# set or get properties
blueprint_class_default.set_editor_property("HeightMap", "/Game/Brushes/CustomBrushes/Textures/alphabrush")
unreal.EditorAssetLibrary.save_asset(out_asset)