Nuke: Normalizing animation curves

I have written a little tool to help turn animation curves into more useable numbers. I’ve called it CurveConverter and it’s just a node that takes an input curve and generates an output curve. Copy any animation into the input, then control other animations in your comp by linking them to the output.

Image

Why is this useful?

Any time you have an animated value in your script that you wish to use to drive other animations, you will most likely have to multiply it by another value to get it into a useable range or scale it by hand in the curve editor. You might have to fiddle a while to get the peak and trough values to be where you want them. With this tool you don’t need to do any maths or manual scaling, just copy the curve across and enter your minimum and maximum values. It will scale the curve so that the highest peak is your maximum value and the lowest trough is your minimum value.

Image

Practical example:

You have a plate with flickering fire light and you need to create a patch or CG character with flickering lighting to match. You might use a CurveTool node to analyze the average intensity of the plate (giving values perhaps between 0.028 and 1.124). Normally you might then link a grade node to that animation curve and work out what value you need to multiply by to get a good result.

Instead, go to a dark frame and adjust your grade node so your patch matches (perhaps using the multiply or gain), copy that value into the ‘New min value’ of a CurveConverter node. Then go to a bright frame, adjust to match then copy the value into the ‘New max value’. The patch should now animate between those two settings.

Alternatively, use a CurveConverter tool to convert that curve into values between 0 and 1. Then connect the result to a Dissolve node to switch between a dark grade setup and a bright grade setup. This way would allow you to do more complex grade adjustments in the two lighting states.

Another application would be matching animation to an audio curve.