View Full Version : New model window for playblast

11 November 2006, 04:46 PM
To make a consistent playblast .avi size, how can I:

1) Pop up a new free-floating modeling window from the correct camera view (CAMERA_cinematic)
2) Make it have a specific size (640x480)
3) Make an .avi playblast from it that has the exact size I need (640X480)
4) Delete the 'new' model view when the playblast finishes.

Any help is appreciated, thanks!

12 December 2006, 05:07 AM
I never got this working properly - but here is my abandoned code. I started with an example from the mel reference but got tangled in mels crappy layout functions. Hope it hepls...

//beginning of mel

// Create a Playblast window with some buttons that
// change the editor's display of objects in the scene.

//toggle Resolution Gate
global proc resGateToggle()
string $pbCamera = "MasterCamera";
if (`camera -q -displayResolution $pbCamera`)
camera -e -displayResolution off -overscan 1 $pbCamera;
camera -e -displayResolution on -overscan 1 $pbCamera;

//The window
global proc masterBlaster()
if (`window -exists playBlastWin`)
deleteUI playBlastWin;

int $renderWidth = `getAttr defaultResolution.width`;
int $renderHeight = `getAttr defaultResolution.height`;

string $window = `window -title Playblast -w $renderWidth -h $renderHeight playBlastWin`;
string $form = `formLayout`;
string $editor = `modelEditor`;
string $column = `columnLayout -adjustableColumn 1`;

// Set the camera for the editor.
string $pbCamera = "MasterCamera";

// Create some buttons that will alter the display appearance of
// objects in the model editor, eg. wireframe vs. shaded mode.

button -label "Wireframe"
-command ("modelEditor -edit -displayAppearance wireframe $editor");
button -label "Bounding Box"
-command ("modelEditor -edit -displayAppearance boundingBox $editor");
button -label "Smooth Shaded"
-command ("modelEditor -edit -displayAppearance smoothShaded -displayTextures on $editor");
button -label "Flat Shaded"
-command ("modelEditor -edit -displayAppearance flatShaded $editor");
button -label "Gate"
-command "resGateToggle";
button -label "Blast"
-command "playblast -os";

// Set up the window layout attachments.
formLayout -edit
-attachForm $column "top" 0
-attachForm $column "left" 0
-attachNone $column "bottom"
-attachNone $column "right"
-attachForm $editor "top" 0
-attachControl $editor "left" 0 $column
-attachForm $editor "bottom" 0
-attachForm $editor "right" 0

// Attach the camera to the model editor.
modelEditor -edit -camera $pbCamera $editor;

showWindow $window;


//end of mel

CGTalk Moderation
12 December 2006, 05:07 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.