Create a camera node

Hi, I’m developing a plugin in C++ using the NDK. I have created a button called "create camera" and I can get the clic event with knob_changed method. When the user press that button, I need to create a camera node, a scene node and to connect them. How can I to that?

Handling FBX

My case is have a FBX file contain 20 objects. I want project each object separately. Currently i import my FBX 20 time’s and select each object.
There 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

Hi, guys.

I got a nuke.Boolean_Knob issue.

Here is my script:

Code:

# 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

Hi, guys.

I 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:

Code:

# 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?

nuke/python: delete/rename file after write?

We have a python script that we are using to convert the huge uncompressed EXR files from Mental Ray into ZIP compressed ones, on a frame by frame basis as they render so they do not fill up our disks. Basically the python script is launched by the Maya render after each frame, opens Nuke in terminal mode and does a ZIP compression on it, writing the compressed EXR out as a temp file.

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!

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
 

2D + Z-Depth conversion to stereo3D

Hi
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

Need script: final cut to nuke

hi
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

creating multiple inputs for gizmo

might be an easy question to answer but im trying to create a gizmo that will allow you to attach either an unlimited number or a high number of nodes to it. pretty much how the plus node works allowing you to attach 2 inputs to it then giving you a handle on the left side that allows you to attach more inputs.

cheers

init.py (mac)

Hello

I 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