thisNode = nuke.thisNode() interval = thisNode.knob('frameInterval').getValue() for n in nuke.allNodes("FrameHold"): nuke.delete(n) for n in nuke.allNodes("ContactSheet"): nuke.delete(n) gizmoName = str(thisNode.name()) n = nuke.toNode(gizmoName) rangeClass = n.frameRange() lastFrame = rangeClass.last() firstFrame = rangeClass.first() totalRange = lastFrame - firstFrame for n in nuke.allNodes("Input"): i = n for frame in xrange(firstFrame,lastFrame,interval): h = nuke.createNode("FrameHold") h['first_frame'].setValue(frame) h.setInput(0,i) for n in nuke.allNodes("Output"): o = n imgResOn = thisNode.knob('imgResOn').getValue() totalResOn = thisNode.knob('totalResOn').getValue() cs = nuke.createNode("ContactSheet") widthEx = str(gizmoName + '.imgWidth*' + gizmoName + '.column') heightEx = str(gizmoName + '.imgHeight*' + gizmoName + '.rows') if (imgResOn == 1): print 'imgResOn' cs.knob('width').setExpression(widthEx) cs.knob('height').setExpression(heightEx) thisNode.knob('totalResOn').setValue(0) widthkEx = str(gizmoName + '.widthk') heightkEx = str(gizmoName + '.heightk') if (totalResOn == 1): print 'totalResOn' cs.knob('width').setExpression(widthkEx) cs.knob('height').setExpression(heightkEx) thisNode.knob('imgResOn').setValue(0) rowsEx = str(gizmoName + '.rows') colEx = str(gizmoName + '.column') cs.knob('rows').setExpression(rowsEx) cs.knob('columns').setExpression(colEx) o.setInput(0,cs) counter = 0 for n in nuke.allNodes("FrameHold"): cs.setInput(counter,n) counter = counter + 1