top of page
  • satheesrev

Automatically pin the Cornerpin in Nuke

This little code place the cornerPin nodes 4 pin's automatically based on the bbox. If your image dosen't have bbox add a crop node and crop it as per your need.


import nuke


def autoPinning():

    selNode = None

    try:

      selNode = nuke.selectedNode()

    except ValueError:  # no node selected

      pass


    if selNode is not None:

    ## auto pin for from

        selNode['from1'].setExpression('[value name].bbox.x', 0)

        selNode['from1'].setExpression('[value name].bbox.y', 1)

        selNode['from1'].clearAnimated()

        selNode['from2'].setExpression('[value name].bbox.r', 0)

        selNode['from2'].setExpression('[value name].bbox.y', 1)

        selNode['from2'].clearAnimated()

        selNode['from3'].setExpression('[value name].bbox.r', 0)

        selNode['from3'].setExpression('[value name].bbox.t', 1)

        selNode['from3'].clearAnimated()

        selNode['from4'].setExpression('[value name].bbox.x', 0)

        selNode['from4'].setExpression('[value name].bbox.t', 1)

        selNode['from4'].clearAnimated()


    ## copying value's from

        selNode['to1'].setExpression('[value name].bbox.x', 0)

        selNode['to1'].setExpression('[value name].bbox.y', 1)

        selNode['to1'].clearAnimated()

        selNode['to2'].setExpression('[value name].bbox.r', 0)

        selNode['to2'].setExpression('[value name].bbox.y', 1)

        selNode['to2'].clearAnimated()

        selNode['to3'].setExpression('[value name].bbox.r', 0)

        selNode['to3'].setExpression('[value name].bbox.t', 1)

        selNode['to3'].clearAnimated()

        selNode['to4'].setExpression('[value name].bbox.x', 0)

        selNode['to4'].setExpression('[value name].bbox.t', 1)

        selNode['to4'].clearAnimated()



    else:

      nuke.message('No node selected')

3 views0 comments

Recent Posts

See All

Connect Roto to Tracker

This script lists all the available Tracker node in the script. It connects the transform value to the selected Roto node. import nuke def connectTrack(): for selRoto in nuke.selectedNodes('Roto'): if

Comments


bottom of page