Check if keyframe exists beyond a certain time range?

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 10 October 2012   #1
Check if keyframe exists beyond a certain time range?

In my current project we have very tight instruction not to have any keyframes beyond the given timeframe at all. For example, if a shot lasts from frame 1 to frame 100, any keyframe beyond that (-1, 0, 101 or even as tiny as 100.1) cannot exist.

I want to create a script that would tell the animator if they have any of such keyframes. How should I approach this without having to loop through all objects or loop through the entire timeline and beyond?

Thanks.
 
Old 10 October 2012   #2
To query the time slider:

http://forums.cgsociety.org/showthr...p?f=7&t=1071917
 
Old 10 October 2012   #3
or something like this, perhaps ?

string $nodes[] = `ls -typ "animCurve"`;
string $n;
float $startTime = 10;
float $endTime = 100;

for( $n in $nodes) {
    float $times[] = `keyframe -q -tc $n`;
    float $time;
    for($t in $times) {
        if ($t < $startTime) {
            print ( $n + " has a key before time " + $startTime + ".\n");
        } else if ($t > $endTime) {
            print ( $n + " has a key after time " + $endTime + ".\n");
        }
    }
}



/risto
__________________
- Oh no, it's me -
 
Old 10 October 2012   #4
@ristopuukko. Thanks. That works.

@Zoharl- nice reference. Thanks.
 
Old 10 October 2012   #5
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.
 
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 06:53 PM.


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