Get a 4x4 Transform Matrix of an animated Cornerpin2D node for a selected frame range.
animated cornerpin to matrix
Updated: 18 July 2015
Author: egbert
Compatible Nuke versions: 6.3 or later
Compatibility: Linux, Mac, Windows
This Python Script creates a CornerPin node in Nuke using the
transform_matrix knob to store animation data of a given CornerPin node.
transform_matrix knob to store animation data of a given CornerPin node.
It will help distributing animated CornerPin data for example from Mocha to all sorts of nodes like,
'Gridwarp', 'SplineWarp', 'Paint and Roto' nodes without the need to attach a cornerpin underneath each instance.
This is based on Ivan Busquets explanations on using the nuke.math python module to do matrix operations and Pete O'Connell's 'cornerpin_to_matrix' conversion method, with added functionality to convert animation data at a given timeframe.
To access this script inside nuke, you can add the following lines to your init.py and menu.py file accordingly.
init.py:
nuke.pluginAddPath( './scripts' )
or
nuke.pluginAddPath( './python' )
or any other name of the folder you store the script in.
menu.py
m=nuke.menu('Nuke')
n=m.addMenu('Scripts') #'Scipts' is the name of the menu entry and can be any other name you like.
n.addCommand('CornerPinToMatrix', 'animated_cornerpin_to_matrix.animatedCP2MTX()', icon='CornerPin.png')