The setup function defnes a region in your expression that is used for setup purposes. This function does not need an argument so the parenthesis will stay empty and are used to indicate setup as a function. Within the following braces Xpressionist does not work like in the rest of the script but switches to a mode that better fits your setup needs. Typically we understand "setup" as a definition of starting conditions of objects. Values only get set for the very first keyframe when you set them up. The setup function will only ececute on the first frame (frame 0) of your project and will only set the first keyframe of the object. All other frames will be left untouched.
A common use of this function would be the setup of created objects:
setup( )
{
create_radiallight( "light_1", "", vec( 0, 0, 0 ) );
light_1.Intensity = 0.8;
light_1.Color = vec( 128, 240, 45 );
};
This will create a light with an intensity of 0.8 and a color of R = 128, G = 240, B = 45
Every statement that follows after the closed braces of a setup function will be executed as defined in the Execute Options in the Preferences tab.
|
|
|