This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nuke, nukescripts, nuke.rotopaint as rp, _curvelib as cl | |
''' | |
## LINK TOOLS | |
Utility functions for creating linked nodes. This script can create roto linked to trackers, | |
transform linked to trackers, or cameras linked to each other, or held on a projection frame. | |
Installation: | |
Put link_tools.py somewhere in your nuke path. | |
You can add the script as commands to your Nodes panel. This code creates a custom menu entry called "Scripts". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Time offset start and end of all rotoshapes | |
import nuke.rotopaint as rp, _curvelib as cl | |
# Amount of frames to offset | |
time_offset = -200 | |
t = nuke.frame() | |
# Get all Roto or RotoPaint nodes and loop through them | |
roto_nodes = [n for n in nuke.allNodes() if 'Roto' in n.Class()] | |
for roto_node in roto_nodes: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expression { | |
expr0 "isinf(r) ? ((r(x+1,y)+r(x+1,y+1)+r(x+1,y-1)+r(x,y+1)+r(x,y-1)+r(x-1,y+1)+r(x-1,y)+r(x-1,y-1))/8) : r" | |
expr1 "isinf(g) ? ((g(x+1,y)+g(x+1,y+1)+g(x+1,y-1)+g(x,y+1)+g(x,y-1)+g(x-1,y+1)+g(x-1,y)+g(x-1,y-1))/8) : g" | |
expr2 "isinf(b) ? ((b(x+1,y)+b(x+1,y+1)+b(x+1,y-1)+b(x,y+1)+b(x,y-1)+b(x-1,y+1)+b(x-1,y)+b(x-1,y-1))/8) : b" | |
expr3 a | |
name infToAverage | |
selected true | |
xpos -68 | |
ypos -273 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import nuke, nukescripts, nuke.rotopaint as rp, _curvelib as cl | |
''' | |
## LINK TOOLS | |
Utility functions for creating linked nodes. This script can create roto linked to trackers, | |
transform linked to trackers, or cameras linked to each other, or held on a projection frame. | |
Installation: | |
Put link_tools.py somewhere in your nuke path. | |
You can add the script as commands to your Nodes panel. This code creates a custom menu entry called "Scripts". |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add these to the menu.py in your ~/.nuke or NUKE_PATH folder | |
# Viewer Shortcuts | |
nuke.menu('Viewer').addCommand("Next Frame", lambda: nuke.activeViewer().frameControl(1), "shift+f") | |
nuke.menu('Viewer').addCommand("Previous Frame", lambda: nuke.activeViewer().frameControl(-1), "shift+d") | |
nuke.menu('Viewer').addCommand("Next Keyframe", lambda: nuke.activeViewer().frameControl(2), "ctrl+shift+f") | |
nuke.menu('Viewer').addCommand("Previous Keyframe", lambda: nuke.activeViewer().frameControl(-2), "ctrl+shift+d") | |
# Swap stereo views: requires eyes to be named as lname and rname | |
lname = "L" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set cut_paste_input [stack 0] | |
push $cut_paste_input | |
Group { | |
name PlanarProjection | |
help "<b>Planar Projection</b>\nGenerates 2D coordinates for points in 3D space. Type in 3D point coordinates, or use vertex selection in 3D viewer and click set to pick average of selected points, or set points to set all four points at once. \n\nYou can connect node output to scene together with your pointcloud or geometry and see where your points are located in 3d space. Double click any of them to move it in 3d space like any traditional nuke transform control. \n\nA matrix transform is also generated to be used with RotoPaint, SplineWarp and GridWarp nodes. If you are using matrix in GridWarp, points have to be in clockwise order, pick them one by one! \n\nCommand set points doesn't respect selection order! \n\nCheck out the demo video on my website! Kudos to Ivan Busquets for help with matrix math. \n\n-- developed by Vit Sedlacek 2012 www.vitsedlacek.com \n\n-- Modified by Jed Smith to make calculation time nearly inst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import with_statement | |
import os | |
import sys | |
import re | |
import glob | |
import subprocess | |
import nuke | |
import nukescripts |
OlderNewer