ShapeKey.ShapeGroupName

導入

v5.0

詳細

シェイプキーオブジェクトが属するシェイプグループの名前を表すStringを戻したり、設定したりします。シェイプグループは、指定のクラスタ内でシェイプキーを意味的に構成する手段です。1 つのシェイプ キーは、1 つのシェイプ グループのみに含むことができます。この構成は、シェイプマネージャビュー内で表示できます。

注:存在しないシェイプグループ名をシェイプキーに割り当てようとすると、新規のシェイプグループが作成されます。

JScript の例

/* ------------------------------------------------------------------------------
        This example demonstrates how to get and set shape group identifiers.
------------------------------------------------------------------------------ */
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);
// Changing the shape group.
oShapeKey0.ShapeGroupName = "MyShapeGroup";
oShapeKey1.ShapeGroupName = "MyShapeGroup";
// Logs "MyShapeGroup" for both keys.
LogMessage(oShapeKey0.ShapeGroupName);
LogMessage(oShapeKey1.ShapeGroupName);

関連項目

CreateShapeGroup SetShapeGroup