SelectShapeKey
 
 
 

SelectShapeKey

Description

Selects a list of objects as shape keys for another object. Selecting shape keys can optionally set up a relation between the target object or cluster and the shape keys, allowing to you fine-tune the shape keys and have those adjustments appear on the target object or cluster. Selecting shape keys creates shape sources but you also have the option of automatically creating a shape clip in the mixer similarly to SaveShapeKey.

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

oReturn = SelectShapeKey( InputObj, SourceObj, [RefMode], [Relational], [ApplyKeys] );

Return Value

Returns the shape key(s) as an XSICollection of ShapeKey objects.

Parameters

Parameter Type Description
InputObj String List of objects to be deformed.
SourceObj String List of objects that define the shape keys.
RefMode siShapeReferenceMode The reference mode of the shape key created

Default Value: siShapeLocalReferenceMode

Relational Boolean Keep a modelling relation between the created shape and the selected geometry.

Default Value: True

ApplyKeys Boolean Apply the shapes on the mixer given the shape instancing mode.

Default Value: False

Examples

VBScript Example

'This example creates 3 spheres: 1 basic sphere and 2 deformed ones.
'The two deformed spheres have a different shape.
'
'The basic sphere will then use the two deformed spheres as shape
'sources, in order to morph between the two shapes.
'Create 3 sphere, give a different shape to 2 of them.
NewScene
CreatePrim "Sphere", "MeshSurface"
SetValue "sphere.sphere.radius", 1
Duplicate "sphere", , 2, 1, 1, 0, 0, 1, 0, 1
Translate , -3, 0, -3, siRelative, siView, siObj, siXYZ
SetSelFilter "Point"
AddToSelection "sphere1.pnt[0-8,30-36]", , True
AddToSelection "sphere1.pnt[0,1,16-22,44-50]", , True
Scale , 1.9, 1.9, 1.9, siRelative, siGlobal, siObj, siXYZ
Duplicate "sphere", , 2, 1, 1, 0, 0, 1, 0, 1
Translate , 3, 0, -3, siRelative, siView, siObj, siXYZ
SetSelFilter "Point"
AddToSelection "sphere2.pnt[*]", , True
RemoveFromSelection "sphere2.pnt[0-8,30-36]"
RemoveFromSelection "sphere2.pnt[0,1,16-22,44-50]"
Scale , 2.4, 2.4, 2.4, siRelative, siGlobal, siObj, siXYZ
'Call SelectShapeKey to create 2 shapes based on the 2 deformed spheres
SelectShapeKey "sphere", "sphere1,sphere2",_
siShapeLocalReferenceMode, True, False
'Apply the 2 shape keys
ApplyShapeKey "sphere.polymsh.cls.sphere1_ShapeKey.sphere1_ShapeKey,"_
& "sphere.polymsh.cls.sphere1_ShapeKey.sphere2_ShapeKey", , , 1
ApplyShapeKey "sphere.polymsh.cls.sphere1_ShapeKey.sphere2_ShapeKey", , , 2
'Change the weights in order to see the blend between 
'the 2 shapes on the target sphere
SetValue "Mixer.Mixer_Shape_Track.sphere1_ShapeKey_ClusterClip."_
& "Mixer_Shape_Track2.sphere2_ShapeKey_Clip.actionclip.weight", 1
'Changing the sliders' values of sphere.ShapeWeights will blend 
'from one source shape to the other:
InspectObj "sphere.ShapeWeights"

See Also

SaveShapeKey ApplyShapeKey SelectShapeKey StoreShapeKey