Maya playblast tool2

here is an improved version of the playblast script. Jean Denis pointed out the playblasting of more cameras is sequential and parallel. (thanks for that!) which would extreme slow in heavy scene with complex characters or large cache file. the new version of the script capture all cameras on each frame at the same time.  this way, maya have evaluate once on each frame and not do extra evaluation for each camera.  this way you can playblast simulations with different camera without caching.

i am using the active viewport for each camera to keep resolution constant. (and it avoid maya viewport issues).

* just made a little update to free maya after player is showing up

** another update: i added 2 more botton’s for houdini “mplay” tool. if you have houdini installed (even the demo version) it will bring up a mplay app and play until 4 cameras simultaneity in one window. (row or quas view)
tip: with shortcut “s” you link all view together and zoom synchronously

*** you use rv tile option (menu tools–>tile) to view all cameras side by side. i set it to default in the script

**** bugfix with timerange

Screenshot
download it here

// written by Heribert Raab 
// the tool create outliner with contain just cameras
// clicking on each camera switches through camera on your active viewport
// playblast botton will playblast all selected camera with aktiv viewport and load them into fcheck or rv

global proc playB(string $player)
{
string $select[] = `ls -sl`;

// setup playblast dir
//string $path = "/tmp/test/";
string $frames2[] ;
string $fl[] = `renderSettings -firstImageName -fullPathTemp`;
string $f2[] = `renderSettings -firstImageName`;
string $path = substituteAllString($fl[0], $f2[0], "");
int $min = `playbackOptions -q -minTime`;
int $max = `playbackOptions -q -maxTime`;
int $fr = $max - $min;

int $f;
string $all;
string $play;
string $scene = `file -q -sn -shn`;
string $scname = substituteAllString($scene, ".", "_");

for ($f=$min;$f <$max;$f++)
{
// playblast selected Cameras
$numInts = size($select);
$ridNum = $numInts +1;
int $i=0;
string $seq[];

for ($i=0;$i < $numInts; $i++)
{
lookThru ($select[$i]);
$frames2[$i] = $path+$scname+"_"+$select[$i];
//print ($frames2[$i]+"."+$f+"\n");
playblast -st $f -et $f -forceOverwrite -format image -fp 4 -compression "jpg" -f($frames2[$i]) -viewer 0 -offScreen -percent 100 -quality 70;
}
}
$all = stringArrayToString($frames2, ".* ");

//image player command
$play = ($player+" "+$all+"*");

if ($player =="mplay") $play= ($player+" -V 2 2 -g "+$all+"* &");
if ($player =="mplay2") $play= ("mplay -V 4 1 -g "+$all+"* &");
if ($player =="rv") $play_rv = ($player+" -tile "+$all+"* &");
if ($player =="fcheck") {$play = ($player+" -S "+$all+"* &");}

print $play;print "\n";
system( $play );
}

global proc look(){lookThru `ls -sl`;}

string $filterP = `itemFilter -byType camera `;

window cameras;
frameLayout -labelVisible false ;
string $panel = `outlinerPanel`;
columnLayout -adjustableColumn true;
button -label "Playblast selected Cams with RV" -command "playB rv";
button -label "Playblast selected Cams with Fcheck" -command "playB fcheck";
button -label "Playblast selected Cams with mPlay quad" -command "playB mplay";
button -label "Playblast selected Cams with mPlay row" -command "playB mplay2";

string $outliner = `outlinerPanel -query -outlinerEditor $panel`;
outlinerEditor -edit
-mainListConnection "worldList"
-selectionConnection "modelList"
-f $filterP
-selectCommand look
-showSetMembers true
-setFilter defaultSetFilter
$outliner;
showWindow;


Published by Heribert Raab

getting stuff done

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s