SwitchMatte
- create whatever nodes you need for a certain effect. I.e. let's build Shake's SwitchMatte real quick:
- select only the node that should be part of the effect and go to Other/Group (or cmd/ctrl + g or ).
The selected nodes will be tugged away into a group node. No worries, you can always open up the group to get to the nodes if you need. - To quickly build an interface for your group node to control the internal nodes, right click anywhere into the Group node's panel and chose 'Manager User Knobs':
This will pop open a dialog that will let you either pick the knobs of the internal nodes or add new ones from scratch (which then can be linked via expressions). - Chose "Pick" and find the Premult's "disable" knob in the node list which represents the Group's internal nodes (i.e. your original selection that you grouped just a second ago along with the Input and Output nodes):
We will make a tiny adjustment to the knob later, so make sure to check "Clone using expression". If you only want an exact clone of the internal knob you don't have to do this.
This will create a checkbox in the Group's panel and put an expression into the internal Premult node to link it to the new one. Now you don't have to go digging for that control when you need it. The new knob is still called "disable", as it just copied the original knob's label. Let's change that to more accurately reflect what it is doing in context of the new tool. - With the disable knob selected in the Group node's knob list hit "Edit" and change the knob's label to "premultiply":
- Now everything is in place, except the new checkbox is doing the opposite of what you would expect. So one more thing to fix before we are ready to export our new tool as a gizmo.
- Confirm the Check Box property panel as well as the knob manager if yuo haven't already done so, and hit the "S" button in the upper right corner of the Group's node panel. This will open in the Group's internals in a new DAG (inside a new tab of the current pane) and you will see all the nodes you had originally selected. This is a fully functional DAG and you can add and remove nodes, rewire them and change parameters just like you can in the main DAG. Note that all the inputs of the internal nodes have been connected to Input nodes, which represent the group node's input pipes. You can rename the Input nodes to change the respective pipes' label in the main DAG. Make sure the Output node is connected to the node who's output you want to use when you connect nodes to the Group node's output.
Bring up the Premult node's panel, switch to it's "Node" tab. Right click on the disable knob and chose "Edit expression...". Put an exclamation mark in front of the existing expression, which will invert the value (1>0 and 0>1): - The premultiply knob will now do what it promises and we are ready to export our new tool. Simply go to the Group node's "Node" tab, and use the "export as gizmo..." button to save the new tool somewhere into your plugin path. The name you chose will be the new node class, so be sure not to use any existing names (like "Blur", or "Transform" etc). You can now find the new tool in the "Other/All plugins" menu after choosing "Other/All plugins/update"
Comments
'parent.parent.parent.pa'
When I checkboxed 'Clone using expression'
As Frank mentioned though, "If you only want an exact clone of the internal knob you don't have to do this" Then I suppose you could just rename it to 'Unpremultiply'
Anyone Buller?
You sure could change the label to be able to keep the 1:1 behaviour of a cloned knob, though "unpremultiply" would be wrong as it was never premultiplied in the first place at that stage (if you want to be anal ).
If you can reproduce this error, can you send a step-by-step to me?
Possibly a bug, doing the same thing for the copy node disable attribute came up with 'parent.parent.parent'
Using Nuke 6.04.
I've tried this with a different group of nodes setup and same deal when I went into the Manage User Knobs and added a knob, then checked the box for 'Clone using expression' and it returned the same expression and error. Could it be a bug?
Step-by-step I literally went down the line per your instruction above.
If no one else has experienced this issue, it must be on my end, and my apologies in advance.
This is a bug (I will report it).
The workaround is to just type it all manually using "parent." or "!parent." where is whatever the knob was called when it was created (the tooltip on it will tell you if in doubt).
this seems fixed in 6.1
RSS feed for comments to this post