Class IParamArray

3DS Max Plug-In SDK

Class IParamArray

See Also: Class IParamBlock, Class IParamMap.

class IParamArray

Description:

This class represents a virtual array of parameters. Parameter are accessed using an integer index and GetValue() and SetValue() methods. Parameter blocks are one such implementation of this class, but it can also be useful to implement a class that abstracts non-parameter block variables. The ParamMap class uses this base class so that a ParamMap can be used to control UI for not only parameter blocks but also variables stored outside of parameter blocks. The Advanced Topics section on Parameter Maps discusses how this is done.

Methods:

Default implementation of these methods are provided which simply return FALSE.

Prototype:

virtual BOOL SetValue(int i, TimeValue t, float v);

Remarks:

Implemented by the Plug-In.

This method is called when the system needs to store a value into a variable. There are overloaded functions for each type of value to set (int, float, and Point3). Each method has three parameters. Below is the float version - the others are similar.

Parameters:

int i

This is the index into the virtual array of the value to set.

TimeValue t

This is the time at which to set the value.

float v

This is the value to set.

Return Value:

This is not currently used.

Prototype:

virtual BOOL SetValue(int i, TimeValue t, int v)

Remarks:

Implemented by the Plug-In.

This is the integer version of above.

Prototype:

virtual BOOL SetValue(int i, TimeValue t, Point3& v)

Remarks:

Implemented by the Plug-In.

This is the Point3 version of above.

Prototype:

virtual BOOL GetValue(int i, TimeValue t, float &v, Interval &ivalid)

Remarks:

Implemented by the Plug-In.

Whenever the developer needs to retrieve a value from the parameter block, the GetValue() method is used. There are overloaded functions for each type of value to retrieve (int, float, Point3, and Color). Each method has four parameters:

Parameters:

int i

This is the index into the virtual array of the value to retrieve.

TimeValue t

This is the time at which to retrieve the value. For constants pass 0.

float &v

This is the value to retrieve.

Interval &ivalid

This is the validity interval to update to reflect the validity of this parameter.

Return Value:

If the value was retrieved TRUE is returned; otherwise FALSE is returned.

Prototype:

virtual BOOL GetValue(int i, TimeValue t, int &v, Interval &ivalid)

Remarks:

This is the integer version of above.

Prototype:

virtual BOOL GetValue(int i, TimeValue t, Point3 &v, Interval &ivalid)

Remarks:

This is the Point3 version of above.

Prototype:

IParamBlock *GetParamBlock()

Remarks:

Implemented by the System.

If the array uses a parameter block, this method will return a pointer to it, otherwise it will return NULL. Note that casting won't work because of multiple inheritance.

Return Value:

Returns a pointer to the parameter block if one is used; NULL otherwise.

Prototype:

virtual BOOL KeyFrameAtTime(int i, TimeValue t);

Remarks:

This method is available in release 2.0 and later only.

Checks to see if a keyframe exists for the given parameter at the given time. Returns TRUE if a keyframe exists at the specified time; otherwise FALSE.

Parameters:

int i

Zero based index of the parameter to check.

TimeValue t

The time to check.

Default Implementation:

{return FALSE;}