oncreate() to call last selected node.

Hi , i got a little problem : i select a node and then add my gizmo (so this node’s output will pipe into my gizmo’s input), i want to check that last selected node is. so i add script to my gizmo, i use addoncreate or addonusercreate function, but both grab the wrong nodes :

Code:

def cframerange_oncreate():
        nuke.message(nuke.selectedNode().name())
       
nuke.addOnCreate(cframerange_oncreate,nodeClass='cframerange')


my gizmo is working fine, but the nuke.message() show the wrong node. It’s not the node i selected , but instead it reports node which inside my gizmo.

Does anyone have solution ?

thanx

No Responses to “oncreate() to call last selected node.”

Post a Comment