PDA

View Full Version : Help With Mental Texture Bake Script


Jocose
09-02-2009, 05:49 PM
Hey Everyone,

I'm trying to create a simple script that will bake out a material I have on selected meshes to a texture.

This is the bit of mel I am using to run my test:

convertLightmap -camera persp -sh surfaceShader4SG `ls -sl`;

Right now I am having two problems:

I am passing the selection to "convertLightmaps" and this works fine if I have only one object selected, but if I try to select multiple objects it gives me an error saying that my the second object in my selection "isn't a shading group". Here is the exact error:

// Error: (Mayatomr) : pCube2: node is not a shading group //

My second problem is that unless I have actually gone to the render preview and rendered something in Mental Ray I get this error:

// Error: (Mayatomr.Nodes) : could not find a mentalrayGlobals node //

I would really like to just have this script work right away when the user first loads it up. Do they really need to go up and render something MR to get this "mentarayGlobals node" to apear, or is there some way I can automate this in mel?

Thanks

CGTalk Moderation
09-02-2009, 05:49 PM
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.