/*
This example transfers shape animation across generator operators.
*/
NewScene( null, false );
SetValue("Context.constructionmode", 1, null);
CreatePrim("Sphere", "MeshSurface", null, null);
CreatePrim("Cone", "MeshSurface", null, null);
//Create some shape animation
ActivateVertexSelTool(null);
SelectGeometryComponents("cone.pnt[1]");
Translate(null, 2.4284957846203, 0, 0, siRelative, siGlobal, siObj, siXYZ, null, null, siXYZ, null, null, null, null, null, null, 1);
SaveShapeKey("cone.pnt[1]", null, null, 1, null, null, null, null, siShapeObjectReferenceMode);
SetValue("PlayControl.Key", 48, null);
SetValue("PlayControl.Current", 48, null);
ActivateVertexSelTool(null);
Translate(null, -6.11040874839948, 0, 0, siRelative, siGlobal, siObj, siXYZ, null, null, siXYZ, null, null, null, null, null, null, 1);
SaveShapeKey("cone.pnt[1]", null, null, 48, null, null, null, null, siShapeObjectReferenceMode);
ActivateObjectSelTool(null);
SelectObj("sphere,polymsh", null, true);
SelectFilter("object");
AddToSelection("cone", null, true);
ApplyGenOp("MeshMerge", null, "sphere,cone", siUnspecified, siPersistentOperation, siKeepGenOpInputs, null);
SelectObj("polymsh.polymsh.mergemesh", null, null);
//Transfer the cluster properties on the generated geometry
TransferClusterPropertiesAcrossGenOp("polymsh.polymsh.mergemesh", "polymsh", "cone.polymsh.cls.Shape.ResultClusterKey", "ResultClusterKey", true);
TransferClusterPropertiesAcrossGenOp("polymsh.polymsh.mergemesh", "polymsh", "cone.polymsh.cls.Shape.ShapeKey", "ShapeKey", true);
TransferClusterPropertiesAcrossGenOp("polymsh.polymsh.mergemesh", "polymsh", "cone.polymsh.cls.Shape.ShapeKey1", "ShapeKey1", true);
//Transfer the mixer part of the animation across the generated geometry
TransferShapeAnimationAcrossGenOp("polymsh.polymsh.mergemesh", "cone");
SetValue("cone.polymsh.clustershapecombiner.Mute", true, null); |