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 Tools Search this Thread Display Modes
  10 October 2012
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?

  10 October 2012
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");

- Oh no, it's me -
  10 October 2012
@ristopuukko. Thanks. That works.

@Zoharl- nice reference. Thanks.
  10 October 2012
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
Society of Digital Artists

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

All times are GMT. The time now is 03:21 AM.

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