PDA

View Full Version : command line render w/ multiple mayas installed


bot27
12-02-2009, 09:52 PM
hello.

i have two machines that each have multiple versions of maya installed -- 2008 & 2009. when batch rendering from the command line, one machine opens maya batch 2008 and the other 2009... despite using the same scene file on each machine.

from the command prompt, is there a way to specify which version of maya batch i'd like to run?

thanks in advance.

bot

cgbeige
12-03-2009, 01:23 AM
what OS are you using?

bot27
12-03-2009, 01:52 AM
hi cgbeige. both machines are running win xp 32 bit.

cgbeige
12-03-2009, 02:01 AM
sorry - I only know how to specify the PATH for OS X

bot27
12-03-2009, 02:13 AM
no problem, thanks for the reply -- how do you accomplish it in osx? is it an additinoal flag in the render command? perhaps it is similar and could orient me in the right direction...

aside from from the obvious terminal vs cmndPrompt, i believe many of the flags are the same, but i could be mistaken about that.

cgbeige
12-03-2009, 05:02 AM
on OS X, you specify the Render path by adding this line to ~/.bash_profile

PATH=$PATH:/Applications/Autodesk/maya2010/Maya.app/Contents/bin/

you probably have a similar setting file but have the 2008 version referenced. Otherwise, you could just specify the full path for the Render command and add the command line options after that.

InfernalDarkness
12-03-2009, 05:51 AM
In Windows, you need to set your Environment Variable paths to get Maya to behave with multiple versions.

Control Panel -> System -> Advanced. Environment Variables are on the bottom. I'm in Win7 so they might be somewhere else in the System panel, but once you're there you can follow along and fix your problem with this little tutorial:

Maya Environment Variables (http://caad.arch.ethz.ch/info/maya/manual/UserGuide/Overview/EnvVariables.fm.html)

bot27
12-04-2009, 10:00 PM
infernalDarkness,

that got it -- thanks much for the help... cgbeige, you as well!

bot

bot27
12-06-2009, 07:34 PM
infernalDarkness,

apparently, i did not fix the problem entirely... by removing/substituting one of the install locations from the "Path" environment variable in the system properties, i was able to launch one version or the other. however, switching this value everytime i'd like to render from a different version is a bit cumbersome...

ideally, i'd like to be able to use the standard "render" command from the command line and have the system launch and render with whichever version of maya the scene was created in -- in my case 2008 & 2009. is this possible?

i can get it to work by replacing the "render" command with the absolute path to the render.exe command for each version, but again, this is not an ideal solution...

any thoughts?

also, i don't totally understand the difference between the "Path" and "MAYA_APP_DIR" system variables -- are they essentially the same?

cgbeige
12-06-2009, 11:27 PM
If you're referring to my PATH reference - that's for OS X/Linux.

bot27
12-07-2009, 03:47 PM
hi again cgbeige,

thanks once more for your response -- i understand your reference to the PATH setting/variable was for linux/osx. there's a similar setting/variable for windows that essentially performs the same function.

following your previous advice and "... specifying the full path for the Render command and add the command line options after that..." effectively solves the problem.

however, it would be nice if i could use the standard "render" command and the appropriate version of maya batch would launch automatically...

for now, your solution works and i'll continue to use it until i can find my ideal solution.

Als
12-08-2009, 05:32 PM
Can't you make a copy of the render file and rename it render8 under 2008, and copy of render file under 2009 and call it render9, then call render8 or render9 depending what you need?


Als

pix3lm0nk
12-08-2009, 05:59 PM
Can't you make a copy of the render file and rename it render8 under 2008, and copy of render file under 2009 and call it render9, then call render8 or render9 depending what you need?


Als

you could even create batch commands for each version of the renderer, and just edit them w/new scene names when you need to and run.

You could go balls to the wall with batch commands and make them interactive (inputting text during runtime), but that's another ballgame.

cgbeige
12-09-2009, 03:25 AM
so you can't fix this? how is it that it doesn't just use the PATH? I don't get it. Does Windows ignore the PATH setting and use the default Open With application?

Emil3d
12-09-2009, 04:11 AM
... then call render8 or render9 depending what you need?...you could even create batch commands for each version of the renderer, I don't know as to why one would need to render with different versions of the renderer when the latest should render scenes from any versions but I'm just curious what's the flag or how do you guys specify the version of the batch renderer in a .bat file.

pix3lm0nk
12-09-2009, 10:54 AM
I don't know why someone would do that either, other than legacy plugins? With a batch file (.bat) you'd have to hardcode the path pointing to the .exe for that version of Maya instead of starting the command with "render"


CGB: Windows does utilize the Path variables. I believe the issue however is the fact that if you have 3 versions of Maya showing up in your path statement, and each version of Maya uses render.exe for batch rendering, something's not going to work. Chances are if you type "render" in the commandline, it'll pull the first version of Maya from the string in your PATH statement.

That's why renaming each render.exe to something different may work provided any additional MAYA_PATH statments in System or User environment variables doesn't screw it up.

glxtrix
12-09-2009, 02:29 PM
Depending on the version, mental ray went through a large update and will give you different results if created in an older version of Maya and rendered with a newer one. The easy way to fix this and to use the "Render" command. Go to the the director on your C drive where Maya is installed. In the Bin folder search for the Render.exe and change it to Render9 (if you have Maya 2009 installed) Render10 for Maya 2010....or whatever variations you have. then when you create your render string, just type. "Render9 -r mr" or "Render10 -r mr" That will search for the appropriate version to render with.

cgbeige
12-09-2009, 02:39 PM
ah - I didn't realize that he had multiple instances of Render showing up since he has multiple PATHs pointing to the various versions. That's what I get for skimming.

I'd do what glxtrix said and make batch executables. If it were for OS X/Linux, I'd make a shell script in /usr/local/bin/ called Render10 and put this in it:

/Applications/Autodesk/maya2010/Maya.app/Contents/MacOS/Render $*

save it. sudo chmod +x /usr/local/bin/Render10

and then use Render10 as your command.

Als
12-10-2009, 08:47 PM
I don't know as to why one would need to render with different versions of the renderer when the latest should render scenes from any versions but I'm just curious what's the flag or how do you guys specify the version of the batch renderer in a .bat file.

Because if he is using third party plugins, or third party shaders, he must render the with that version of maya.

And less important but still valid is that the results would not be the same between version most of the time, even if he didn't used third party, because the shaders and defaults etc. change from version to version... plus new maya mental ray shaders, etc. I doubt there would be an issue between 2009 and 2010, but hey, I'm sure in some cases it would.


Als

A-OC
12-11-2009, 01:05 AM
I can' t check right now but this should work:


for 2008

"C:/Program Files/Autodesk/Maya2008/bin/Render" -the_flags "the/scene.mb"

for 2009

"C:/Program Files/Autodesk/Maya2009/bin/Render" -the_flags "the/scene.mb"

etc


* Crap, sorry I just noticed this is not your ideal solution. BUT, if you save your scene as .ma , then you could make a program that reads the version from the header lines and from there you could switch to the proper render path...

bot27
03-06-2010, 12:46 AM
hi again -- thanks everyone for your help.

i thought i should post a follow-up to this...

glxtrix, i ended up going with your solution and renaming the render.exe for each version to render8.exe and render9.exe respectively -- this keeps the batch commands shorter than typing out the full path each time.

pix3lm0nk, you were correct in assuming that i wanted to do this because of legacy plugins...

this forum is great. thanks again.

bot

CGTalk Moderation
03-06-2010, 12:46 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.