Bake tracker to Roto

Everyday we are (compers) doing this process so many times. We use tracker information to do most of the Roto. For doing this we are doing following things:
Usually Some compers copy the Tracker node and paste it next to the Roto node which need to match-moved.

Some use to copy paste the Trackers animation value into roto node's Root transform.

Following first step will slow down out script. Think if you have 50-100 roto shapes with tracker node.

Connecting tracker values to roto node is best way, But connecting manually with so many roto node is time consuming process.
So found the solution to automate this process.

Run this code with tracker node selected. This will create a roto node with selected tracker nodes  track information baked. So draw shape at any point and it will follow the tracked object..

This code will bake tracking information based on your tracker node. If your tracker node enabled only transform information then it will connect only the transform value. If your tracker enabled TRS then it will connect all the information automatically.

Hope this will help you friends..... cheers..

Updated on 26/12/2013.

Now this code create default roto node while user selected other nodes or nothing is selected.



## trackRoto v1.1
## For bugs please email me at
## Compatibility: Nuke v5 - v8 plus

import nuke, os, re

def trackRoto():
        sel = None
                sel = nuke.selectedNode()
                X = sel.xpos()
                Y = sel.ypos()
        except ValueError:  # no node selected
        if sel is None:
                rt = nuke.createNode('Roto')
        if sel:
                NodeType = re.sub(r"\d", "", sel.Class())
                print NodeType
                if NodeType == 'Tracker':
                        rt = nuke.createNode('Roto')
                        rt.setInput(0, None)

                        rt = nuke.createNode('Roto') lines:

import trackRoto
n = nuke.toolbar('Nuke')
n.addCommand('Edit/trackRoto', 'trackRoto.trackRoto()', 'O')

Popular posts from this blog

2D Volumetric rays in nuke

Nuke workFlow optimisation TIPS

Export Maya camera and Objects to Nuke