Handling FBX
Posted in: Nuke Plugins & ScriptsThere is any way to create a tool split objects from one FBX file. Like extract a passChannel from .exr file using shuffle node.
Expert scripting Hands need pls.
A nuke.Boolean_Knob issue
Posted in: Nuke Plugins & ScriptsI got a nuke.Boolean_Knob issue.
Here is my script:
# create a panel class
makeSnapsPanel = nukescripts.PythonPanel('Make Snapshots', 'makeSnaps')
useOriginalSizeBo = nuke.Boolean_Knob('useOriginalSize', 'Use Original Size')
useOriginalSizeBo.setValue(True)
# Add knobs
makeSnapsPanel.addKnob(useOriginalSizeBo)
makeSnapsPanel.show()
I want to run some script each time I click the nuke.Boolean_Knob.
For instance, each time I change the state of the nuke.Boolean_Knob, it prints something like useOriginalSizeBo.value()
How to do that?
I used help(nuke.Boolean_Knob) to get all the information of it.
But I have not found any useful function.
Anybody know this thing?
Thank you so much!
One Class Issue
Posted in: Nuke Plugins & ScriptsI wanted to create a panel to batch making snapshot.
The idea is to render the first frame of each quicktime file.
I created a function to do the batch render thing. Then I created the panel.
Here’s the function:
# create a function to make snapshots
def makeSnap(qtPath, snapPath, snapFrame):
qts = os.listdir(qtPath)
qts.sort()
for i in qts:
if i[0] != '.' and i[-4:] == '.mov':
# create a Read node with the qt file
setFile = 'file '
setFile += '"' + qtPath + i
setFile += '"'
qt = nuke.createNode('Read', setFile, inpanel=False)
# create a Write node with jpg output
splitextArray = os.path.splitext(i)
qtName = splitextArray[0]
snapName = qtName + '.jpg'
write = nuke.nodes.Write()
write.setName('Write1')
write['file_type'].setValue('jpeg')
write['_jpeg_quality'].setValue(1)
write['file'].setValue(snapPath + snapName)
write.setInput(0, qt)
#nuke.connectViewer(0,write)
# start render
nuke.render('root.%s' % write.name(), snapFrame, snapFrame)
# after rendering, delete nodes
for n in [qt, write]:
nuke.delete(n)
I worked pretty well. But when I wanted to wrap the script into a Class, the problem came out.
It seems like that when the function wraps into the Class, this line, write[‘file_type’].setValue(‘jpeg’), doesn’t work out.
When this line runs just as a part of the function, it works well. But when this line runs as a part of the Class, it’s only changing the file_type property of the write node, but the relative ‘_jpey_quality’ doesn’t come out. So I got a problem when the line write[‘_jpeg_quality’].setValue(1) runs.
Is there something I need to pay attention to when building Class?
That all works fine. As a last step we want to delete the original exr (render.###.exr) and rename the temp file (render.###.exr.tmp) to replace the old file (render.###.exr). We are on Windows, so we are doing this by calling DOS commands (del and ren) from the python script (os.system).
Trouble is, since the EXR file is loaded in Nuke in the read node it says the file is in use when we try to delete it. We tried killing the Nuke process, but then it kills the script too. Does anyone know a way around this?:thanks:
nuke.render() can’t work!
Posted in: Nuke Plugins & ScriptsAnd 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:
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.
I don’t know why.
Is there something different when putting function to the panel?
Is there any plugin floating aroung to convert a 2D image to 3d using z depth ? there is a plugin for after effects but cant find one for nuke …
Thanks
i work on it since several month and… no way, i don’t find how to export xml from final cut and load them in nuke.
it’s certainly possible, i’ve see some people have working on it to on the forum.
please can someone know how to do this ?
i work on my own movie and… damn 582 shot to send to nuke !
thanks for your help
cheers
init.py (mac)
Posted in: Nuke Plugins & ScriptsI am using a mac and I already did what I want to do on windows it worked, but here I can’t get it right. So here is my problem:
I have a folder on my mac with all my plugins.
I want the init.py to say to go check this folder first.
First question:
where do I put this init.py
and second question: is my init.py right or wrong?
nuke.pluginAddPath("myharddrive/SETTINGS/")
# add path for user installed .gizmo files
nuke.pluginAppendPath("myharddrive/SETTINGS/plugins/" + "/gizmos")
# add path for user installed .tcl files
nuke.pluginAppendPath("myharddrive/SETTINGS/plugins/" + "/tcl")
# add path for user installed icons
nuke.pluginAppendPath("myharddrive/SETTINGS/plugins/" + "/icons")
# add path for user installed python scripts
sys.path.append("myharddrive/SETTINGS/plugins/" + "/python")
maybe the path on my mac is not good but I don’t know how to write it.
Thanks guys for helping