Function
Function - Function that maps a number (percentage, time, etc.) to a value
A function relates an input and an output. Those can be anything (variation in position over time, variation in color relative to the depth of a 3D scene, etc.).
Here is an introduction to each function type you’ll find inside of Smode, go inside the specified topics of the documentation for further informations.
Introduction
One of the most common examples you’ll find is a function taking time as an input. This type of functions is used to animate content, as it takes time as input and specifies the look of the animated object at that time.
But, you can also use functions in masks, like in the following example:
Here, a vertical linear mask (going from point A to B along the Y axis) is used as input to a sinus function.
That sinus function allows to make the simple linear mask ‘wavy’. You can define the number of waves by changing the number of repetitions.
Functions always work the same and are part of a many layers / modifiers / tools of Smode. Each time you see a function inside an element parameters, you can be sure that any function can be plugged in.
For instance in Function Cue :
If you want to change the function type, just click here (on the Function Type selector):
1- Keyframe Function
Once your function is set as keyframe, you’ll notice that you can’t create any point inside the parameters tab (on the contrary of custom functions in which it is possible). To create points, you must then go inside the Function Editor (circled in green), go in curve view:
Some useful keys :
- Ctrl+click : new point
- Alt+click on an existing point : change interpolation
- U : Change view between Curves / Track
- F : Center view on selection
- Middle click : translate view
- Mousewheel : Zoom in editor
- Shift+mousewheel : Zoom horizontally in editor
- Ctrl+mousewheel : Zoom vertically in editor
2- Parametric Function
A parametric function is controlled through its parameters only:
The most important parameter of a function is its Function Shape .
You can display the result of the function through the Function Editor :
Here is the detail of the parameters of:
-
Minimum and maximum of your function, can be expressed in percentage / meters / time depending on where it is.
-
Option to invert the function.
-
Duration of the function can be expressed in percentage / meters / time depending on function output unit.
-
Shifts all the function. Animating a function offset with a linear loop is a very useful trick (particularly to animate spritesheets inside of a Sprite Points ).
- Changes the middle point of the function.
- Repeat / Mirror repeat / Clamp. Must be put as Clamped in the case of Depth mask .
Note that the noise function possesses a Transport and can so be animated.
3- Custom Function
Custom functions are functions in which you can draw. Select this function, draw it and then smooth it:
As opposed to keyframe function, where Smode generates most of the values through interpolation, the custom function has a list of values (the buffer), and the user has to indicate every one of them.
You can use your mouse and click on the function view to change its shape by hand. What one usually does after defining the shape is to plays with the smoothing parameter to even out errors.
-
Begin, End: Defines the begin and end, to resize the buffer (see following illustration)
-
Smoothing: Defines how much the function will be smoothed out to even out errors
Here is a little example using a custom function :
4- Color functions
This is like a linear function but with color values as Inputs. Standard parametrization for color extraction or remapping.
Used by color masks, color modifiers, etc. Not useful outside of this context.
5- Falloff Function
Standard parametrization of light disappearing over distance. A regular fall off with an exponent. Will be expressed in % for the Colorize but in meters in case of the Light .
Used by lights, projectors, etc. Not useful outside of this context.
6- Midi Keyboard Function
Take midi notes range from a Control Device as input to control a curve. As it is one of the parametric functions, it can be found under this category:
Then choose your midi device and channel :
And have fun with it:
Note that this function can be used in many different ways into Smode:
Variables:
- Loading: The loading status of the function. It can be loaded , enabled by not loaded or unloaded
- Activation: The activation status of the function. It can be active , enabled by not active or inactive
- Color Label: Associate a color label to your function to make it easily locatable
- Solo: Activate this to keep only this function active and hide all otherin same location
- Editable: The editabiliy status of the function. It can be locked directly , locked indirectly or editable
- Preset: Select a preset to apply on the function
- Status: Warnings and errors associated to this function