Bilateral Filter

Hi Folk,

Does anybody as found a Gizmo or plugin of Bilateral filter that’ s work very well or better than the one come with Nuke. I found couple of stuffs running on GPU and seem very interresting and other little software could run in realtime. I would like something similar like Surface Blur in Photoshop or better. I had the code source… Maybe we can retranscript the code for something usefull for Nuke! Thank you!

assembling one big image from smaller ones

Say there’s a sequence composed of 16 smaller images (256×256, a01~a16.tga) and I would like them to be assembled into one single big image (1024×1024) in forms of 4 rows by 4 columns,
how can I do this using nuke nodes, or via scripting(python/tcl gizmo or writing custom nodes etc)?

I rendered some fire effects image seqs and would like to combine them all to one.

something like this:
(from)
o, o, o, o, o, o, o, o, o, o, o, o, o, o, o, o (16 individual 256×256 images)

(to)
o o o o
o o o o
o o o o
o o o o (1 1024×1024 image)

Thanks in advance.

nNuke NDK, accessing extra EXR layers/channels

Greetings guys,
I’m new to the nuke ndk and I’m trying to figure out how to make my operator plugin access other layers/channels coming in from a single exrReader node.
for example, i have a single exr file that contains multiple render passes that i’ve rendered out via maya and if you looked at the the exr’s channel list through a shuffle node in nuke you would see the typical rgb, rgba, alpha, and then pass1, pass2, pass3, etc… the extra layers also show up under "other layers" in nukes channel lists as well. so im trying to figure out how to access those other layers/channel in my operator code and have not found any examples or useful information in the ndk docs related to that specifically and was wondering if anyone here knows how to do that in c++. I haven’t found any find channel by name type functions either, I’m guessing the the nuke design is to keep it as node based as possible, but i need to be able to access all of the different pass layers from a single plugin/node, instead of having to set up shuffle nodes to select each layer that i need. Any help would be much appreciated or even some code to show how to list the names of all the channels/layers coming from the single exrReader node and how to read data from those channels in my engine() function. Any advice is much appreciated.

Accessing value in a node

Hi everyone,

I just started learning Python and I was wondering how do you go about dividing or multiplying a value inside a node..?

for example I have 3 cards in a scene and I want to multiply their scale value by 2.

I managed to figure out how to set all of their scale to the same value by running this script:

for node in nuke.allNodes( ‘Card’ ):
x = node[‘uniform_scale’]
x.setValue ( 1 )

how can I multiply that value?

run nuke.scriptNew() with its own python script attached to it

Hey guys, I’m trying to write a simple script that will open a new nuke script and automatically run commands within that newly created nuke script.

For example: I want to copy my selected node into a new nuke script. So I would copy my selected node to clipboard, open a new script and run the paste command within that new script..

any ideas?

Close properties window for python created node?

I’m using a Py script to create a slate and write node. But every time it creates them it opens their properties panes. What is the Python command to close these panes?

Thanks

S

node.Inputs help

hello fellas,

is there a way to get the inputs of a node by name not by number? like the scanlineRender node inputs would be: cam, scn/obj, bg, since i am having trouble connecting nodes by the numbers. from my testing it didnt work like
node.setInput("cam", node). so i guess the onlay way would be to say something like (fantasy syntax):

ScanlineRender.input (1) = "cam"
ScanlineRender.input (2) = "scn/obj"

is there a way to get to get the inputs like that? i find the inputs are hard to controll, since there are many hidden inputs and those numbers are not comfortable to work with.

for any help or hint i would be thankful,

greetings, jaden

alpha bbox

I’m trying to create a script that creates a bounding box around a node’s alpha channel. Does anyone know if there is a way to isolate the nonzero area of a node’s alpha channel (preferably without using sample()) in order to get its bbox coordinates?

Accessing RotoShapes within a Rotopaint Node

Is there a way to access and change the rotoshape properties in a Rotopaint Node using python? Specifically I’m trying to change the view knob for each spline in a given rotopaint node. I can’t seem to figure out how to access and change the values for the shapes themselves.

knob auto updating

I’m trying to create a script for rendering stereoscopic views. The script detects a bunch of stuff in the node tree and creates separate write nodes for the left and right eye views.

The trouble I’m having is my testing artists have requested that I make the views auto-update if the filename is changed. I originally thought I could do this with a tcl expression but the problem is, in the required naming convention, the left eye view needs a "-L" at the end of the filename and the right eye view needs a "-R". So I somehow need to copy all of the information from leftWrite.knob(‘file’) excepth the last 11 characters. That isn’t so difficult but I’m having trouble getting it to update automatically. Is there any way to make the file knob in the right eye view write node update itself (minus 11 characters) whenever the file knob in the left eye view write node is changed?

PS Forgive my script if it seems daft, I’ve only been using python for a week. :confused:

Code:

def typeFinder(current, target):
    dependent = nuke.dependencies(current)
    if (len(dependent) > 0):
        for n in dependent:
            if (n.Class() == 'Read') and (len(nuke.channels(n)) > 1):
                path = n.knob('file').value()
                Ftype = path[-3:]
                target.knob('file_type').setValue(Ftype[:3])
            else:
                typeFinder(n, target)
               
def colorspaceFinder(current, target):
    dependent = nuke.dependencies(current)
    if (len(dependent) > 0):
        for n in dependent:
            if (n.Class() == 'Read') and (len(nuke.channels(n)) > 1):
                readColor = n.knob('colorspace').value()
                target.knob('colorspace').setValue(readColor)
            else:
                colorspaceFinder(n, target)

def stereoWrite():
    current = nuke.selectedNode()
    folderName = ''
    nameInput = ''
    panel = nuke.Panel("Render Path")
    panel.addFilenameSearch("Please choose a folder to render to:", folderName)
    panel.addSingleLineInput("Please input a name for the rendered files:", nameInput)
    panel.show()
    folder = panel.value("Please choose a folder to render to:")
    name = panel.value("Please input a name for the rendered files:")
    if (folder == ""):
        nuke.message("Please specify a render folder.")
    if (name == ""):
        nuke.message("Please specify a file name.")

    leftWrite = nuke.nodes.Write(name = 'Left Eye View')
    leftWrite.knob('channels').setValue('all')
    colorspaceFinder(current, leftWrite)
    typeFinder(current, leftWrite)
    extensionL = leftWrite.knob('file_type').value()
    leftWrite.knob('tile_color').setValue(4278190335L)
    leftWrite.setInput(0, current)
    leftWrite.knob('views').setValue('left')
    leftWrite.knob('file').setValue(folder + name + ".%04d-L." + extensionL)
    dependentL = nuke.dependencies(leftWrite)
    for n in dependentL:
        x = n.xpos()
        leftWrite.setXpos(x - 100)
        y = n.ypos()
        leftWrite.setYpos(y + 75)
   
    rightWrite = nuke.nodes.Write(name = 'Right Eye View')
    rightWrite.knob('channels').setValue('all')
    colorspaceFinder(current, rightWrite)
    typeFinder(current, rightWrite)
    extensionR = rightWrite.knob('file_type').value()
    rightWrite.knob('tile_color').setValue(16711680L)
    rightWrite.setInput(0, current)
    rightWrite.knob('views').setValue('right')
    rightWrite.knob('file').setValue(folder + name + ".%04d-R." + extensionR)
    dependentR = nuke.dependencies(rightWrite)
    for n in dependentR:
        x = n.xpos()
        rightWrite.setXpos(x + 100)
        y = n.ypos()
        rightWrite.setYpos(y + 75)


Forgot to mention, the naming convention follows the following pattern:
"path" / "clip_name" ".%04d" "stereo extension" "file type extension"