View Full Version : Check current frame number during playblast
Hello
How check current frame number during playblast because the currentTime -q is not work correctly during playblast
I want to writing if statement during playblast like
if current frame is 50 , do this action
|
|
Kecal
11-27-2012, 11:39 AM
you can try temporary scriptJob or scriptNode, which will call your procedure during timeChange, and remove it at the end of procedure
or maybe script your own playblast as for loop:
* set new frame
* check frame number -> call procedure
* take snapshot
if you want really only playblast
ldunham1
11-27-2012, 12:36 PM
or use "frame" via expression?
I write now this code but not work
scriptJob -timeChange "CurrTime()";
global proc CurrTime()
{
$startFrame=`currentTime -q`;
int $currentFrame=$startFrame;
if($currentFrame == 0)
{
setAttr "dress1.visibility" 0;
setAttr "Skirt3_a.visibility" 0;
setAttr "Skirt3_b.visibility" 0;
setAttr "dress2.visibility" 0;
setAttr "Jeans1_a.visibility" 1;
setAttr "Jeans1_b.visibility" 1;
setAttr "Jeans1_c.visibility" 1;
}
}
I want during playblast if reach frame 0 do action
Can you correct it, please
Thanks in advance
Kecal
11-27-2012, 02:50 PM
its long time i have worked with scriptJob
please try this:
scriptNode -st 7 -beforeScript "CurrTime()" -name "timeChangeNodeScript";
tontonsuspect
11-27-2012, 07:00 PM
you can also read the value from the global time node in maya( there can only be one in a scene)
most of the time its named time...
getAttr time1.outTime
this will give you the current frame number: be aware that this is a double value: in most case its a whole number but in reality its valid to have 3.25 as a time value.
Very thanks for all ^________^
It work well with scriptNode :)
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.