I have been digging around, but I have been unable to find anything that looks like a way to edit an Animation Blueprint directly. There are ways to create them and assign a skeleton but that is about where my editing stops.
I have a blueprint with an array of AnimSequences I need to edit the values of. Is this possible? The docs don’t seem to have anything that I can identify as a way…
You can, but you need to set them on the Class Default Object (CDO) of the Blueprint Generated Class (BPGC), rather than the Blueprint asset itself (which is just a definition of how to build the BPGC). This requires the Blueprint asset itself to be compiled and up-to-date:
# get the generated class of the Blueprint (note the _C)
bp_gc = unreal.load_object(None, "/Game/MyBP.MyBP_C")
# get the Class Default Object (CDO) of the generated class
bp_cdo = unreal.get_default_object(bp_gc)
# set the default property values
bp_cdo.set_editor_property("MyFloatProp", 1.0)
bp_cdo.set_editor_property("MyBoolProp", True)
hi. The above code is to get the variables of class defaults, can I get the data at runtime? For example, I get a string of characters through an editable textbox and store it in this variable. Obtained in python.
[USER=“2003”]Jamie Dale[/USER]
Just trying your code and it looks like it’s not working:
“LogPython: Error: bp_cdo = ue.get_default_object(bp_gc)
LogPython: Error: TypeError: NativizeClass: Cannot nativize ‘Blueprint’ as ‘Class’ (allowed Class type: ‘<any>’)
LogPython: Error: TypeError: NativizeObject: Cannot nativize ‘Blueprint’ as ‘Object’ (allowed Class type: ‘Class’)”
Hi Jamie_Dale! I was trying to find exactly it!
But another question. What if the load_object is a Editor Widget Utility, I already tested and your code works to get the variables of that Widget. But I can not get the components inside, like TextBox, etc…
How can I do that ?