hi people.
I am trying to make a script that takes all the files from a directory and output it in the render global resolution, to a specified directory named by the scene and camera. I did write it, but when i try to:
CODE
maya -script "blast_all.mel" -file a.mb;
it opens maya but does no blast. here is the code:
CODE
proc playblast_ALL(){
string $cameras[] = ls -typ "camera";
string $root = workspace -q -rd;
string $dir = $root + "Playblasts/";
string $file = file -q -loc;
string $name[];
string $scene[];
tokenize $file "/" $name;
tokenize $name[6] ".mb" $scene;
string $montadir = $dir + $name[4] + "/" + $name[5] + "/" + $scene[0];
print $montadir;
sysFile -makeDir ($dir + $name[4]);
sysFile -makeDir ($dir + $name[4] + "/" + $name[5]);
int $start = getAttr "defaultRenderGlobals.startFrame";
int $end = getAttr "defaultRenderGlobals.endFrame";
int $width = getAttr defaultResolution.width;
int $height = getAttr defaultResolution.height;
for ($c in $cameras){
if ($c != "topShape"){ if ($c != "frontShape"){ if ($c != "sideShape"){
sysFile -makeDir ($montadir + "_" + $c);
lookThru $c;
playblast -st $start -et $end -f ($montadir + "_" + $c + "/preview") -fo -fmt "image" -p 50 -v 0 -w $width -h $height -orn 0;
}}}
}
quit -f;
}