Action in specific frame

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 11 November 2012   #1
Action in specific frame

Hi

I want during animation, determine while reaching specific current time (frame) do specific action

How do this ???
 
Old 11 November 2012   #2
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

}
 
Old 11 November 2012   #3
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=T rue)
endFrame=mc.playbackOptions(query=True,maxTime=Tru e)
currentFrame=startFrame
while(currentFrame<endFrame):
print "The current frame is %d" % currentFrame
mc.currentTime(currentFrame)
currentFrame+=1

Help me plzzzzzzz
 
Old 11 November 2012   #4
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).

Last edited by Nyro : 11 November 2012 at 05:41 PM.
 
Old 11 November 2012   #5
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
 
Old 11 November 2012   #6
Is there any other solution because the while loop make project too slow

How check current frame during playblast ?????????????????????????
 
Old 11 November 2012   #7
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
__________________
http://www.djx.com.au
 
Old 11 November 2012   #8
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:07 AM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.