PDA

View Full Version : browserTimer


h0tice
11-05-2003, 12:22 PM
hi,

this is my first script that i posted in this site,
i just made it to practice my scripting ability.

if there is something to be improved in this script just post it, i am very gladly open to all comments.

//created by: Oliver Magno
//date: 11-05-03
//description: using the new dgTimer command in maya 5.0 this script will
// provide a text file having info of all nodes after the scene was opened.
// this will work only in linux flatform. but if you can edit it for windows just do it.
// i have no idea in windows flatform.

global proc browseTimer()
{
string $win = "Browse Scene";
string $window = `window -title "Scene Browser" -widthHeight 700 200 $win`;

columnLayout;

frameLayout -collapsable true -label "Locate Maya Files" -width 650 -h 180;
rowColumnLayout -nc 3
-cw 1 400 -cw 2 1 -cw 3 200;
textFieldGrp -label "Maya Scene Path : " scenePath;
text -l "";
button -label "Browse Maya Files" -c "BrowseMayaFile";


button -l "Open & Timer" -c "openFile";
setParent ..;setParent ..;


showWindow $window;
}

global proc BrowseMayaFile()
{
string $filePath = `fileDialog -directoryMask "*.mb"`;
textFieldGrp -e -text $filePath scenePath;
}


global proc openFile()
{
string $fullPath = `textFieldGrp -q -text scenePath`;
string $buffer[];
$numTokens = `tokenize $fullPath "/" $buffer`;
$name = $buffer[$numTokens - 1];
dgtimer -on -reset;
$startTime = `timerX`;
file -f -typ "mayaBinary" -o ($fullPath);
for ($i = 0; $i < 1; $i++) {
$elaspedTime = `timerX -startTime $startTime`;
print ("Elapsed Time: "+$elaspedTime+"\n");
};
dgtimer -off;
dgtimer -outputFile "/home/demo/maya/timer.txt" -query;
system ("gvim /home/demo/maya/timer.txt >/dev/null 2>&1 &");
}

thnx to all

CGTalk Moderation
01-16-2006, 03:00 PM
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.