I've written some batch scripts which automate maya through the Render application. The batch scripts are working over a series of different scenes and render all of them out.

For some of the models, I would like render the animations in the scene multiple times with different textures applied. Right now, my only solution is create another scene, apply the new texture and include the copied scene in the batch scripts.

Is there another, better way to do this? Ideally, some command line arg that said use texture X for this render would be lovely.

  • 1
    \$\begingroup\$ The syntax is a little different with different versions of Maya but they all have a command line flag that allows you to execute MEL commands before rendering, you can use that flag to change the texture just for this one render without having to save a separate file. \$\endgroup\$ – PeterT Sep 20 '13 at 4:21

The documentation is pretty clear on how to do it.

An example of how to change a node called file1 would be

"C:\Program Files (x86)\Autodesk\Maya2012\bin\Render.exe" -r file  -preRender "setAttr file1.fileTextureName -type \"string\" \"C:\\temp\\texture1.png\";" -im outfile1 C:\temp\scene.ma
"C:\Program Files (x86)\Autodesk\Maya2012\bin\Render.exe" -r file  -preRender "setAttr file1.fileTextureName -type \"string\" \"C:\\temp\\texture2.png\";" -im outfile2 C:\temp\scene.ma

This renders C:\temp\scene.ma to outfile1 with file1.fileTextureName set to C:\temp\texture1.png and to outfile2 with C:\temp\texture2.png

| improve this answer | |
  • \$\begingroup\$ Many thanx !!!! \$\endgroup\$ – j03m Sep 21 '13 at 3:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.