Home Coding, Scripting, Shaders

Maya screenshot Overwrite #MEL Error

polycounter lvl 5
Offline / Send Message
Pinned
jayantbhatt007 polycounter lvl 5
Hi, Again thank you so much for your help. Here is the rough output which I have been trying to figure out from the last 4-5 hours. I modified other Artist script. So, Any mistakes forgive me. Your command is working fine but I have 2 more doubts. (*) If I run the command twice it is replacing the old snapshot which I don't want. Whenever I run the "capture" button It should save the new screenshot. ( Because sometimes My model is complex so I have to take multiple screenshots from different angles.




//Code by rajasekaransurjen 


{   string $sn = `file -q -sn`;
string $cfp = `dirname( $sn )`;

if (`window -exists ScreenCapture`) //closes window if already open
  deleteUI ScreenCapture;
  
window -title "ScreenCapture" ScreenCapture; //creates window

            rowColumnLayout -numberOfColumns 4 -columnAttach 1 "left" 0
            -columnWidth 1 40 -columnWidth 50 500;
text -label "Path";
textField -w 200 -h 10 -tx $cfp -ed true filepath;
            button -w 60 -h 28 -label "Capture" -command "Capture";
// show the window we last created
showWindow;;
  }
  
  
  
  
global proc Capture() 
{
string $path = `textField -q -tx filepath`;
string $k =  ($path + "/snapshot");
string $ff = ".png";

string $node[] = `ls -sl`;
{
setAttr "defaultRenderGlobals.imageFormat" 8;
playblast -st 1 -et 1 -v 0 -fmt "image" -qlt 100 -p 100 -w 2000 -h 2000 -f $k;
}
clear $node;
}

Replies

Sign In or Register to comment.