/*
This example demonstrates how to copy animation from one property
set to one or more others by using the CopyAnimContainer command
*/
// Create a null and 3 spheres
NewScene( null, false );
GetPrim( "Null" );
CreatePrim( "Sphere", "MeshSurface" );
CreatePrim( "Sphere", "MeshSurface" );
CreatePrim( "Sphere", "MeshSurface" );
// Set some animation on the null
SetValue("PlayControl.Key", 1, null);
SetValue("PlayControl.Current", 1, null);
Translate("null", -6.97865149659886, 0.234776770384885, -2.34776770384885E-02,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
SaveKey("null.kine.local.posx,null.kine.local.posy,null.kine.local.posz", 1, null, null, null);
SetValue("PlayControl.Key", 33, null);
SetValue("PlayControl.Current", 33, null);
Translate("null", 6.45996793941922, -3.8503390343121, 0.38503390343121,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
SaveKey("null.kine.local.posx,null.kine.local.posy,null.kine.local.posz", 33, null, null, null);
SetValue("PlayControl.Key", 59, null);
SetValue("PlayControl.Current", 59, null);
Translate("null", 4.99822336918567, 0.657374957077674, -6.57374957077675E-02,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
SaveKey("null.kine.local.posx,null.kine.local.posy,null.kine.local.posz", 59, null, null, null);
SetValue("PlayControl.Key", 75, null);
SetValue("PlayControl.Current", 75, null);
Translate("null", 3.01779524177248, 2.25385699569489, -0.225385699569489,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
SaveKey("null.kine.local.posx,null.kine.local.posy,null.kine.local.posz", 75, null, null, null);
SetValue("PlayControl.Key", 97, null);
SetValue("PlayControl.Current", 97, null);
Translate("null", 0.188612202610777, 7.8884994849321, -0.78884994849321,
siRelative, siView, siObj, siXYZ, null, null, null, null, null, null, null, null, null, 0, null);
SaveKey("null.kine.local.posx,null.kine.local.posy,null.kine.local.posz", 97, null, null, null);
// Copy the animation over to all the spheres
CopyAnimContainer( "null.kine.local.pos", "sphere*.kine.local.pos" ); |