Eyeon:Script/General Concepts/Animating Values

From VFXPedia

< Eyeon:Script | General Concepts
Revision as of 14:10, 30 April 2007 by Daniel (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Getting Started : Animating Properties

To animate a property via script, the first step is to add a Bezier Spline to an input, which will then become the input's output. A Bezier Spline is an animation curve that can be viewed in the spline editor. It is a storehouse for the information contained in the animated properties of a tool. To do this for a Merge's blend property, the following code could be employed:

Merge1.Blend = BezierSpline({})

If the desire was to then animate the blend from 1 to 0 over the period of 100 frames, one could use the following code:

Merge1.Blend[1] = 1
 
Merge1.Blend[100] = 0

However, when a Bezier Spline is added to a tool's input, it creates a key frame at the comp's current frame. So, if the Bezier Spline in the above case was created when the comp's current time variable was at 22, the tool would come in with a default value for the blend (1, in most cases). To remove key frames from an animated spline, set the value to nil.

Merge1.Blend[composition.CurrentTime] = nil

In the above case, the key frame was removed from the comp's current frame (in the example cited earlier, frame 22). However, if that key frame was the only point on an animation spline, the point would not be deleted, as splines must have at least one point at all times.

If the property is a point value, use the Path{} function to add a bezier-based path.


Tips for Animating Values (edit)

EyeonTips:Script/General Concepts/Animating Values