createNode then deleteNode

so below is my script. It works but only by assuming that the ReadGeo created by the script is named "ReadGeo1". Most of the time that works fine but you can see where it has a potential for undesired results. What I want it to do is create it, get the info it needs from it, then delete it; or maybe it doesn’t need to create it at all and there is a way to just get the info I need.
Any thoughts?

FYI: This is a small part of a much bigger script so if it seems pointless, that’s why

Code:

def warningPrompt():
    p = nuke.Panel("Warning")
    p.addMultilineTextInput('warning', "This can take several minutes. It is strongly recomended that you start from an empty nuke scrpit.")
    p.addButton("Cancel")
    p.addButton("Continue")
    if p.show():
        print 'ok'

        MyFBX = nuke.getFilename( 'select your FBX' , '*.fbx' )
       

######## The problem Starts Here ########

        nuke.createNode('ReadGeo2', 'file %s' % MyFBX)

        getRange = (nuke.toNode('ReadGeo1').knob('fbx_node_name').numValues()+1)
        nukescripts.node_delete()
        print getRange

warningPrompt()


No Responses to “createNode then deleteNode”

Post a Comment