Scripting Vertex and Control Point Animation

You can add animation to vertices in editable meshes, spline shapes and FFD modifiers using the animateVertex() method. Its syntax is:

animateVertex

Animates one or more vertex, knot, or control point, where is one of

#all

#selected -- not applicable for FFD modifiers

For FFD modifiers, the animateAll() method will animate all the control points, and is equivalent to animateVertex #all. Its syntax is:

animateAll

Animates all control points.

The animateVertex() and animateAll() methods effectively assign controllers to editable meshes, spline shapes and FFD modifiers which make them appear as animatables in the Track View, allowing further scripting of these vertex animation controllers.

Examples:

animateVertex $line01 2

animateVertex $box01 #(2,3,4,5)

animateAll $box01.ffd_3x3x3

These animateVertex() method only work on editable meshes, spline shapes and FFD modifiers and will report an error if applied to other types of objects. You can use the functions convertToMesh() and convertToSplineShape() to convert existing geometry into the needed forms. Note that Line objects are SplineShapes already and don't need conversion.

The vertices to be animated are specified by index number, with the keyword #all to animate all vertices or control points, or #selected to animate the currently selected vertices. The #selected keyword is not applicable to FFD modifiers. In the case of SplineShapes, the vertex index numbers are interpreted in a special way to accommodate tangent handles and multiple curves, as follows:

See also Class and Object Inspector Functions for details on accessing the vertices, tangents, or control points.

For information about scripting FFD control placement within FFD lattice space, see also the getModContextBBoxMin() and getModContextBBoxMin() functions, as described in Modifier Common Properties, Operators, and Methods.

For editable meshes and spline shapes, the controller values assigned to the vertices, knots, and tangent handles is in object space. See Using Node Transform Properties for information on converting between world space to object space.