State:New|TargetRelease:No Target|icon_bug|icon_nuke|database:public|Resolution:Fixed|BugID:590466|
setInput() in a node's onCreate callback will not succeed if the node is Copy/Pasted.# add an onCreate for all NoOp nodes, that connects them to the node named 'Grade1'def setNoOpInputOnCreate(): print("Running NoOp onCreate, input should be connected to Grade1") n = nuke.thisNode() n.setInput(0, nuke.toNode("Grade1")) nuke.addOnCreate(setNoOpInputOnCreate, nodeClass="NoOp")2) Create a Grade node in the Node Graph and deselect it.setInput() inside the callback.setInput(), the desired input connection will not be set if the node was created by being pasted into the Node Graph. setInput() in an onCreate callback by utilizing a Pyside2 singleShot() like in the example below:from PySide2.QtCore import QTimer def setNoOpInputOnCreate(): print("Running NoOp onCreate, input should be connected to Grade1") n = nuke.thisNode() QTimer.singleShot(0, lambda: n.setInput(0, nuke.toNode("Grade1"))) nuke.addOnCreate(setNoOpInputOnCreate, nodeClass="NoOp") We're sorry to hear that
Please tell us why