The utility nodes collection
(plugin)
The use of this plugin is
to have access to different (mostly mathematical) functions that were only
available as MEL commands. With that plugin you can create nodes that will take
an input, specify an operator from a list, and get from the output the result
of the desired operation.
What the point you may ask?
Well if you want to use a MEL command in your hypergraph or shading network, it
usually means using an expression. In many cases using nodes and connections is
considered faster, so these nodes give the basic tools to “rebuild” expressions
as nodes networks.
Two node types are
registered by the plugin utilityNodes.mll :
The doubleOneOperator
node, that takes one input, one operation, and provides one
output.
The available operations for doubleOneOperator are :
·
None Does nothing :)
·
Negate output = - input
·
Reverse output = 1.0 – input
·
Absolute output = abs(input) (as the MEL
command)
·
Sign output = sign(input)
Etc. Rest of the 20
operators avaible should be self explanatory, they’re all mathematical
functions already available in MEL
The doubleTwoOperator
node, that takes two input, one operation, and provides one
output.
The available operations for doubleOneOperator are :
·
None Does nothing :)
·
Add output = input1 + input2
·
Sub output
= input1 - input2
·
Mult output
= input1 * input2
Etc. Should not be hard to
guess the rest :)
How to create and use
these nodes :
Type in the script editor :
“createNode doubleOneOperator” or “createNode doubleTwoOperator”
It’s very extremely simple
plugins and the sources are provided with them in “utilityNodesSources”. If you
don’t plan to edit them, all you need is utilityNodes.mll and the two
AETemplaes scripts.
Things to do :
I guess I should make a doubleMultOperator,
taking an array of inputs for the functions that need more than 2, also a
vector (color) version vectorOneOperator and vectorTwoOperator would be handy.
Olivier Renouard
olivier AT drone DOT org