View Full Version : Action in specific frame
Hi :)
I want during animation, determine while reaching specific current time (frame) do specific action
How do this ???
|
|
No idea what your asking, honestly, so here's a wild stab at a solution:
if(`currentTime -q` == 39) {
// statement what action to occur on frame 39
}
Thanks alot :)
but your slution work well if character not during animation
I want Like this but using mel not python
import maya.cmds as mc
startFrame=mc.playbackOptions(query=True,minTime=True)
endFrame=mc.playbackOptions(query=True,maxTime=True)
currentFrame=startFrame
while(currentFrame<endFrame):
print "The current frame is %d" % currentFrame
mc.currentTime(currentFrame)
currentFrame+=1
Help me plzzzzzzz
I still have no idea what you want.
The example you posted simply starts at frame 1 and steps through each frame, printing the current frame number.
My own example does exactly what you specified, as far as I understood:
on reaching a specific frame, in my example frame 39, it will do whatever you put inside the if-clause (between the curly brackets {}).
If you place that code in an expression or in a scriptNode with its scriptType set to 7 then it will work as you playback your scene during an animation.
Here's the Python example in MEL:
I still have no idea what you want.
The example you posted simply starts at frame 1 and steps through each frame, printing the current frame number.
My own example does exactly what you specified, as far as I understood:
on reaching a specific frame, in my example frame 39, it will do whatever you put inside the if-clause (between the curly brackets {}).
If you place that code in an expression or in a scriptNode with its scriptType set to 7 then it will work as you playback your scene during an animation.
Here's the Python example in MEL:
$startFrame = `playbackOptions -q -min`;
$endFrame = `playbackOptions -q -max`;
$now = `currentTime -q`;
while($now <= $endFrame) {
print("Currently at frame: " + $now +"\n");
$now++;
currentTime -e $now;
}
It will disregard playback speed and simply step through each frame as fast as the CPU can execute the code (which is instant nowadays).
Very Tanks :)
The code work well but I have problem
$startFrame=`currentTime -q`;
int $currentFrame=$startFrame;
while($currentFrame !=0){
print ($currentFrame + ",,");
currentTime $currentFrame;
$currentFrame+=1;
if($currentFrame>471)
$currentFrame=0;
}
remaining code
when apply this code , the character animation very slow in frames within while loop and when reach frame 0 start animated well
So, how speed up while loop (means between currentTime $currentFrame; in loop) or any other solution
Is there any other solution because the while loop make project too slow
How check current frame during playblast ?????????????????????????
Have you considered using trax with clips and/or the camera sequencer? Both of these offer some non-linear capabilities, which seems to be where you are heading in all these various questions.
Many people would simply playblast the bits they need and then put them together in a compositor or editor app.
David
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.