MotionBuilder Forum
Welcome to Autodesk’s MotionBuilder Forums. Share your knowledge, ask questions, and explore popular MotionBuilder topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Detach Materials and Shaders in python script

1 REPLY 1
Reply
Message 1 of 2
Anonymous
536 Views, 1 Reply

Detach Materials and Shaders in python script

I'm looking for a way to directly Detach a material or shader from an object, without deleting stuff or other workarounds.

I can append ..

charactersToAppendMattes = FBComponentList()
FBFindObjectsByNamespace( "Characters", charactersToAppendMattes)
matteShaderToAppend = FBComponentList()
FBFindObjectsByNamespace( "matte", matteShaderToAppend)

charactersToAppendMattes.Materials.append(matteShaderToAppend)

However there's no similar method for Detach. Workaround currently is using ReplaceAll Function in FBShader. However that requires reconstructing other shaders that might already exist on the model.

-Kristian
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Since the shaders are stored as a list type,
found that I can use pop (remove from list) to detach shaders from an object

charactersToAppendMattes.Shaders.pop()

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report