#include <xsi_staticsource.h>
The StaticSource object represents a constant value stored as an AnimationSourceItem. When instantiated, the parameter value takes on the value of the StaticSource. A static pose is a kind of a StaticSource.
This object can be one of the AnimationSourceItem objects in an ActionSource.
using namespace XSI;
Application app;
Model root = app.GetActiveSceneRoot();
X3DObject myCube;
root.AddGeometry( L"Cube", L"MeshSurface", L"", myCube );
// Create 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 );
ActionSource mySource(outArg);
CRefArray aSourceItems = mySource.GetItems();
for ( LONG i=0; i<aSourceItems.GetCount(); ++i ) {
AnimationSourceItem currItem(aSourceItems[i]);
app.LogMessage( L" The animated target is " + currItem.GetTarget() );
app.LogMessage( L" The type of animation is " + currItem.GetType() );
// In this case it's a static value you can switch on type.
StaticSource myVal = currItem.GetSource();
app.LogMessage( L" The value is " + myVal.GetValue().GetAsText() );
}
Public Member Functions |
|
| StaticSource () | |
| ~StaticSource () | |
| StaticSource (const CRef &in_ref) | |
| StaticSource (const StaticSource &in_obj) | |
| bool | IsA (siClassID in_ClassID) const |
| siClassID | GetClassID () const |
| StaticSource & | operator= (const StaticSource &in_obj) |
| StaticSource & | operator= (const CRef &in_ref) |
| CValue | GetValue () const |
| CStatus | PutValue (const CValue &in_val) |
| StaticSource | ( | ) |
Default constructor.
| ~StaticSource | ( | ) |
Default destructor.
| StaticSource | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| StaticSource | ( | const StaticSource & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| 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 SIObject.
| siClassID GetClassID | ( | ) | const [virtual] |
| StaticSource& operator= | ( | const StaticSource & | in_obj | ) |
Creates an object from another object. The newly created object is set to empty if the input object is not compatible.
| in_obj | constant class object. |
| StaticSource& operator= | ( | const CRef & | in_ref | ) |
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 SIObject.
| CValue GetValue | ( | ) | const |
Returns a value which is used as a constant value for the corresponding AnimationSourceItem.
Sets a value which is used as a constant value for the corresponding AnimationSourceItem.
| in_val | New value for this animation SourceItem. |