I've been struggling with this on and off for a few days now so I thought I'd ask here on the off chance.
Using the python bindings for the autodesk fbx SDK I want to take an object with multiple materials assigned and replace the assignments with a single material.
I can remove materials from an object, I can create new materials and I can assign the new material to an object but I have completely failed to assign the new material to an object's faces.
Has anyone done anything like this ? does anyone understand the system well enough to explain the architecture to an idiot?
before anyone asks - I can't do this within maya / whatever it needs to run as part of a larger process.
TIA
Replies
Sorry I couldn't help more.
Are your FBX's ASCII by chance? I've had success editing FBXs that were in ASCII format. Hopefully someone with FBX Python experience can answer you though.
Its definitely doable - I just have to behave like a programmer rather than hack away at it like a tech artist
I can't share the code cos work but ...
You can pull a list of material indices by face ID from the layers on an individual fbx node's geometry, once you've got that you can edit the material indices to point at whatever material you want on a per face basis
turns out to be fairly straightforward as long as you're not dealing with instancing or other weirdness i haven't accounted for yet.