I’m trying to attach metadata to level actors using python. I came across a similar question (for 4.13 and C++) where the solution was to use ActorComponents for the job.
I’ve been introspecting the python stuff for hours now (4.22) and not gaining traction.
- I’ve created a blueprint ActorComponent, with a member variable containing my property map
- I’ve been able to attach them to the actor in the editor, using the (Add Component) button.
- I’ve not been able to figure out how to create a component from Python, much less attach it to the actor.
- For actors where I’ve manually added the component, I’ve not been able to get at it. the actor has a root_component member, but the blueprint actor component is not a child component of that.
For my use case (this is to support asset pipelines involving external assets and metadata) I need to be able to do this from a python script:
- Once I’ve called unreal.EditorLevelLibrary.spawn_actor_from_object() to create my static mesh actor, create some method to construct my component from the blueprint in /Game/ActorMetaData.
- Having access to the actor object in python, find the compoeent and inspect it / modify it.
Any thoughs?