Hello.
I am creating some automation Editor Utilities for generating new blueprint assets. New blueprints are children of certain parent class which has some mesh components. I need to override default parameters for these components in my new child blueprint assets.
First I tried accessing them through default object properties, but there are no components in default objects.
Then I found a way to list all subobjects with:
subobj_ssys = unreal.get_engine_subsystem(unreal.SubobjectDataSubsystem)
all_subobjhandles = subobj_ssys.k2_gather_subobject_data_for_blueprint(asset)
for subobjhandle in all_subobjhandles:
subobjdata = unreal.SubobjectDataBlueprintFunctionLibrary.get_data(subobjhandle)
object = unreal.SubobjectDataBlueprintFunctionLibrary.get_object(subobjdata)
if object.get_class() == unreal.StaticMeshComponent.static_class():
object.set_editor_property("StaticMesh", new_asset_mesh)
but this seems to change base class component value, not the child as the returned subobjects point to component inside base blueprint. So I guess I need to do it somehow differently!?
I feel like I need to add a new inherited subobject property override in child blueprint somehow. Any idea how to do this?