Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Controller scripts: animation by expressions  (Read 11066 times)

FWL

  • Newbie
  • *
  • Posts: 32
    • View Profile
Controller scripts: animation by expressions
« 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!
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Controller scripts: animation by expressions
« Reply #1 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.

Logged

FWL

  • Newbie
  • *
  • Posts: 32
    • View Profile
Re: Controller scripts: animation by expressions
« Reply #2 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?
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 2126
    • View Profile
Re: Controller scripts: animation by expressions
« Reply #3 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.
Logged