[Closed] 3dsmaxcmd running scripts
So. I have written 4 working scripts that take a scene through a series of render passes with specific materials changed for output that needs to be used for some content. Manually running the scripts works fine from the scene. Running the scripts from command line seems fine as well except for my 4th scripts…it seems to not run the scripts changes…but oddly enough outputs them as if it is running the script but decides to ignore any material changes it makes.
So here’s what is going on. My 4th script takes materials named “inputXXX” and makes them a shellac, assigns mat#1 a bitmap, assigns mat#2 a blue value = to the material name numeral suffix. So if the name was input012, the blue vaule would be 012. Then it output each frame in the animation range. Works fine manually.
Doesn’t work when invoked from the command line, though amazingly it does output the frames, just doesnt make the material changes.
My question is, Is there a problem with the script? or is there some problem related to the command line invocation?
can’t comment if you’re script has a problem without seeing it … but can help you with launching scripts from a cmd line.
the arguments i’m using:
3dsmax.exe -mip -U MAXScript “path/to/script/runscript.ms”
one thing i noticed the other day was that i NEEDED to put quotes around the script filename otherwise 3dsmax would not run the script in vista when it would using xp. didn’t know you could use 3dsmaxcmd.exe to run scripts.
if you want help with the script – post it and we’ll try to help.
actually we have a batch file that we run from the cmdline
looks like this
REM First Argument, %1, is add,bkgd,mult or uvm
REM Second Argument, %2, is the scene file to render
set PREFIX=%1
set SCENE=%2
set MAX=“E:\3dsmax9\3dsmaxcmd.exe”
%MAX% -outputName:“renderoutput%PREFIX%.png” -script:scripts%PREFIX%.ms -camera:Camera01 -width:640 -height:480 -frames:all %SCENE%
from the cmd line we basically invoke it like this: our.bat uvm thescene *press enter
our.bat is the batch file
uvm is the 4th script
thescene is whatever scene I am loading.
This works fine for all my scripts except the uvm script. If you feel there’s nothing wrong in the above I can post the uvm script here.
Well two things jump to mind immeditaly.
You may need to provide the full path to the script and or add quotes around “-script” flag – can’t say for sure, I don’t use the cmd line options, although I have found that filein command needs a full path.
So you command line might look something like this:
%MAX% -outputName:"renderoutput\%PREFIX%.png" -script:[b]"scripts\%PREFIX%.ms"[/b] -camera:Camera01 -width:640 -height:480 -frames:all %SCENE%
ed: I wouldn’t rely on the fact that you are executing the batch file in the same folder as the scripts, as max’s view on what is the working folder may not be where you think it is…in fact I have a hard time figuring that out myself
Shane
Of course if your end requirment is that you batch process Max files you can always use this… http://paulneale.com/scripts/batchItMax/batchItMax.htm You can point it at as many ms files as you like to do the dirty work for you.