Corner Pin Offset allows you to track four points and then use an offset before creating a Corner Pin.
I did this tool while working on Wonder Woman 1984 to help the team with a sequence where we had a lot of photos to add on different frames around an apartment. Sometimes we had other objects in front of one of the corners of the photo frame, and with this tool, we could track another point and then offset it to where the corner was.

You need to use a Tracker node first, and when you have it you select it and link the points to CornerPinOffset. As you can see in the image, you can do all the points at once (1 is lower left, 2 is lower right, 3 is upper right, and 4 is upper left), or do them one by one in whatever order you want. You have the To and From values the same way you have them in a CornerPin, and at the bottom of the properties you have the offset values you want to apply to the tracker.
Expand CornerPinOffset
Group {
name CornerPinOffset_1
onCreate "\nnuke.thisNode()\['Offset1'].setFlag(0x00008000)\nnuke.thisNode()\['Offset2'].setFlag(0x00008000)\nnuke.thisNode()\['Offset3'].setFlag(0x00008000)\nnuke.thisNode()\['Offset4'].setFlag(0x00008000)\n\nf = None\n\nif nuke.thisNode()\['f_created'].getValue()==True:\n nuke.thisNode()\['f_created'].setValue(False)\n nuke.thisNode().showControlPanel()"
tile_color 0xb285b2ff
selected true
xpos 273
ypos -63
addUserKnob {20 CornerPinOffset l "Corner Pin Offset"}
addUserKnob {20 To n 1}
addUserKnob {22 allPoints l "Link All Points by Default" t "Use this button to link all points by default (same behaviour as clicking on \"Creare\" button of the Tracker node)" T "def fourCornersOfAConvexPoly(t): \n tracker = nuke.selectedNode()\n k = tracker\['selected_tracks'] \n tracks = tracker\['tracks'] \n sa = k.getText().split(',') \n if len(sa) != 4: \n idx = \[] \n return idx \n i = \[int(sa\[0]), int(sa\[1]), int(sa\[2]), int(sa\[3])] \n nCols = 31\n xCol = 2\n yCol = 3\n x = \[tracks.getValueAt(t, i\[0]*nCols+xCol), tracks.getValueAt(t, i\[1]*nCols+xCol), tracks.getValueAt(t, i\[2]*nCols+xCol), tracks.getValueAt(t, i\[3]*nCols+xCol)] \n y = \[tracks.getValueAt(t, i\[0]*nCols+yCol), tracks.getValueAt(t, i\[1]*nCols+yCol), tracks.getValueAt(t, i\[2]*nCols+yCol), tracks.getValueAt(t, i\[3]*nCols+yCol)] \n import math \n mx = sum(x) / 4 \n my = sum(y) / 4 \n x = \[x\[0] - mx, x\[1] - mx, x\[2] - mx, x\[3] - mx] \n y = \[y\[0] - my, y\[1] - my, y\[2] - my, y\[3] - my] \n a = \[math.pi + math.atan2(y\[0],x\[0]), math.pi + math.atan2(y\[1],x\[1]), math.pi + math.atan2(y\[2],x\[2]), math.pi + math.atan2(y\[3],x\[3])] \n idx = sorted(range(len(i)),key=a.__getitem__) \n idx = \[i\[idx\[0]], i\[idx\[1]], i\[idx\[2]], i\[idx\[3]] ] \n return idx \n\n\ndef linkAllPoints():\n tracker = nuke.selectedNode()\n curframe = nuke.frame()\n idx = fourCornersOfAConvexPoly(curframe)\n if len(idx) != 4:\n nuke.critical('To link all points by default you need to select exactly 4 tracks on the Tracker node.')\n else:\n x = tracker.xpos()\n y = tracker.ypos()\n w = tracker.screenWidth()\n h = tracker.screenHeight()\n m = int(x + w/2)\n numviews = len(nuke.views())\n strcurframe = str(curframe)\n \n pin = originalThisNode\n # pin.setInput(0,None)\n # pin.setXYpos(int(m + w), int(y + w/2))\n \n pin.knob(\"from1\").setExpression(tracker.name()+'.tracks.'+str(idx\[0]+1)+'.track_x('+strcurframe+')',0)\n pin.knob(\"from1\").setExpression(tracker.name()+'.tracks.'+str(idx\[0]+1)+'.track_y('+strcurframe+')',1)\n pin.knob(\"from2\").setExpression(tracker.name()+'.tracks.'+str(idx\[1]+1)+'.track_x('+strcurframe+')',0)\n pin.knob(\"from2\").setExpression(tracker.name()+'.tracks.'+str(idx\[1]+1)+'.track_y('+strcurframe+')',1)\n pin.knob(\"from3\").setExpression(tracker.name()+'.tracks.'+str(idx\[2]+1)+'.track_x('+strcurframe+')',0)\n pin.knob(\"from3\").setExpression(tracker.name()+'.tracks.'+str(idx\[2]+1)+'.track_y('+strcurframe+')',1)\n pin.knob(\"from4\").setExpression(tracker.name()+'.tracks.'+str(idx\[3]+1)+'.track_x('+strcurframe+')',0)\n pin.knob(\"from4\").setExpression(tracker.name()+'.tracks.'+str(idx\[3]+1)+'.track_y('+strcurframe+')',1)\n \n pin.knob(\"to1\").setExpression(tracker.name()+'.tracks.'+str(idx\[0]+1)+'.track_x'+'+Offset1.x',0)\n pin.knob(\"to1\").setExpression(tracker.name()+'.tracks.'+str(idx\[0]+1)+'.track_y'+'+Offset1.y',1)\n pin.knob(\"to2\").setExpression(tracker.name()+'.tracks.'+str(idx\[1]+1)+'.track_x'+'+Offset2.x',0)\n pin.knob(\"to2\").setExpression(tracker.name()+'.tracks.'+str(idx\[1]+1)+'.track_y'+'+Offset2.y',1)\n pin.knob(\"to3\").setExpression(tracker.name()+'.tracks.'+str(idx\[2]+1)+'.track_x'+'+Offset3.x',0)\n pin.knob(\"to3\").setExpression(tracker.name()+'.tracks.'+str(idx\[2]+1)+'.track_y'+'+Offset3.y',1)\n pin.knob(\"to4\").setExpression(tracker.name()+'.tracks.'+str(idx\[3]+1)+'.track_x'+'+Offset4.x',0)\n pin.knob(\"to4\").setExpression(tracker.name()+'.tracks.'+str(idx\[3]+1)+'.track_y'+'+Offset4.y',1)\n \n # pin.knob(\"label\").setValue(\"using reference frame\")\n\n\ndef trackers():\n trackersList = \[]\n for node in nuke.allNodes():\n # node\['selected'].setValue(False)\n if node.Class() == 'Tracker4':\n trackerName = node\['name'].getValue()\n trackersList.append(trackerName)\n trackersList = sorted(trackersList)\n return trackersList\n\n\n##########################################################\n\noriginalThisNode = nuke.thisNode()\nnuke.root().begin()\n\nif len(nuke.selectedNodes()) == 1:\n if nuke.selectedNode().Class() == 'Tracker4':\n linkAllPoints()\n else:\n nuke.message('Please, select the Tracker node and points you want to link.')\nelse:\n nuke.message('Please, select the Tracker node and points you want to link.')" +STARTLINE}
addUserKnob {41 to1 T MAIN_CornerPin2D.to1}
addUserKnob {41 enable1 -STARTLINE T MAIN_CornerPin2D.enable1}
addUserKnob {22 Link1 l "Link Point 1" t "Use this button to select the Tracker and the track point you want to link to point number 1." -STARTLINE T "def trackers():\n trackersList = \[]\n for node in nuke.allNodes():\n # node\['selected'].setValue(False)\n if node.Class() == 'Tracker4':\n trackerName = node\['name'].getValue()\n trackersList.append(trackerName)\n trackersList = sorted(trackersList)\n return trackersList\n\n\ndef trackPoints():\n trackPointsList = \[]\n tracker = nuke.selectedNode()\n tracks = tracker\['tracks'].toScript().split('\\n \{')\[1:]\n track_count = len(tracks)\n for idx in range(track_count):\n track_name = tracks\[idx].split('\"')\[1]\n trackPointsList.append(track_name)\n return trackPointsList\n\n\ndef linkPoint():\n class trackersPanel(nukescripts.PythonPanel):\n def __init__(self):\n nukescripts.PythonPanel.__init__(self, 'Available Trackers')\n # self.rpNode = node\n # Create knobs.\n self.trackerNodesList = nuke.Enumeration_Knob('trackerNodesList', 'Tracker Nodes', trackers())\n self.trackerNodesList.setTooltip('Select the Tracker Node to link to your CornerPin.')\n try:\n self.trackerNodesList.setValue(nuke.selectedNode()\['name'].getValue())\n except ValueError:\n pass\n self.tracksList = nuke.Enumeration_Knob('tracksList', 'Track Points', trackPoints())\n # Add knobs created right above.\n self.addKnob(self.trackerNodesList)\n self.addKnob(self.tracksList) \n \n def knobChanged(self, knob):\n # We check if the knob that was changed was allWriteNodes, and change writeNodesList accordingly. \n if knob == self.trackerNodesList:\n option = self.trackerNodesList.value()\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n nuke.toNode(str(option))\['selected'].setValue(True)\n try: \n self.tracksList.setValues(trackPoints())\n except IndexError:\n self.tracksList.setValue('') \n \n panel = trackersPanel()\n if panel.showModalDialog():\n trackerChosen = panel.trackerNodesList.value()\n pointChosen = panel.tracksList.getValue() + 1\n frame = nuke.frame()\n originalThisNode\['to1'].setExpression('%s.tracks.%s.track_x+Offset1.x' % (trackerChosen,int(pointChosen)), 0)\n originalThisNode\['to1'].setExpression('%s.tracks.%s.track_y+Offset1.y' % (trackerChosen,int(pointChosen)), 1)\n originalThisNode\['from1'].setExpression('%s.tracks.%s.track_x(%s)' % (trackerChosen,int(pointChosen),frame), 0)\n originalThisNode\['from1'].setExpression('%s.tracks.%s.track_y(%s)' % (trackerChosen,int(pointChosen),frame), 1)\n\n\n\n##########################################################\n\noriginalThisNode = nuke.thisNode()\nnuke.root().begin()\n\nif len(nuke.selectedNodes()) <= 1:\n try:\n if nuke.selectedNode().Class() == 'Tracker4':\n linkPoint()\n else:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\n except ValueError:\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\nelse:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()"}
addUserKnob {41 to2 T MAIN_CornerPin2D.to2}
addUserKnob {41 enable2 -STARTLINE T MAIN_CornerPin2D.enable2}
addUserKnob {22 Link2 l "Link Point 2" t "Use this button to select the Tracker and the track point you want to link to point number 2." -STARTLINE T "def trackers():\n trackersList = \[]\n for node in nuke.allNodes():\n # node\['selected'].setValue(False)\n if node.Class() == 'Tracker4':\n trackerName = node\['name'].getValue()\n trackersList.append(trackerName)\n trackersList = sorted(trackersList)\n return trackersList\n\n\ndef trackPoints():\n trackPointsList = \[]\n tracker = nuke.selectedNode()\n tracks = tracker\['tracks'].toScript().split('\\n \{')\[1:]\n track_count = len(tracks)\n for idx in range(track_count):\n track_name = tracks\[idx].split('\"')\[1]\n trackPointsList.append(track_name)\n return trackPointsList\n\n\ndef linkPoint():\n class trackersPanel(nukescripts.PythonPanel):\n def __init__(self):\n nukescripts.PythonPanel.__init__(self, 'Available Trackers')\n # self.rpNode = node\n # Create knobs.\n self.trackerNodesList = nuke.Enumeration_Knob('trackerNodesList', 'Tracker Nodes', trackers())\n self.trackerNodesList.setTooltip('Select the Tracker Node to link to your CornerPin.')\n try:\n self.trackerNodesList.setValue(nuke.selectedNode()\['name'].getValue())\n except ValueError:\n pass\n self.tracksList = nuke.Enumeration_Knob('tracksList', 'Track Points', trackPoints())\n # Add knobs created right above.\n self.addKnob(self.trackerNodesList)\n self.addKnob(self.tracksList) \n \n def knobChanged(self, knob):\n # We check if the knob that was changed was allWriteNodes, and change writeNodesList accordingly. \n if knob == self.trackerNodesList:\n option = self.trackerNodesList.value()\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n nuke.toNode(str(option))\['selected'].setValue(True)\n try: \n self.tracksList.setValues(trackPoints())\n except IndexError:\n self.tracksList.setValue('') \n \n panel = trackersPanel()\n if panel.showModalDialog():\n trackerChosen = panel.trackerNodesList.value()\n pointChosen = panel.tracksList.getValue() + 1\n frame = nuke.frame()\n originalThisNode\['to2'].setExpression('%s.tracks.%s.track_x+Offset2.x' % (trackerChosen,int(pointChosen)), 0)\n originalThisNode\['to2'].setExpression('%s.tracks.%s.track_y+Offset2.y' % (trackerChosen,int(pointChosen)), 1)\n originalThisNode\['from2'].setExpression('%s.tracks.%s.track_x(%s)' % (trackerChosen,int(pointChosen),frame), 0)\n originalThisNode\['from2'].setExpression('%s.tracks.%s.track_y(%s)' % (trackerChosen,int(pointChosen),frame), 1)\n\n##########################################################\n\noriginalThisNode = nuke.thisNode()\nnuke.root().begin()\n\nif len(nuke.selectedNodes()) <= 1:\n try:\n if nuke.selectedNode().Class() == 'Tracker4':\n linkPoint()\n else:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\n except ValueError:\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\nelse:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()"}
addUserKnob {41 to3 T MAIN_CornerPin2D.to3}
addUserKnob {41 enable3 -STARTLINE T MAIN_CornerPin2D.enable3}
addUserKnob {22 Link3 l "Link Point 3" t "Use this button to select the Tracker and the track point you want to link to point number 3." -STARTLINE T "def trackers():\n trackersList = \[]\n for node in nuke.allNodes():\n # node\['selected'].setValue(False)\n if node.Class() == 'Tracker4':\n trackerName = node\['name'].getValue()\n trackersList.append(trackerName)\n trackersList = sorted(trackersList)\n return trackersList\n\n\ndef trackPoints():\n trackPointsList = \[]\n tracker = nuke.selectedNode()\n tracks = tracker\['tracks'].toScript().split('\\n \{')\[1:]\n track_count = len(tracks)\n for idx in range(track_count):\n track_name = tracks\[idx].split('\"')\[1]\n trackPointsList.append(track_name)\n return trackPointsList\n\n\ndef linkPoint():\n class trackersPanel(nukescripts.PythonPanel):\n def __init__(self):\n nukescripts.PythonPanel.__init__(self, 'Available Trackers')\n # self.rpNode = node\n # Create knobs.\n self.trackerNodesList = nuke.Enumeration_Knob('trackerNodesList', 'Tracker Nodes', trackers())\n self.trackerNodesList.setTooltip('Select the Tracker Node to link to your CornerPin.')\n try:\n self.trackerNodesList.setValue(nuke.selectedNode()\['name'].getValue())\n except ValueError:\n pass\n self.tracksList = nuke.Enumeration_Knob('tracksList', 'Track Points', trackPoints())\n # Add knobs created right above.\n self.addKnob(self.trackerNodesList)\n self.addKnob(self.tracksList) \n \n def knobChanged(self, knob):\n # We check if the knob that was changed was allWriteNodes, and change writeNodesList accordingly. \n if knob == self.trackerNodesList:\n option = self.trackerNodesList.value()\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n nuke.toNode(str(option))\['selected'].setValue(True)\n try: \n self.tracksList.setValues(trackPoints())\n except IndexError:\n self.tracksList.setValue('') \n \n panel = trackersPanel()\n if panel.showModalDialog():\n trackerChosen = panel.trackerNodesList.value()\n pointChosen = panel.tracksList.getValue() + 1\n frame = nuke.frame()\n originalThisNode\['to3'].setExpression('%s.tracks.%s.track_x+Offset3.x' % (trackerChosen,int(pointChosen)), 0)\n originalThisNode\['to3'].setExpression('%s.tracks.%s.track_y+Offset3.y' % (trackerChosen,int(pointChosen)), 1)\n originalThisNode\['from3'].setExpression('%s.tracks.%s.track_x(%s)' % (trackerChosen,int(pointChosen),frame), 0)\n originalThisNode\['from3'].setExpression('%s.tracks.%s.track_y(%s)' % (trackerChosen,int(pointChosen),frame), 1)\n\n##########################################################\n\noriginalThisNode = nuke.thisNode()\nnuke.root().begin()\n\nif len(nuke.selectedNodes()) <= 1:\n try:\n if nuke.selectedNode().Class() == 'Tracker4':\n linkPoint()\n else:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\n except ValueError:\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\nelse:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()"}
addUserKnob {41 to4 T MAIN_CornerPin2D.to4}
addUserKnob {41 enable4 -STARTLINE T MAIN_CornerPin2D.enable4}
addUserKnob {22 Link4 l "Link Point 4" t "Use this button to select the Tracker and the track point you want to link to point number 4." -STARTLINE T "def trackers():\n trackersList = \[]\n for node in nuke.allNodes():\n # node\['selected'].setValue(False)\n if node.Class() == 'Tracker4':\n trackerName = node\['name'].getValue()\n trackersList.append(trackerName)\n trackersList = sorted(trackersList)\n return trackersList\n\n\ndef trackPoints():\n trackPointsList = \[]\n tracker = nuke.selectedNode()\n tracks = tracker\['tracks'].toScript().split('\\n \{')\[1:]\n track_count = len(tracks)\n for idx in range(track_count):\n track_name = tracks\[idx].split('\"')\[1]\n trackPointsList.append(track_name)\n return trackPointsList\n\n\ndef linkPoint():\n class trackersPanel(nukescripts.PythonPanel):\n def __init__(self):\n nukescripts.PythonPanel.__init__(self, 'Available Trackers')\n # self.rpNode = node\n # Create knobs.\n self.trackerNodesList = nuke.Enumeration_Knob('trackerNodesList', 'Tracker Nodes', trackers())\n self.trackerNodesList.setTooltip('Select the Tracker Node to link to your CornerPin.')\n try:\n self.trackerNodesList.setValue(nuke.selectedNode()\['name'].getValue())\n except ValueError:\n pass\n self.tracksList = nuke.Enumeration_Knob('tracksList', 'Track Points', trackPoints())\n # Add knobs created right above.\n self.addKnob(self.trackerNodesList)\n self.addKnob(self.tracksList) \n \n def knobChanged(self, knob):\n # We check if the knob that was changed was allWriteNodes, and change writeNodesList accordingly. \n if knob == self.trackerNodesList:\n option = self.trackerNodesList.value()\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n nuke.toNode(str(option))\['selected'].setValue(True)\n try: \n self.tracksList.setValues(trackPoints())\n except IndexError:\n self.tracksList.setValue('') \n \n panel = trackersPanel()\n if panel.showModalDialog():\n trackerChosen = panel.trackerNodesList.value()\n pointChosen = panel.tracksList.getValue() + 1\n frame = nuke.frame()\n originalThisNode\['to4'].setExpression('%s.tracks.%s.track_x+Offset4.x' % (trackerChosen,int(pointChosen)), 0)\n originalThisNode\['to4'].setExpression('%s.tracks.%s.track_y+Offset4.y' % (trackerChosen,int(pointChosen)), 1)\n originalThisNode\['from4'].setExpression('%s.tracks.%s.track_x(%s)' % (trackerChosen,int(pointChosen),frame), 0)\n originalThisNode\['from4'].setExpression('%s.tracks.%s.track_y(%s)' % (trackerChosen,int(pointChosen),frame), 1)\n\n##########################################################\n\noriginalThisNode = nuke.thisNode()\nnuke.root().begin()\n\nif len(nuke.selectedNodes()) <= 1:\n try:\n if nuke.selectedNode().Class() == 'Tracker4':\n linkPoint()\n else:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\n except ValueError:\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()\nelse:\n for i in nuke.allNodes():\n i\['selected'].setValue(False)\n firstTracker = trackers()\[0]\n nuke.toNode(str(firstTracker))\['selected'].setValue(True)\n linkPoint()"}
addUserKnob {22 setToInputTO l "Set to input" t "Use this button to move the points to the corners of the input format. If there is no input the points will adjust to the script format." T "try:\n if nuke.thisNode()\['to1'].isAnimated() or nuke.thisNode()\['to2'].isAnimated() or nuke.thisNode()\['to3'].isAnimated() or nuke.thisNode()\['to4'].isAnimated():\n if nuke.ask('These knobs have an animation or expression.\\nDo you want to remove it and set the values like the input?'):\n nuke.thisNode()\['to1'].clearAnimated()\n nuke.thisNode()\['to2'].clearAnimated()\n nuke.thisNode()\['to3'].clearAnimated()\n nuke.thisNode()\['to4'].clearAnimated()\n\n f = None\n try:\n f = nuke.thisNode().input(0).format()\n except:\n f = nuke.root().format()\n \n nuke.thisNode()\['to1'].setValue(0)\n nuke.thisNode()\['to2'].setValue(f.width(), 0)\n nuke.thisNode()\['to2'].setValue(0, 1)\n nuke.thisNode()\['to3'].setValue(f.width(), 0)\n nuke.thisNode()\['to3'].setValue(f.height(), 1)\n nuke.thisNode()\['to4'].setValue(0, 0)\n nuke.thisNode()\['to4'].setValue(f.height(), 1)\n\nexcept AttributeError:\n pass" +STARTLINE}
addUserKnob {41 copy_from l "Copy 'from'" -STARTLINE T MAIN_CornerPin2D.copy_from}
addUserKnob {26 ""}
addUserKnob {41 invert T MAIN_CornerPin2D.invert}
addUserKnob {41 filter T MAIN_CornerPin2D.filter}
addUserKnob {41 clamp -STARTLINE T MAIN_CornerPin2D.clamp}
addUserKnob {41 black_outside l "black outside" -STARTLINE T MAIN_CornerPin2D.black_outside}
addUserKnob {41 motionblur T MAIN_CornerPin2D.motionblur}
addUserKnob {41 shutter T MAIN_CornerPin2D.shutter}
addUserKnob {41 shutteroffset l "shutter offset" T MAIN_CornerPin2D.shutteroffset}
addUserKnob {41 shuttercustomoffset l "" -STARTLINE T MAIN_CornerPin2D.shuttercustomoffset}
addUserKnob {20 endGroup n -1}
addUserKnob {20 From n 1}
addUserKnob {41 from1 T MAIN_CornerPin2D.from1}
addUserKnob {41 from2 T MAIN_CornerPin2D.from2}
addUserKnob {41 from3 T MAIN_CornerPin2D.from3}
addUserKnob {41 from4 T MAIN_CornerPin2D.from4}
addUserKnob {22 setToInputFROM l "Set to input" t "Use this button to move the points to the corners of the input format. If there is no input the points will adjust to the script format." T "try:\n if nuke.thisNode()\['from1'].isAnimated() or nuke.thisNode()\['from2'].isAnimated() or nuke.thisNode()\['from3'].isAnimated() or nuke.thisNode()\['from4'].isAnimated():\n if nuke.ask('These knobs have an animation or expression.\\nDo you want to remove it and set the values like the input?'):\n nuke.thisNode()\['from1'].clearAnimated()\n nuke.thisNode()\['from2'].clearAnimated()\n nuke.thisNode()\['from3'].clearAnimated()\n nuke.thisNode()\['from4'].clearAnimated()\n\n f = None\n try:\n f = nuke.thisNode().input(0).format()\n except:\n f = nuke.root().format()\n \n nuke.thisNode()\['from1'].setValue(0)\n nuke.thisNode()\['from2'].setValue(f.width(), 0)\n nuke.thisNode()\['from2'].setValue(0, 1)\n nuke.thisNode()\['from3'].setValue(f.width(), 0)\n nuke.thisNode()\['from3'].setValue(f.height(), 1)\n nuke.thisNode()\['from4'].setValue(0, 0)\n nuke.thisNode()\['from4'].setValue(f.height(), 1)\n\nexcept AttributeError:\n pass" +STARTLINE}
addUserKnob {41 copy_to l "Copy 'to'" -STARTLINE T MAIN_CornerPin2D.copy_to}
addUserKnob {22 useCurrentFrame l "Use Current Frame" t "Change the values of the \"From\" points to the values of \"To\" points in the current frame." -STARTLINE T "frame = nuke.frame()\nif nuke.thisNode()\['from1'].hasExpression() or nuke.thisNode()\['from2'].hasExpression() or nuke.thisNode()\['from3'].hasExpression() or nuke.thisNode()\['from4'].hasExpression():\n if nuke.ask('These knobs already have an expression. Remove and set current frame?'):\n nuke.thisNode()\['from1'].clearAnimated()\n nuke.thisNode()\['from2'].clearAnimated()\n nuke.thisNode()\['from3'].clearAnimated()\n nuke.thisNode()\['from4'].clearAnimated()\n nuke.thisNode()\['from1'].setExpression('parent.to1(%s)' % frame)\n nuke.thisNode()\['from2'].setExpression('parent.to2(%s)' % frame)\n nuke.thisNode()\['from3'].setExpression('parent.to3(%s)' % frame)\n nuke.thisNode()\['from4'].setExpression('parent.to4(%s)' % frame)\n else:\n print 'Canceled by user'\nelse:\n nuke.thisNode()\['from1'].setExpression('parent.to1(%s)' % frame)\n nuke.thisNode()\['from2'].setExpression('parent.to2(%s)' % frame)\n nuke.thisNode()\['from3'].setExpression('parent.to3(%s)' % frame)\n nuke.thisNode()\['from4'].setExpression('parent.to4(%s)' % frame)"}
addUserKnob {20 endGroup_1 l endGroup n -1}
addUserKnob {20 Offset n 1}
addUserKnob {12 Offset1 l "Offset 1" t "Once the knobs in \"To\" are linked to a Tracker node, this offsets the values of \"to1\" in X and Y."}
addUserKnob {12 Offset2 l "Offset 2" t "Once the knobs in \"To\" are linked to a Tracker node, this offsets the values of \"to1\" in X and Y."}
addUserKnob {12 Offset3 l "Offset 3" t "Once the knobs in \"To\" are linked to a Tracker node, this offsets the values of \"to1\" in X and Y."}
addUserKnob {12 Offset4 l "Offset 4" t "Once the knobs in \"To\" are linked to a Tracker node, this offsets the values of \"to1\" in X and Y."}
addUserKnob {20 endGroup_2 l endGroup n -1}
addUserKnob {26 author l JNM2020 +INVISIBLE T "Build by Javier Nieto Moncó. 2020"}
addUserKnob {6 f_created l "First Created?" +INVISIBLE +STARTLINE}
f_created true
}
Input {
inputs 0
name Input1
xpos 535
ypos -115
}
CornerPin2D {
to1 {0 0}
to2 {0 0}
to3 {0 0}
to4 {0 0}
invert false
from1 {0 0}
from2 {0 0}
from3 {0 0}
from4 {0 0}
name MAIN_CornerPin2D
selected true
xpos 535
ypos -21
}
Output {
name Output1
xpos 535
ypos 79
}
end_group