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

<pre><code>max((key.y for key in nuke.toNode('Blur1')['size'].animation(0).keys()))
</code></pre>

<p>where <code>Blur1</code> is the node and <code>size</code> is the knob.</p>

<p>Paste this into your expression editor, being sure to select the <strong>Py</strong> toggle.</p>

<hr>

<p>This won't interpolate or extrapolate keys. It only iterates over every keyframe.</p>

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

CC BY-SA 3.0
2015-01-06T20:58:00.253Z
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
CC BY-SA 3.0
2015-01-06T20:59:40.737Z
Actually it would just be `intensitydata` and the `.r` would be the `(0)` that comes after animation (0=r, 1=g, 2=b)
mhlester
CC BY-SA 3.0
2015-01-06T20:42:29.907Z
2015-01-06T20:42:29.907Z
mhlester
<p>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?</p>

<nuke>
I'm looking to make a Nuke expression: I want the maximum value of an animation curve of another node
Benedikt
# I'm looking to make a Nuke expression: I want the maximum value of an animation curve of another node

(Asked by: username_0 on 2015-01-06)

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?

**Tags:** nuke


---

## 1 answers

### Answer by username_1 on 2015-01-06. Score: 3 | Accepted answer

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.

> **Comments:**
> **username_0**: 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?  
> **username_1**: Actually it would just be `intensitydata` and the `.r` would be the `(0)` that comes after animation (0=r, 1=g, 2=b)  

---

