Gizmos

SwitchMatte

Written by Frank Rueter on .

  • create whatever nodes you need for a certain effect. I.e. let's build Shake's SwitchMatte real quick:
    basicOutline_1 
  • select only the node that should be part of the effect and go to Other/Group (or cmd/ctrl + g or ).
    basicOutline_2
    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':
    basicOutline_3 
    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):
    basciOutline_4
    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":
    basicOutline_5
  • 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):
    basicOutline_6

  • 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   

 
+1 # David Schnee 2010-07-29 13:24
I tried this out using 6.0v7 and returned the following ERROR for the Premult's 'disable' expression
'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?
 
 
+1 # Frank Rueter 2010-07-29 19:40
when exactly did you get this error? "pa" is pixel aspect and has nothing to do with what is outlined in this recipe, so I'm a bit confused as to how this error popped up.
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?
 
 
0 # Will Earl 2010-07-30 10:28
I got the same 'parent.parent. parent.pa' when I opened up the disable expression on the premult node. Changing it to '!parent.Premul t1_disable' worked through.

Possibly a bug, doing the same thing for the copy node disable attribute came up with 'parent.parent.parent'

Using Nuke 6.04.
 
 
-1 # David Schnee 2010-07-30 10:30
This occurred right after I checked the 'Clone using expression' option box. If I then go and look at the actual expression created, it's 'parent.parent. parent.pa' instead of what it should be in this case 'parent.Premult 1_disable' If I manually type that in, it still returns an ERROR

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.
 
 
0 # Frank Rueter 2010-08-01 21:46
I just had a go again myself ad got "parent.parent. 1_disable" as the automatic expression.
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).
 
 
0 # Frank Rueter 2010-08-01 21:59
slight correction:
this seems fixed in 6.1
 
 
0 # AE Master 2017-09-02 05:05
Very Good for key
 

You have no rights to post comments

We have 2669 guests and 54 members online