Anim8or Community

General Category => ASL Scripts => Topic started by: FWL on April 28, 2020, 11:19:27 am

Title: Controller scripts: animation by expressions
Post by: FWL on April 28, 2020, 11:19:27 am
Hello everyone,

I'm trying to learn/understand the 'animation by expressions' way of animating as described in the anim8or manual, but i don't fully understand how this works.

I copied the example script $color=(0.8,0.1,0.1)*(fract(time)<0.2); and the script in the ASL spec on the anim8or site: $scale = 1 + sin(time*PI*4)*0.5;

Both scripts work but I have trouble understanding how. If i understand the ASL spec right variables that start with a $ are user declared variables? If so how does anim8or know that the user declared variables has to be linked to light color resp. size of an object? Or are $color and $scale pre-defined variables within anim8or? And how could one translate this to for example the diffuse color of an object. For example if you want to make a character blush and make his face red during a scene?

Thanks in advance!
Title: Re: Controller scripts: animation by expressions
Post by: Steve on May 01, 2020, 02:52:28 pm
User variables begin with a $, but also specific variables for animated properties. $color, $scale, etc. are predefined variables in the corresponding script type. When the script exits the value is used for that particular component. When you first create a script it is composed of a single asigment to the variable so you don't have to remember the name. For example, the default color controller script is:

$color = (0.0, 0.0, 0.0);

which is the color black.

Title: Re: Controller scripts: animation by expressions
Post by: FWL on May 02, 2020, 04:42:33 am
Ok, so if I understand correctly some parameters are accessible for animation through these predefined variables. Is there a list of these predefined variables? And the $color variable is specific for the light source isn't it? Or can this also be used for the diffuse color of an object?
Title: Re: Controller scripts: animation by expressions
Post by: Steve on May 02, 2020, 02:09:58 pm
When you select "expression" for a controller, that adds a script for that specific property. Currently there are no scripts that control values of a material.