This represents the Animation Mixer, which is nested directly under the Model. The Mixer object is a ClipContainer and so provides access to the standard elements of a mixer: its Track objects, Transition objects, Clip objects, and ClipRelation objects.
You can check if an object has a mixer by calling Model::HasMixer. If it doesn't, you can create one with Model::AddMixer.
The Mixer stores all of the Model's high-level animation and audio clips, so when you call the ClipContainer::GetClips function on the Mixer, you get the clips from only the current model (there is no recursion). If any of these are compound clips, none of its contents are returned, just the top level.
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube ); // Creating the first animation source CValueArray args(9); CValue outArg; args[0] = root; args[1] = L"cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz"; args[3] = L"StoredStaticPose"; args[4] = true; args[7] = false; args[8] = false; app.ExecuteCommand( L"StoreAction", args, outArg ); Source mySource(outArg); // Creating the first clip CValueArray addClipArgs(6); addClipArgs[0] = root; addClipArgs[1] = mySource.GetFullName(); addClipArgs[5] = L"MyClip1"; app.ExecuteCommand( L"AddClip", addClipArgs, outArg ); Clip myClip(outArg); app.LogMessage(L"First created clip " + myClip.GetFullName() ); myCube.PutParameterValue(L"posx", 3.0f); // Creating the second animation source args[1] = L"cube.kine.local.posx,cube.kine.local.posy,cube.kine.local.posz"; args[5] = 7l; args[6] = 9l; app.ExecuteCommand( L"StoreAction", args, outArg ); mySource = outArg; // Creating the second clip from the second source. addClipArgs[0] = root; addClipArgs[1] = mySource.GetFullName(); addClipArgs[5] = L"MyClip1"; app.ExecuteCommand( L"AddClip", addClipArgs, outArg ); Clip myClip2(outArg); app.LogMessage(L"Second created clip " + myClip2.GetFullName() ); ClipContainer myMixer = root.GetMixer().GetRef(); CRefArray myClips = myMixer.GetClips(); app.LogMessage(L"List of clips retrieved from the container"); LONG i; for(i = 0; i< myClips.GetCount(); ++i) { app.LogMessage(L"Clip " + CValue(i).GetAsText() + Clip(myClips[i]).GetFullName()); } // Creating a compound clip from the clips created earlier args.Resize(2); args[0] = root; args[1] = myClip.GetFullName() + L"," + myClip2.GetFullName(); app.ExecuteCommand( L"CreateCompound", args, outArg ); ClipContainer myCompound(outArg); app.LogMessage(L"Compound clip " + myCompound.GetFullName() ); myClips = myCompound.GetClips(); app.LogMessage(L"List of clips retreived from the compound"); for(i = 0; i< myClips.GetCount(); ++i) { app.LogMessage(L"Clip " + CValue(i).GetAsText() + Clip(myClips[i]).GetFullName()); } // Now retrieving once again the clips from under the mixer. // This should only return the CompoundClip. myClips = myMixer.GetClips(); app.LogMessage(L"List of clips retreived from the mixer after the creation of the compound"); for(i = 0; i< myClips.GetCount(); ++i) { app.LogMessage(L"Clip " + CValue(i).GetAsText() + Clip(myClips[i]).GetFullName()); }
#include <xsi_mixer.h>
Public Member Functions | |
Mixer () | |
~Mixer () | |
Mixer (const CRef &in_ref) | |
Mixer (const Mixer &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Mixer & | operator= (const Mixer &in_obj) |
Mixer & | operator= (const CRef &in_ref) |
Mixer | ( | ) |
Default constructor.
~Mixer | ( | ) |
Default destructor.
bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
in_ClassID | class type. |
Reimplemented from ClipContainer.
siClassID GetClassID | ( | ) | const [virtual] |
Returns the type of the API class.
Reimplemented from ClipContainer.
Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.
in_ref | constant class object. |
Reimplemented from ClipContainer.