SaveDeformKey

Categories

animation deformation

Description

Saves a key on a pose-based deformation. Given a cluster of points, the shape of which is linked to a set of parameters with the LinkDeform command, this command associates the current positions of the points in the cluster to the current parameter values it is linked to.

Pose-based deformation (which is based on multi-linked parameters) allows you to link the shape of a cluster to several parameters simultaneously. The resulting shapes are smoothly interpolated in the space defined by the parameters. Pose-based deformations are particularily useful to link the shape of muscles to bone orientations or other parameters.

Scripting Syntax

oReturn = SaveDeformKey( [InputObj], ClusterShapeKey );

Return Value

Returns the key.

Parameters

Parameter Type Description
InputObj String Points, clusters, or an object.

Default Value: Current selection

ClusterShapeKey String Cluster shape key to use for setting the deform

Examples

VBScript Example

' This example illustrates how to control the shape of an object (a sphere) based 
' on two parameters: its position in x and in z.
NewScene
' Here we create the geometry that will be deformed
CreatePrim "Sphere", "MeshSurface"
' We create the specific cluster that will be deformed
SelectGeometryComponents "sphere.pnt[4-6,11-13,18-20,25-27,32-34,39-41,46-48,53-55]"
CreateCluster
' We link the deformation of the new cluster to the position of the sphere in x and z
LinkDeform "sphere.polymsh.cls.Point", "sphere.kine.global.posz,sphere.kine.global.posx"
' Finally we model and save deform keys defining the relationship between the different
' sphere positions and the shape
Translate "Sphere", -10, 0, 0, siAbsolute, siParent, siObj, siX
ActivateVertexSelTool
Scale "sphere.polymsh.cls.Point", 0.267441860465116, 1, 1, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
Translate "Sphere", 10, 0, 0, siAbsolute, siParent, siObj, siX
Scale "sphere.polymsh.cls.Point", 0.313953488372093, 1, 1, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
Translate "Sphere", 0, 0, 10, siAbsolute, siParent, siObj, siZ
Scale "sphere.polymsh.cls.Point", 1, 1, 0.302325581395349, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
Translate "Sphere", 0, 0, -10, siAbsolute, siParent, siObj, siZ
Scale "sphere.polymsh.cls.Point", 1, 1, 0.27906976744186, siRelative, siLocal, siObj, siXYZ
SaveDeformKey "sphere.polymsh.cls.Point"
' To see the result translate the sphere in the XZ plane. The multi-link interpolator 
' calculates a smooth blending between the deform keys over the space defined by the 
' two parameters.

See Also

LinkDeform ApplyDeformKey