Skip to content

Instantly share code, notes, and snippets.

@jedypod
jedypod / Bake Roto
Last active June 5, 2018 20:05
Bake Roto is a python script that will bake an arbitrary control vertex on a Nuke Rotopaint shape or stroke into position data. Baking nearly instantaneous, and takes into account transforms for shapes parented under layers that have animations or expression links. The idea for this was based on Magno Borgo's BakeRotoShapesToTrackers script.
"""
Bake Roto is a python script that will bake an arbitrary control vertex on a Nuke Rotopaint shape or stroke into position data. Baking nearly instantaneous, and takes into account transforms for shapes parented under layers that have animations or expression links. The idea for this was based on <a href="http://www.borgo.tv/">Magno Borgo</a>'s BakeRotoShapesToTrackers script.
http://www.nukepedia.com/python/misc/bakerotoshapestotrackers/
Usage:
Select a Roto or RotoPaint node and run the script. Don't forget to turn on the "toolbar label points" button to see the cv numbers.
Example Installation:
Add code to your menu.py to add the script to a menu.
import bake_roto
@jedypod
jedypod / DistortTracks
Last active January 19, 2024 16:42
Distort Tracks Gizmo(Description in Comments, because description does not support markdown?)
set cut_paste_input [stack 0]
push $cut_paste_input
Group {
name DistortTracks
help "<b>Distort Tracks Gizmo</b>\n\n<b>About</b>:\nThis gizmo reformats and/or distorts tracking data based on a uv distortion map input. When you are working with CG elements in your comp that are undistorted and padded resolution, sometimes it is useful to reconcile tracking data from a 3d position through a camera into screen space. This data can then be used to do stuff in 2d: track in lens flares, matchmove roto or splinewarps, etc. The problem is that when this tracking data comes back from our padded undistorted 3d scene into distorted, unpadded resolution comp land, it doesn't line up. \n\n<b>Instructions</b>:\n1. Connect the UV input to a uv distortion map and set the channel that holds it, (for example, a LensDistortion node set to output type Displacement, outputting a UV distortion map into the forward.u and forward.v channels)\n2. Set the padded resolution format and the destination format: Padded resolution is the ov