View Full Version : material conversions

02 February 2008, 08:52 AM
i'm trying to write some scripts to help with various material conversion. phong to mia, mia to maxwell, and back, etc. i'm having trouble creating shaders and storing the resulting shader or shading group name in a variable. i've been trying

string $newMaterial = `mrCreateCustom...`;


string $newMaterial = `createAndAssignShader...`;

but neither of them seem to return the shader or the shading group. they do a bunch of stuff after creating the shader, which does return info, but i'm not sure how to capture it in a variable.

any help is great.


02 February 2008, 11:29 AM
I wrote a script doing something similar. Just a few hints:

Creating materials returning the name like this: string $newMaterial = `shadingNode -asShader <shader type> -name <designated name>`; Concerning mr shaders I succeeded with the mrCreateCustomNode, returning a string with the name.

To directly replace materials you have to distinguish between Maya and mr shaders. If you want to replace Maya shader by Maya shader simply use replaceNode MEL command, otherwise, in my case I am doing the reassignement manually.

Hope this helped

02 February 2008, 05:36 AM
thanks. i'll give it a shot.

CGTalk Moderation
02 February 2008, 05:36 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.