silhouette-2024.5 : Expressions
Expressions
Silhouette offers both scripting and expressions as tools for customizing and automating the animation process. While scripting requires programming skills, expressions allow artists to create complex animations and link parameters, perform math functions, and use variables without having to write code. This makes expressions a more accessible option for artists who may not have programming skills, while still offering a high degree of control and flexibility. Advanced scripting users should check out the Silhouette Integration and Customization Guide.
Using Expressions
If the parameter supports expressions, an = icon appears to the right of the parameter.
Once enabled, an Expression Editor (code editor) opens.
Single Line Display
In single line mode, press Enter or Tab to set the entered expression.
Note: When an expression is enabled, the Animate (clock) icon to the left of the label is grayed out, the value field is disabled, and the evaluated value is displayed.
Multi-Line Display
If you need more than one line for scripting, click the down icon
and a multi-line display opens.
In multi-line mode, press Esc to set the entered expression.
Linking Parameters
By linking variables and parameters, you can access information in any node and use it in a different node.
Link A Parameter In The Same Node
Drag and drop from one parameter name to another.
or
Type the script id into the Expression Editor and press Enter or Tab. When using a multi-line display, press Esc to enter the expression.
Note: To determine the script id, hover over the parameter name and the script id is displayed in the status bar at the bottom left of the user interface.
Link A Parameter From A Different Node
With a parameter window open for each node, drag and drop a parameter name in one node to another parameter name in the other node.
or
Select Copy Expression Reference from the node source parameter options (... icon), activate Enable Expression on the target node parameter, click in the expression field and paste the result.
or
Enter the node name followed by a period, followed by the script id. For instance, if you want to use the Brightness parameter from the Color Correct 1 node, your expression would be Color_Correct_1.brightness.
Linking A Parameter At A Different Frame
Ordinarily, links to another parameter produce that parameter’s value at the current frame. If the parameter is animated and you want to obtain a value at a specific frame, you can use the following syntax to view a value at a different frame: self.property('saturation').getValue(frame+1). This fetches the value of saturation at the next frame.
Show Which Nodes Are Connected Via Expressions
Click the = icon at the top of the Trees window to show which nodes are connected via expressions.
Display Expression As A Curve
You can visualize the expression as a curve by enabling keyframing for the parameter prior to enabling its expression and then activating the parameter’s Curve icon in the Timeline.
Motion Blur Controller Expression Action
The Create > Motion Blur Controller action creates a Motion Blur node which controls all other node’s motion blur settings using expressions. The controller includes Enable, Angle, Phase, and Samples parameters, with values defaulting to the first motion blur enabled node settings it finds. It then creates expressions for all nodes in the tree that have motion blur parameters.