Quick start
To create a new script node, right-click in a nodegraph and search for the Script node.
Then, with the new script node selected, add any input or output pins you want using the propertygrid:

You can use the inputs to compute values that you then assign to the outputs.
Inputs and outputs can have the same name. If unused inside the script, the input will "pass-through" to the output that has the same name.
Note that the input & output names have to follow the usual naming constraints like in shader languages, C or C++: No spaces, no special characters, only letters or digits, and cannot start with a digit.
IMPORTANT: When you modify a script, you will need to apply the changes, using `Ctrl+Enter `When there are changes to apply, an asterisk will appear next to the script in the nodal editor breadcrumb:
|
|
Here are some examples of simple scripts, next to their nodal equivalent:
Manually compute vector length
Returns the length of the input float3 vector.
You can find all the builtin math functions in the Builtin functions page.
|
Equivalent using nodes in a template, three different ways: |
Non-linear random value remapped with a power function
This changes the probability of the random value, so that values closer to zero appear more frequently than values at the high-end of the range:
|
Equivalent using nodes in a template: |
Random value using custom probability curve
Remaps an uniform [0,1] random value to a custom probability distribution represented by a custom curve, using the 'sampleCDF' function of the curve object.
You can see all available member functions on the Samplers page, and for curves specifically on the Curve Sampler page.
Note: If you do not explicitly declare the sampler input as being of type dataCurve, there will be a compile error in the script until you plug an actual curve object in the Curve input pin, because the default auto type will be evaluated as a bool when nothing is plugged in, and bools do not define a sampleCDF function.
|
Equivalent using nodes in a template: |














