Jump to content

CHOPs counter: add values from past keyframes

Recommended Posts

I have an animation channel with keyframes with various integer values. In CHOPs, I'd like to have a rolling counter that holds the sum of values on all preceding keyframes (values from keyframes only, not values from all preceding frames). Any idea how to do this? Below is a sample of what the counter would do:

Keyframe on frame 1: value 3, counter: 3 (3)

Keyframe on frame 8: value 8, counter: 11 (i.e 3+8)

Keyframe on frame 13: value 4, counter:15 (i.e 3+8+4)

Keyframe on frame 23: value 4, counter:19 (i.e 3+8+4+4)

Keyframe on frame 29: value 7, counter: 26 (i.e 3+8+4+4+7)

Edited by guache

Share this post

Link to post
Share on other sites

The Area CHOP doesn't care about keyframes. You can wrangle almost anything, also with the "if" statement, but you probably don't have the list of keyframes? Probably Python iteration is needed here?


hou.Parm.keyframes() → tuple of hou.BaseKeyframe

Returns the keyframes on this parameter.
Edited by ikoon

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now