Pybox Nuke

Can anyone spare two minutes to write an idiot’s guide to pybox nuke?

I remember getting somewhere with it but I’ve completely forgotten.

All out nuke scripts and renders are kept on a local server. Can these still be used?

1 Like

Hey John,

All I’ve done with Pybox & Nuke was pass images in and get the render back. I haven’t done anything with exposing the controls of Nuke nodes in Flame yet.

Would they still be of help?

Absolutely - all I need to do is run something through an existing setup and am being lazy by not wanting to boot up nuke.

No problem. You should be able to take care of it in four steps:

  1. Put the path to your Nuke install in the Handler file:

  2. Modify your nuke script to have the appropriate Read and Write nodes (they need to be named like this)

  3. Drag a Pybox node into Batch and load the Nuke_px handler

  4. Load the Nuke script and you should be good to go.

Full disclosure this can be A LOT slower than just launching Nuke. It basically calls a command line render for each frame. I had a comp that took 5 mins in Nuke and 40 mins in Flame via PyBox on the same machine. But, if you’re dealing with someone who doesn’t know Nuke, etc, it’s seamless.

1 Like

So every time you want to do this, you have to edit the .py file?

Also your full disclosure is very informative - it seems pretty unattractive in light of this.

No, you only have to do that edit to the .py file once. Once the path is declared then you are good to go. PyBox really seems like a viable option if you’re trying to integrate something that cannot be done in Flame, or if you have a tool that can only be done in Nuke but you want to expose it to Flame artists. I’ve been building bespoke tools with Nuke Copycat and making them available to our Flame artists who don’t know Nuke. The major caveat with that is to treat it like something that you need to pre-render instead of keeping it live in your Batch comp.

Sorry - what I meant was you need to edit the .py for each new comp it seems since all out comps are stored on a server in shot folders within jobs. It just seems easier to open up nuke. I don’t really like using nuke much - it feels very awkward but it’s easier than editing a text file.

1 Like

Hey John. No…that .py file just specifies where Nuke is installed. Not your individual Nuke comps. Those you just load in the PyBox node as needed.

1 Like

Anyone tested Pybox with CentOS 8.2 and Nuke13? We can’t get it to work. Spits out a bunch of errors in the Flame shell.

Would anyone have an example of a pybox running a nuke process with exposed nuke parameters?
Or an explanation about how to expose nuke parameters in a pybox?

I’m not sure you can expose the parameters in Pybox.

I thought that was why we can design the pybox ui with different widgets (buttons, value fields, colors, dropdown)

Let me be more specific: it is my belief that nuke parameters (like baselight parameters) are not exposed in Pybox deliberately. Happy to be proved wrong.

Thanks John! And if I understand things correctly, happy to prove you wrong :slight_smile:
Thiago Porto shows that its possible in this video

2 Likes

Calling @tpo

Hey guys!
Yes there is a few parameters you can control inside Nuke from Flame UI using PyBox.
Not all options in Nuke in possible, but most of the options are. (If this is what yr asking?)
I like to create a Group node in Nuke, then you name what you want and in PyBox look for that to be available in Flame.
On the video above i was controlling lights with its Axis ops linked to the Pybox Flame UI.
Options that has Sliders in Nuke are the ones that work better. Option with buttons only i never had much success.
You add Transform for exemple, as adsk_UI, Flame pickups and reads

For exemple:
Nuke node which name starts with adsk_ can have its knobs exposed in Flame’s Pybox…

set cut_paste_input [stack 0]
version 13.2 v2
Group {
inputs 0
name adsk_UI
selected true
xpos -221
ypos -114
addUserKnob {20 User}
addUserKnob {41 adsk_translate l translate T Transform1.translate}
addUserKnob {41 adsk_scale l scale T Transform1.scale}
addUserKnob {41 adsk_saturation l saturation T ColorCorrect1.saturation}
addUserKnob {41 adsk_contrast l contrast T ColorCorrect1.contrast}
addUserKnob {41 adsk_gamma l gamma T ColorCorrect1.gamma}
addUserKnob {41 adsk_gain l gain T ColorCorrect1.gain}
}
Transform {
inputs 0
center {1024 778}
name Transform1
xpos -631
ypos -89
}
ColorCorrect {
name ColorCorrect1
selected true
xpos -631
ypos -63
}
end_group

2 Likes

Thanks Thiago, much appreciated!!!
Also I guess I’ve been lazy and didn’t scroll all the way down on the user manual page, there’s a section about it.
https://help.autodesk.com/view/FLAME/2022/ENU/?guid=Flame_API_Pybox_Documentation_html

2 Likes

1 Like

I like the slow walk better but this will do.

There’s really not much in the doc :frowning:
@tpo, would it be possible to shed some light on how to set the handler? Or even share a python script?
[edit] I mean, once the nuke script has a group and, let say a blur node with its value linked to the added adsk_something parameter … how do you add the float field in the pybox ui that would control the nuke blur?