#! /Applications/Nuke6.0v6-32/Nuke6.0v6.app/Contents/MacOS/Nuke6.0v6 -nx version 6.0 v6 Gizmo { lock_connections {{curve x1 0}} addUserKnob {20 User l "Contact Sheet Gizmo"} addUserKnob {3 frameInterval l "Frame Interval" t "Show frame ever x number of frames"} frameInterval 10 addUserKnob {3 rows l Rows} rows 3 addUserKnob {3 column l Column -STARTLINE} column 3 addUserKnob {26 CheckOne l "Check One:"} addUserKnob {6 imgResOn l "Set total dimension based individual image size" +STARTLINE} imgResOn true addUserKnob {3 imgWidth l Width} imgWidth 800 addUserKnob {3 imgHeight l Height -STARTLINE} imgHeight 400 addUserKnob {6 totalResOn l "Set total dimension based on document size " +STARTLINE} addUserKnob {3 widthk l Width} widthk 3000 addUserKnob {3 heightk l Height -STARTLINE} heightk 3000 addUserKnob {26 ""} addUserKnob {22 createHolds l Create t "Click this button each time frame interval is adjusted" -STARTLINE T "thisNode = nuke.thisNode()\ninterval = thisNode.knob('frameInterval').getValue()\n\nfor n in nuke.allNodes(\"FrameHold\"):\n nuke.delete(n)\n\nfor n in nuke.allNodes(\"ContactSheet\"):\n nuke.delete(n)\n\ngizmoName = str(thisNode.name())\n\nn = nuke.toNode(gizmoName)\n\n\nrangeClass = n.frameRange()\nlastFrame = rangeClass.last()\nfirstFrame = rangeClass.first()\ntotalRange = lastFrame - firstFrame\n\nfor n in nuke.allNodes(\"Input\"):\n i = n\n\n \nfor frame in xrange(firstFrame,lastFrame,interval):\n h = nuke.createNode(\"FrameHold\")\n h\['first_frame'].setValue(frame)\n \n h.setInput(0,i)\n\nfor n in nuke.allNodes(\"Output\"):\n o = n\n\nimgResOn = thisNode.knob('imgResOn').getValue()\ntotalResOn = thisNode.knob('totalResOn').getValue()\n\ncs = nuke.createNode(\"ContactSheet\")\n\nwidthEx = str(gizmoName + '.imgWidth*' + gizmoName + '.column')\nheightEx = str(gizmoName + '.imgHeight*' + gizmoName + '.rows')\n\nif (imgResOn == 1):\n print 'imgResOn'\n cs.knob('width').setExpression(widthEx)\n cs.knob('height').setExpression(heightEx)\n thisNode.knob('totalResOn').setValue(0)\n\nwidthkEx = str(gizmoName + '.widthk')\nheightkEx = str(gizmoName + '.heightk')\n\nif (totalResOn == 1):\n print 'totalResOn'\n cs.knob('width').setExpression(widthkEx)\n cs.knob('height').setExpression(heightkEx)\n thisNode.knob('imgResOn').setValue(0)\n\nrowsEx = str(gizmoName + '.rows')\ncolEx = str(gizmoName + '.column')\n\n#cs.knob('width').setExpression('ContactSheetGizmo.widthk')\n#cs.knob('height').setExpression('ContactSheetGizmo.heightk')\ncs.knob('rows').setExpression(rowsEx)\ncs.knob('columns').setExpression(colEx)\no.setInput(0,cs)\n\ncounter = 0\nfor n in nuke.allNodes(\"FrameHold\"):\n cs.setInput(counter,n)\n counter = counter + 1"} } Input { inputs 0 name Input1 xpos 542 ypos -89 } Output { name Output1 xpos 490 ypos 257 } end_group