ApplyShapeKey

Description

Applies the specified shape key to an object at the current frame and creates a ShapeClip in the animation mixer. You can apply ShapeKeys that you have stored or selected, as well as those that you have saved if you want to return to a previous shape.

With shape animation (sometimes called morphing), you can change the shape of an object over time, animating the geometrical shape of an object using clusters of points (clusters made of polygons or edges are not supported). You can use surface (NURBS) or polygon objects to create shape animation, or even curves and lattices--any geometry that has a static number of points.

In Softimage, all shape animation is done on clusters. This means that you can create different clusters on an object and create shape keys for each of them; or you can treat a complete object as one cluster and save shape keys for it. For more information on clusters in general, see the Softimage user guide.

Scripting Syntax

ApplyShapeKey( [InputObj], [Compound], [Track], [Time], [Duration], [Mode], [Name], [Overwrite] )

Parameters

Parameter

Type

Description

InputObj

String

The source to create the clip from. Typically, a "source" is an shape action or a cluster key

Default Value: Current source

Compound

String

The compound container (track owner) to add this clip to.

Default Value: Current compound container

Track

String

Track to add this clip to.

Default Value: Current track

Time [in/out]

Double

Frame at which to add the clip.

Default Value: Key frame

Duration

Double

Length of the clip in frames.

Default Value: Time stored in source

Mode

Integer

Shape key mode.

Default Value: 4 (Use Default)

Possible Values:

0: Instance Only

1: Weight Mix

2: Standard Transition

3: Cardinal Transition

4: Use Default

5: Blend Weight

Name

String

Name of the new clip.

Overwrite

Integer

Behaviour when a shape clip already exists at the key time.

Default Value: Prompt user (in batch mode the default is replace).0 (Prompt User)

Possible Values:

0: Prompt User

1: Replace

2: Add

3: Skip

Return Value

Returns a Clip.

Examples

VBScript Example

'
' This example stores two shape keys without activating them.
' Then, it applies the second stored shape to the object.
'

' Create a sphere, store a first key with no deforms
NewScene , false
CreatePrim "Sphere", "MeshSurface"
StoreShapeKey "sphere", , siShapeLocalReferenceMode

' Store a second key with some deforms (move points)
SetSelFilter "Point"
SelectGeometryComponents "sphere.pnt[27,28,34,35,41,42]"
Translate , 4.8, 4.3, -0.4, siRelative, siView, siObj, siXYZ
StoreShapeKey "sphere", , siShapeLocalReferenceMode
ActivateObjectSelTool

' Delete the move point op (info is already in the key)
DeleteObj "sphere.polymsh.movecomponentop"

' Apply the stored shape key
ApplyShapeKey "sphere.polymsh.cls.Shape.ShapeKey1", , , 1

See Also

SaveShapeKey

ApplyShapeKey

SelectShapeKey

StoreShapeKey



Autodesk Softimage v7.5