WoodenAX
(WoodenAX)
January 5, 2021, 10:44am
1
Hi guys I 've created blueprint in the content and try to edit the skeletal mesh , I tried get_component_by_class but it gives me empty array, here is my code:
bp_gc= ue.EditorAssetLibrary.load_blueprint_class("/Game/DemoMap/DemoActor.DemoActor_C")
bp_cdo = ue.get_default_object(bp_gc)
comp = bp_cdo.get_component_by_class(ue.SkeletalMeshActor)
print comp
and my blurprint looks like:
is there a way to change the skeletal mesh component 's mesh using python?
WoodenAX
(WoodenAX)
January 6, 2021, 3:12am
2
btw I did find the component class in python but is there a way to add them in the blueprint asset?
Did you figure this out? I’m also interested in the solution.
WoodenAX
(WoodenAX)
January 11, 2021, 1:54pm
4
I tried something but I didnt find anything about component edit, what I can find is component in level not edit blueprint
uced
(uced)
May 18, 2021, 7:09pm
5
Hey,
Any success ?
Trying to do the same here, but with static mesh.
I came up with that code:
SMSource = ue.load_asset(“/Game/Yag/test/Cube.Cube_C”)
SMTarget = BP_CDO.get_editor_property(“StaticMC_00”)
SMTarget.set_editor_property(“StaticMesh”, SMSource)
Basically, my “StaticMC_00” is your “Sk_mesh” and you can replace “StaticMesh” by “SkeletalMesh”
It gives no error but unfortunately seems to be doing nothing.
I’m stuck here atm but it might give you a direction.
Cheers
uced
(uced)
May 18, 2021, 7:14pm
6
Got it working, it was the source loading that was wrong.
It’s ok with this:
SMSource = ue.load_asset(“/Game/Yag/test/Cube”)
Hope this helps
Cheers
I probably not possible to do that with pure python, I worte a C++ plugin and wrap some cpp API into Blueprint API then I can modify the blueprint component.
Here is my blog post, sorry but in Chinese.