Nuke's crop node missing the future of select a region and crop. So i found little cheat way to achieve this.  This little script get the value from ROI and set the value to selected crop node.

Step - 1:
Add  a crop node.

Step - 2:
Enable ROI draw mode by " alt+w "

Step - 3:
Choose your region using mouse drag on Viewer. Disable the ROI by " shift+w "
( currently 'roi' enable or disable is not accessible via python, So we have to disable it by manually )

Step - 4:
Run this code.

Video example:

Hope this will help you friends...

python code:

import os, math, nuke

def sCrop():
    sel = None
      sel = nuke.selectedNode()
    except ValueError:  # no node selected

    if sel is not None:
        ### getting value from ROI
        roiXY = nuke.activeViewer().node().roi()
        crpX = roiXY['x']
        crpY = roiXY['y']
        crpT = roiXY['t']
        crpR = roiXY['r']
        ### assigning value to Crop
        sel['box'].setValue(crpX, 0)
        sel['box'].setValue(crpT, 1)
        sel['box'].setValue(crpR, 2)
        sel['box'].setValue(crpY, 3)
      nuke.message('No Crop selected')

Popular posts from this blog

2D Volumetric rays in nuke

Nuke workFlow optimisation TIPS

Export Maya camera and Objects to Nuke