Download

Python 4.20 - How do I set Material(s) on a SkeletalMesh

Hey guys, I’m looking for your help again!

I’m looking for a way to set materals on a SkeletalMesh via Python. I can see them by writing:

print Unreal.SkeletalMesh.materials

which would print me the SkeletalMaterial. But I don’t know how to set them :confused:

Thanks again for your future help :slight_smile:

SOLVED!!!

SkeletalMesh.set_editor_property(‘materials’, SkeletalMaterial)

Could u explain what goes into the SkeletalMaterial class? I can see u input the material slot name, but where does the name of the new material go?

nevermind i got it working…

Hey, any idea how to assign the material to a specific lod? Or tell a lod to use a particular slot?

EDIT: nevermind, I was able to get this to work for my needs. Sorry, I should have waited a few minutes before posting.

material_list = [unreal.SkeletalMaterial(material_instance_obj)]
mesh.set_editor_property(‘materials’, material_list)

@skealeye what was your solution? I’m at the same point you were trying to figure out how to specify the material to be assigned on the SkeletalMaterial class. Any help is greatly appreciated.