guache Posted October 8, 2017 Share Posted October 8, 2017 (edited) 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 October 8, 2017 by guache Quote Link to comment Share on other sites More sharing options...
ikoon Posted October 8, 2017 Share Posted October 8, 2017 (edited) 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? http://www.sidefx.com/docs/houdini/hom/hou/Parm hou.Parm.keyframes() → tuple of hou.BaseKeyframe Returns the keyframes on this parameter. Edited October 8, 2017 by ikoon Quote Link to comment Share on other sites More sharing options...
guache Posted October 9, 2017 Author Share Posted October 9, 2017 Thanks. I ended up writing an hscript loop that writes out the counter to channel. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.