## ReplaceShapeKey

### Description

Replaces a shape key with the current shape of an object. When you do this, any existing clips that use the source are also updated, and new clips from this source will be based upon its new 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.
Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference so you need to use the best workaround for your situation:
For scripting languages this command returns an ISIVTCollection which you can use to get the output arguments.
For C# you can use the XSIApplication.ExecuteCommand method to call this command. ExecuteCommand packs the output arguments into a C# System.Object containing an Array of the output arguments (see Calling Commands from C#).

### Scripting Syntax

    ReplaceShapeKey( InputObj, [OutputObj], [ForceDeformStripping] );

### Parameters

Parameter | Type | Description
--- | --- | ---
InputObj | String | The shape key to be replaced.
OutputObj | ShapeKey | Returns the shape key
ForceDeformStripping | Boolean | Forces the removal of any deformations above the shape combiner. Default Value: false

### Examples

#### VBScript Example

    '

    '	This example creates a shape key, and then replaces it with another

    '	key that creates another shape (overwrites the original one)

    '

    NewScene , false

    set oTarget = CreatePrim( "Sphere", "MeshSurface" )

    SaveShapeKey oTarget , , , 1, , , , , siShapeLocalReferenceMode

    ' Replace the saved key with one 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

    SelectObj "sphere.polymsh.cls.Shape.ShapeKey"

    ReplaceShapeKey , rtn

    'INFO : sphere.polymsh.cls.Shape.ShapeKey

    logmessage rtn.FullName

### See Also

SaveShapeKey ApplyShapeKey SelectShapeKey StoreShapeKey