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: 

Shader.ReplaceAll(FBModel) does not work with objects created in Maya?

1 REPLY 1
Reply
Message 1 of 2
BrianPace6122
497 Views, 1 Reply

Shader.ReplaceAll(FBModel) does not work with objects created in Maya?

Greetings,


We have a script that exports scenes from Maya 2014 to MotionBuilder 2014.  Once in Mobu, some of the geo has a Lighted Shader with Additive Transparency enabled on it.  Back when we were using 2010, this worked just fine.  But with 2014 (and 2013....) this process no longer works. The shader is created properly, but it doesn't automatically get attached.

 

Well.. it does, I mean you see it childed to the Geo, but it's not actually showing up as additive.   I've created an example scene that reproduces the problem, see attached. 

 

Steps to recreate:

1. Load CubeB.fbx

2. Select both "Cube_From_Maya" and "Cube_From_Mobu"

3. Run the attached BrokenShader.py script 

4. Notice "Cube_From_Maya" doesn't get an additive shader, but "Cube_From"Mobu" does?  

 

It's like something about the geometry from Maya doesn't care to have the Shader.ReplaceAll() function properly attach it.   Is there a way to trick the geometry in the scene so that I *can* take an FBX Export from Maya and apply a shader in Mobu?  

Brian

 

1 REPLY 1
Message 2 of 2
Carpacio
in reply to: BrianPace6122

I had the same problem.

When you replace an object's shaders by script with the Shader.ReplaceAll() function, it does not change the object's shading mode. It needs to be set to "Textures + Shaders" so we can see it in the viewport.

 

Object_Shading_Mode.png

 

In your example, add this line and it should work :

Item.ShadingMode = FBModelShadingMode.kFBModelShadingAll

 

Smiley Wink

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

Post to forums  

Autodesk Design & Make Report