Function edition is a very important process to master. It is used in many aspects of Smode: animation (cues and timelines), parameters exposition, mesh generation and more.
A function relates an input and an output. Those can be anything (change a position in function of time, change a color in function of the depth in a 3D scene, ect). Functions end up being at the heart of a lot of things in Smode.
One of the most common examples you'll find is a function taking time as an input. A function like that 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 us to make the simple linear mask 'wavy'. By changing the number of repetitions, we can define the number of waves.
Functions like that allow for a very quick result, and can be used in a lot of different scenarios in Smode. Their combinations can be very powerful and productive.
A keyframe function is a collection of points, called keyframes, or keys.
Those points specify a value the function will take a certain input position. That input would be time, in the case of Animation. But it can also be a percentage: imagine exposing a controller for the user, or mapping it to a fader on a hardware device. You would want the input (a given value, between 0% and 100%) to be remapped to something else (interpolate between a green and a red background).
Keyframe functions are very useful, because they allow you to define a number of intermediate points, and therefore to interpolate between a lot of different values between the beginning and the end of the functions. They offer a lot of control.
In the topic, we will assume the input of our function is time, to make things simpler and keep them in the scope of animation. Keyframes are therefore values, relating to a position in time. The ruler in the function editor defines the current input value, or current time.
We can see a grey rectangle linking the two keys together. This is the interpolation.
Interpolation is the process of filling in the unknown data between keys. This means generating new values between the two keyframes. The interpolation is the job of the software. Smode does interpolation between keys thanks to interpolators. Each keyframe has two interpolators, one for the input and one for the output.
The interpolators can be of several types. Those types all generate intermediate values in a different way.
They will change the feel of the animation. Here they are:
|Linear (default)||A straightforward and regular movement towards the next value|
|Smooth||The movement towards the next value appears and disappears progressively|
|Step||No transition is performed at all, the next value is immediately set at the time of the keyframe|
|Bezier||A user defined point (defining a tangent) tells the curve between the keyframes how to look. This solution offers the most control over your interpolations.|
|Ease||The transition is defined by an easing equation (Sine, Quad, Cubic, Quart, Quint, Expo, Circ, Back, Elastic, Bounce).|
Keyframes and their interpolation can be used to animate element and their parameters, for image and color adjustments, to create color gradients, and a lot more.
FUNCTION EDITION, in track view
|A||Type of track||
Can be Keyframe, Separate, Constant, Parametric, OwnedBuffer or Falloff. This property allows you to use another kind of track. This is usually used by advanced users.
|B||Auto-key||When this is enabled, a key will automatically be created at the current time when changing current value (D).|
|C||Keyframe Manipulator||Used to navigate between keyframes, with the left and right buttons. the central buttons informs you if there is a keyframe at the current time. Pressing it will add a key if there is none, or remove it if there is one.||
J / K / L
|D||Current value||Represents the value of the parameter at the current time. Editing that field has no repercussion unless the auto-key mode is active.|
When values do change between keyframes, the space between them is highlighted. In the case of color tracks, you can see the values of the color changing.
You can change the interpolations of a key by selecting it, in its parameters, or by right clicking it. The look of the keyframe is generated by its interpolators.
both in and out on the left ...................... ........ only out to the right
FUNCTION EDITION, in curves view
The curves view allows you to edit your keyframes in 2D instead of a 1D. This brings you a fine tuned control over the animation curves. To activate that mode, first click on the Curves button in the toolbar. The curves you will see in the view will be the rows you select on the right.
You can select more than one row to see more than one curve. Just like in the tracks view, you can ALT click the view to create a new point. If you want to change its interpolation, right clicking a selection of keyframes will display a menu to quickly set them.
You can also control click a point to cycle through its interpolations :
A parametric function is controlled through its parameters only. There is no edition by mouse in this one. The most important parameter is the Shape Type. It is the first parameter you'll see.
Each shape will have its own parameters. The standard easing shapes (first column - Sine, Quad, Cubic, Quart, Quint, Expo, Circ, Back, Elastic, Bounce) all have an Ease in and Ease out parameter. They define if the movement should be smoothed while coming from the first key, while getting to the next key, or both.
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|
That function is constant, meaning it will always return the same value.
It is a utility function, and is rarely used.
Standard parametrization of light disappearing over distance.
Used by lights, projectors, ect. Not useful outside of this context.
COLOR LEVEL FUNCTION
Standard parametrization for color extraction or remapping.
Used by color masks, color modifiers, ect. Not useful outside of this context.