I have a bunch on StaticMeshes I would like to use one type of collision complexity, and there is another bunch, where I want to use another… hundreds more coming…
So setting up the default complexity in the Project settings is not an option.
I found this articleto start my Python journey.
So I wrote similar scripts to change anim retarget sources on animation sequences. They worked fine.
import unreal
#create unreal class instances
editor_util = unreal.EditorUtilityLibrary()
# get the selected assets
selected_assets = editor_util.get_selected_assets()
for asset in selected_assets:
asset.set_editor_property("retarget_source","my_retarget_name")
So I thought if I change the last line:
asset.set_editor_property("collision_complexity","SimpleAndComplex")
would work. I know I am a bit optimistic about this script working,
because I have not found the Python property here, but I was hoping it is just in another class, and Python is
just going to find it somehow…
Well I was wrong, I guess I have to do some more to get it work.
I am getting these on screen after running the script in the editor.
LogPython: Error: Traceback (most recent call last):
LogPython: Error: File "<string>", line 13, in <module>
LogPython: Error: Exception: StaticMesh: Failed to find property 'collision_complexity' for attribute 'collision_complexity' on 'StaticMesh'
Am I missing out something?
If not is there a workaround?