CreateShapeGroup

Introduced

v5.0

Categories

animation deformation

Description

Creates a shape group containing the specified ShapeKey properties. A shape group is basically an abstract way to organize the shape keys in a cluster. These can then be viewed in the shape manager. A shape key can be part of only one shape group.

Scripting Syntax

CreateShapeGroup( InputObj, Name );

Parameters

Parameter Type Description
InputObj String Shape keys which are all located under the same cluster and that will be part of the new group.
Name String Name of the shape group.

Examples

JScript Example

/*
        This example illustrates how to create a shape group from scripting.
*/
NewScene( null, false );
CreatePrim("Cone", "MeshSurface", null, null);
ActivateVertexSelTool(null);
ActivateVertexSelTool(null);
SelectGeometryComponents("cone.pnt[1]");
Translate(null, -4.77865299554318, 0, 0, siRelative, siGlobal, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 1);
StoreShapeKey("cone.pnt[1]", "", siShapeLocalReferenceMode, 1, 0, 0, siShapeContentPrimaryShape, false);
SelectFilter("object");
Translate(null, 9.36145955684278, 0, 0, siRelative, siGlobal, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 1);
StoreShapeKey("cone.polymsh.cls.Shape", "", siShapeLocalReferenceMode, 1, 0, 0, siShapeContentPrimaryShape, false);
SelectObj("cone", null, true);
var oShapeCluster = Selection(0).ActivePrimitive.Geometry.Clusters(0);
var oShapeKey0 = oShapeCluster.Properties("ShapeKey");
var oShapeKey1 = oShapeCluster.Properties("ShapeKey1");
// Logs the default shape group
LogMessage(oShapeKey0.ShapeGroupName);
LogMessage(oShapeKey1.ShapeGroupName);
// Creating the shape group of the first shape key
CreateShapeGroup(Array(oShapeKey0), "MyShapeGroup");
// Logs "MyShapeGroup" for the first key and the default for the second.
LogMessage(oShapeKey0.ShapeGroupName);
LogMessage(oShapeKey1.ShapeGroupName);

See Also

SetShapeGroup ShapeKey.ShapeGroupName StoreShapeKey