Related Scripting Object: ParameterCollection
An array of Parameters. More...
#include <xsi_parameter.h>
Inheritance diagram for CParameterRefArray:

Public Member Functions |
|
| CParameterRefArray () | |
| CParameterRefArray (const CParameterRefArray &) | |
| ~CParameterRefArray () | |
| CParameterRefArray & | operator= (const CParameterRefArray &in_refArray) |
| CRef | GetItem (const CString &in_scriptname) const |
| void | Add (const CRef &in_item) |
| void | RemoveItem (const CString &in_scriptname) |
| CRefArray | PlotAnimation (double in_startFrame=DBL_MAX, double in_stopFrame=DBL_MAX, double in_stepFrame=1, siFCurveType in_fcurveTypeToPlot=siStandardFCurve, siFCurveInterpolation in_interpolation=siCubicInterpolation, bool in_bFitValues=false, double in_fitTolerance=0.01, bool in_bProcessRotation=false, bool in_bDisplayProgressBar=true) |
| CValue | GetValue (const CString &in_scriptname, double in_time=DBL_MAX) const |
| CValue | GetValue (LONG in_index, double in_time=DBL_MAX) const |
| CStatus | PutValue (const CString &in_scriptname, const CValue &in_val, double in_time=DBL_MAX) |
| CStatus | PutValue (LONG in_index, const CValue &in_val, double in_time=DBL_MAX) |
using namespace XSI; Application app; Model root = app.GetActiveSceneRoot(); X3DObject myCube; root.AddGeometry( L"Cube", L"MeshSurface", CString(L"MyCube"), myCube ); CParameterRefArray params = myCube.GetParameters(); Parameter posx(params.GetItem( L"posx" )); Parameter posy(params.GetItem( L"posy" )); Parameter posz(params.GetItem( L"posz" )); posx.PutValue(5.5); posy.PutValue(8.0); app.LogMessage( L"Cube's pos parameter: " + CValue(posx.GetValue()).GetAsText() + L"," + CValue(posy.GetValue()).GetAsText() + L"," + CValue(posz.GetValue()).GetAsText() );
Default constructor.
| CParameterRefArray | ( | const CParameterRefArray & | ) |
Copy constructor. Performs a shallow copy, so any change to one instance will appear in any of the copies.
| ~CParameterRefArray | ( | ) |
Default destructor.
| CParameterRefArray& operator= | ( | const CParameterRefArray & | in_refArray | ) |
Assign a CParameterRefArray object to this one.
| in_refArray | A constant CParameterRefArray object. |
Returns a CRef object contained in the list given an object scripting name. If the requested parameter does not exist in the array then an invalid CRef is returned.
| in_scriptname | The scripting name of a parameter to retrieve. |
Reimplemented from CRefArray.
| void Add | ( | const CRef & | in_item | ) | [virtual] |
Adds a CRef object at the end of this array. The CRef must be Valid and refer to a Parameter, otherwise it is ignored. This operation does not actually add a parameter to any associated XSI object.
| in_item | CRef object. |
Reimplemented from CRefArray.
| void RemoveItem | ( | const CString & | in_scriptname | ) |
Removes a parameter from the CParameterRefArray. This does not actually remove the parameter from any associated XSI object. No action is performed if the requested parameter is not found in the CParameterRefArray.
| in_scriptname | scriptname of parameter. |
| CRefArray PlotAnimation | ( | double | in_startFrame = DBL_MAX, |
|
| double | in_stopFrame = DBL_MAX, |
|||
| double | in_stepFrame = 1, |
|||
| siFCurveType | in_fcurveTypeToPlot = siStandardFCurve, |
|||
| siFCurveInterpolation | in_interpolation = siCubicInterpolation, |
|||
| bool | in_bFitValues = false, |
|||
| double | in_fitTolerance = 0.01, |
|||
| bool | in_bProcessRotation = false, |
|||
| bool | in_bDisplayProgressBar = true |
|||
| ) |
Creates and returns an array of FCurve objects by plotting the parameters values from consecutive frames of an animation. The resulting FCurve objects are transients and not connected to any XSI components. All resulting FCurve objects are parented to the Application object.
| in_startFrame | First frame to plot. Use DBL_MAX to specify the first frame in the timeline. Defaults to DBL_MAX. | |
| in_stopFrame | Last frame to plot. Use DBL_MAX to specify the last frame in the timeline. Defaults to DBL_MAX. | |
| in_stepFrame | Step between frames. Defaults to 1. | |
| in_fcurveTypeToPlot | Type of fcurve required for plotting. Defaults to siStandardFCurve. | |
| in_interpolation | Type of interpolation required for the resulting fcurves. This argument is only relevant if in_fcurveTypeToPlot is siStandardFCurve. Defauts to siCubicInterpolation. | |
| in_bFitValues | Fits the fcurves through the plotted values. Defaults to false. | |
| in_fitTolerance | Tolerance value used for fitting the fcurves through the plotted values. Defaults to 0.01. | |
| in_bProcessRotation | Processes the rotation curves to ensure their continuity. Defaults to false. For processing continuous rotations the rotation channels must be listed consecutively. e.g. cube.local.rotx, cube.local.roty, cube.local.rotz otherwise the rotation for that object will not be processed. | |
| in_bDisplayProgressBar | Display a progress bar control to indicates the progress of the plot operation. Defaults to true. |
Returns the value of a parameter identified with a scripting name. The value returned is empty if the input name is invalid.
| in_scriptname | The parameter scripting name (see Parameter::GetScriptName). | |
| in_time | Time in frame defaults to the current frame if in_time is set with DBL_MAX. |
| CValue GetValue | ( | LONG | in_index, | |
| double | in_time = DBL_MAX |
|||
| ) | const |
Returns the value of a parameter at a specific position in the array. The value returned is empty if the index is out of bounds.
| in_index | The position of the parameter in the array. | |
| in_time | Time in frames. Defaults to the current frame if in_time is set with DBL_MAX. |
Sets a parameter value by scripting name. If you try to set a read-only parameter, an error (CStatus::Unexpected) occurs. You can check if a parameter is read-only by checking the condition:
Parameter::GetCapabilities && siReadOnly == siReadOnly
| in_scriptname | The parameter scripting name. | |
| in_val | The parameter value to set. | |
| in_time | Time in frame defaults to the current frame if in_time is set with DBL_MAX. |
CStatus::Fail other failure
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot be converted to the parameter type.
Sets the value of the parameter at a given position in the array. If you try to set a read-only parameter, an error (CStatus::Unexpected) occurs. You can check if a parameter is read-only by checking the condition:
Parameter::GetCapabilities && siReadOnly == siReadOnly
| in_index | The position of the parameter in the array. | |
| in_val | The parameter value to set. | |
| in_time | Time in frame defaults to the current frame if in_time is set with DBL_MAX. |
CStatus::Fail other failure
CStatus::Unexpected Trying to set a read-only parameter.
CStatus::BadVarType Invalid input value type. Usually happens if in_val cannot get converted to the parameter type.