3

I want to feed a custom made NoOp node with a floating point slider with the maximum value of an animation curve from another node. What would be the right expression to do this?

3

There's not a built in method for that, but this Python expression will return the highest keyframe in an animation curve:

max((key.y for key in nuke.toNode('Blur1')['size'].animation(0).keys()))

where Blur1 is the node and size is the knob.

Paste this into your expression editor, being sure to select the Py toggle.


This won't interpolate or extrapolate keys. It only iterates over every keyframe.

No guarantees on the speed of this either. It might bog down the node if you have a keyframe on every frame or something.

| improve this answer | |
  • Would the name of the Knob be "intensitydata.r" If I wanted the maximum intensity of the red channel? Or how would I put this in python? – Benedikt Jan 6 '15 at 20:58
  • Actually it would just be intensitydata and the .r would be the (0) that comes after animation (0=r, 1=g, 2=b) – mhlester Jan 6 '15 at 20:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.