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
    Commented Sep 20, 2013 at 4:21

1 Answer 1


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

  • \$\begingroup\$ Many thanx !!!! \$\endgroup\$
    – j03m
    Commented Sep 21, 2013 at 3:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .