#include <xsi_expression.h>
An expression string is a mathematical formula that controls any animatable parameter. It may include object and parameter names, mathematical operators, and tokens representing functions or constants.
The Expression object has an expression string (stored in the definition parameter) and can be created with the AddExpr command. If a parameter value is driven by an expression you can get this expression using Parameter::GetSource.
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); Null myNull; root.AddNull( L"myNull", myNull ); Parameter posx = myNull.GetParameter(L"posx"); CValueArray args(2); CValue outArg; args[0] = posx.GetFullName(); args[1] = posx.GetFullName() + L" + 4.0"; app.ExecuteCommand(L"AddExpr", args, outArg); Expression myPosxExpr = posx.GetSource(); Parameter myDefinition = myPosxExpr.GetParameter(L"definition"); app.LogMessage(L"The expression definition is " + myDefinition.GetValue().GetAsText());
Public Member Functions |
|
Expression () | |
~Expression () | |
Expression (const CRef &in_ref) | |
Expression (const Expression &in_obj) | |
bool | IsA (siClassID in_ClassID) const |
siClassID | GetClassID () const |
Expression & | operator= (const Expression &in_obj) |
Expression & | operator= (const CRef &in_ref) |
Expression | ( | ) |
Default constructor.
~Expression | ( | ) |
Default destructor.
Expression | ( | const CRef & | in_ref | ) |
Constructor.
in_ref | constant reference object. |
Expression | ( | const Expression & | 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 Operator.
siClassID GetClassID | ( | ) | const [virtual] |
Expression& operator= | ( | const Expression & | 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. |
Expression& 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 Operator.