Function

Function

Function that maps a number (percentage, time, etc.) to a value


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, etc.). Functions end up being at the heart of a lot of things in Smode.
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. 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.
Functions always work the same and are part of a tons of 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 An animation bloc defined by a Function Read More :


If you want to change the function type, just click here (on the Function Type selector):

You have access to 5 types of functions (depending on the element on which you are) : Each of theses functions types will be covered during the next chapters :

Keyframes Functions

This is the stuff you want to put a gradient as you want or create beautiful functions ! 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 The editor allows you to manipulate every Function in Smode Read More (circled in green), go in curve view. And there you go:


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

Parametric Functions

A parametric function is controlled through its parameters only, there is no edition by mouse in this one.

The most important parameter of a function is its Function Shape A shape for an animation or modifier function Read More .
You can display the result of the function through the Function Editor The editor allows you to manipulate every Function in Smode Read More :

Here is the detail of the parameters of functions:
  • Min / Max : Minimum and maximum of your function, can be expressed in percentage / meters / time depending on where it is.
  • Inverse : Option to invert the function.
  • Period : Duration of the function can be expressed in percentage / meters / time depending on function output unit.
  • Offset : 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 Display point using any kind of 2D Layer as map Read More ).
  • Phase : Changes the middle point of the function.
  • Repeat : I let you guess...
  • Wrap mode : Repeat / Mirror repeat / Clamp. Must be put as Clamped in the case of Depth mask Select each pixel depending on a associated depth-value Read More .

Note that the noise function possesses a Transport Thing that can be played out of a Timeline or Function Cue and that doesn't need to be inside an Animation Bank Read More and can so be animated.

Custom Functions




Custom functions are functions in which you can draw ! Yeah babe yeah !
Select this function, draw it and then smooth it. There you go !


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.
Parameters:
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 tutorial using a custom function :

Color Level Function

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.

Falloff Function

Standard parametrization of light disappearing over distance. A regular fall off with an exponent. Will be expressed in % for the Colorize Re-colorize an image by applying a color gradient Read More but in meters in case of the Light Illuminate 3D renderers Read More .


Used by lights, projectors, etc. Not useful outside of this context.

Midi Keyboard Function

Take midi notes range from a Control Device Use any external controllers such as MIDI or OSC, DMX, and ArtNet Read More 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:

Parameters common to all Elements

  • Loading (Activation State) : The loading status of the function. It can be loaded , enabled by not loaded or unloaded
  • Activation (Activation State) : The activation status of the function. It can be active , enabled by not active or inactive
  • Color Label (RGB Color) : Associate a color label to your function to make it easily locatable
  • Solo (On/off option) : Activate this to keep only this function active and hide all other functions in same location
  • Editable (Activation State) : The editabiliy status of the function. It can be locked directly , locked indirectly or editable
  • Preset (Element Preset Selector) : Select a preset to apply on the function
  • Status (Object's errors and warnings) : Warnings and errors associated to this function

CATALOG

Keyframes:

Keyframe - Function key with associated interpolation data

Keyframe Function - Define a function using keyframes

Other:

Function Shape - A shape for an animation or modifier function

Parametric Function - A function that is defined by parameters (sine, square, noise, etc.)

Midi Keyboard Function - Take midi notes range from a Control Device Use any external controllers such as MIDI or OSC, DMX, and ArtNet Read More as input to control a curve

Custom Function - Draw a function

Color Gradient - Specify a one-dimensional color gradient

Noise Function - Define a procedural noise function

See Also: