nuke.render() can’t work!

I made a tool called Make Snapshots which worked pretty well.
And then I wanted to make a panel and put some button and label on it.
But this time I got some problems.The nuke.render() didn’t work.
So to find why I made a simply test and here’s my simplified script:

Code:


def startMakingSnaps():
    wt = nuke.selectedNode()
    nuke.render(wt.name(), 1, 1)
             
 # create a panel class
 makeSnapsPanel = nukescripts.PythonPanel('Make Snapshots', 'makeSnaps')
 
 # Create knobs
 qtPathKnob = nuke.String_Knob('qtPath', 'QT Path:')
 snapsPathKnob = nuke.String_Knob('snapsPath', 'Snapshots Path:')
 fsOffsetKnob = nuke.String_Knob('fsOffset', 'Frames Offset:')
 makeSnapsKnob = nuke.PyScript_Knob('makeSnaps', 'Make Snapshots')

 makeSnapsKnob.setCommand('startMakingSnaps()')
 
 # Add knobs
 makeSnapsPanel.addKnob(qtPathKnob)
 makeSnapsPanel.addKnob(snapsPathKnob)
 makeSnapsPanel.addKnob(fsOffsetKnob)
 makeSnapsPanel.addKnob(makeSnapsKnob)
 
 makeSnapsPanel.show()


Then I got a panel and I clicked the button and a message window poped up to me which said that: Nothing is named "Write1".
But the write node’s name is really "Write1".
Then I run this line alone nuke.render(wt.name(), 1, 1) and it worked.

Attachment 10179

I don’t know why.
Is there something different when putting function to the panel?

Attached Thumbnails

Click image for larger version

Name:	Snapshot.jpg
Views:	N/A
Size:	77.1 KB
ID:	10179
 

No Responses to “nuke.render() can’t work!”

Post a Comment