vcanim.gif (8357 bytes)SAA_modelAddShape
Home ] Sales ] Products ] Services ] Support ] Downloads ]

 

 


SAA_modelAddShape

Adds a new key point to the shape function curve at a specified time.

The new shape is added to the shape list of a model and becomes the active shape.

set scene [SAA_AllocScene]

set model [SAA_AllocElem]

.

.

.

set nbvert [get_number_of_vertices_in_shape]

set verts [ SAA_AllocDVector $nbvert]

.

.

.

set time 1.7 

SAA_modelAddShape  $scene $model $time $nbvert $verts shapeid

time
Time (in seconds) at which to set the key point for the shape.
nbvert
Number of vertices in the shape. To get the number of vertices that should be in a shape, use SAA_modelGetNbVertices.
verts
Vertex coordinates in the local coordinate system.
shapeid
Returns the numeric ID assigned to the new shape.
This number is the (1-based) index of the shape in the shape list. If there are N shapes, then the shape IDs range from 1 to N, and the possible values of key points on the shape function curve range from 0 to (N-1). A key point with a value of 0 corresponds to the shape with an ID of 1.
When you add or remove a shape, the shape IDs of all shapes after that shape are renumbered.

Note

The shapeid is unique, even if the shape has the exact same shape as another shape. If you want to repeatedly transition between several shapes, you may want to work directly with the shape function curve instead of repeatedly calling SAA_modelAddShape.

For example, suppose you want to switch back and forth between two shapes. Instead of calling SAA_modelAddShape over and over, add two shapes. Then get the shape function curve and add a sequence of key points whose values alternate between 0 and 1.

Return Value


Return correct usage if incorrect parameters are passed
"SI_ERR_WRONG_COUNT" if nbVert does not match the actual number of vertices in the model. This return value is a warning. The function ignores any extra vertices and tries to add the shape.

"SI_ERR_BAD_MDLTYPE" if model is not a mesh, patch, face, spline, NURBS curve, or NURBS surface.

"SI_ERR_ERROR_MSG" if a shape key already exists at the specified time.


SAA Index ] Examples SAA calls index ]

copyright Video-Collage Inc.