I like the way the boolean node expands to allow more than two inputs.
You often need more than one variable, so I have extended node_variable and node_variable2d to behave the same way.
I call the new nodes node_variables and node_variables2d. Imaginative, eh?
The attached zip file contains the .py files to go into the plugins folder
Also .png files that go in the icons folder. These, by the way, show the $ prefix that all variables declared in this way need.
I note that global parameters declared with node_parameter have global scope, and the control variables ('i' to 'n') of node_for are passed as parameters to their input objects (and their parents...) so do not need to be 'special variables' with a $ name prefix.
But the way to pass parameter values to modules and functions in other circumstances is to use 'special variables', identified by having names starting with '$'. This is why the existing node_variable and my node_variables force variable names to start with $.
Incidentally, node_variable creates local variables, not globals as it claims.
Variable names declared in a node_variable (or variables or 2d) can be reused elsewhere in the model. The scope of each is only the objects, operations and transformations that form the input to that variable node.
- Attachments
- variables node.zip
- ChrisLTs proposed nodes that declare multiple variables in one node
- You don't have permission to download attachments.
- (14 Kb) Downloaded 4 times