Class IParamBlock2

3DS Max Plug-In SDK

Class IParamBlock2

See Also: Class ReferenceTarget, Class ParamBlockDesc2, List of ParamType2 Choices, Structure ParamDef, Class PBValidator, Class PBAccessor, Class PBBitmap, Class ParamBlock2PLCB, Class ClassDesc2, Class Animatable, Structure ParamAlias.

class IParamBlock2 : public ReferenceTarget

Description:

This class is available in release 3.0 and later only.

This class provides an interface for working with parameter block2s. There are methods for getting and setting parameters, descriptor access, parameter map access, etc.

Methods Groups:

The hyperlinks below take you to the start of groups of related methods within the class:

Version / Parameter Number / Local Name / ParamDef / BlockID Access

Descriptor Access

Index-to/from-ID Methods

Super Class ID Access

Parameter Type and Local Name

SetValue() Parameter Accessors

GetValue() Parameter Accessors

Shortcut Get Methods

Table (Tab<>) Management

Table (Tab<>) Insert Methods

Table (Tab<>) Append Methods

Keyframe Checking

Controller Access

Anim Num / Param ID Conversion

Reference Related Methods

Parameter Dimension Related Methods

Parameter Map Access

Rollout Access

MAXScript Default Parameter Initialization

Alias Maintenance

SubAnim Numbering Related Methods

Copying Parameter Values Between Blocks

Finding Parameter IDs

Reset To Default Values

PBAccessor Get / Set Methods

Validity of Parameters

Methods:

public:

Version / Parameter Number / Local Name / ParamDef / BlockID / Owner Access

Prototype:

virtual DWORD GetVersion()=0;

Remarks:

Returns the version of this parameter block.

Prototype:

virtual int NumParams()=0;

Remarks:

Returns the number of parameters in this parameter block.

Prototype:

virtual TCHAR* GetLocalName()=0;

Remarks:

Returns the localized name for the parameter block.

Prototype:

virtual ParamDef& GetParamDef(ParamID id)=0;

Remarks:

Returns a reference to the ParamDef structure for this parameter block.

Parameters:

ParamID id

The parameter ID.

Prototype:

virtual BlockID ID()=0;

Remarks:

Returns the BlockID of the parameter block. Note: typedef short BlockID;

Prototype:

virtual ReferenceMaker* GetOwner()=0;

Remarks:

Returns a pointer to the owner of this parameter block.

Descriptor Access

Prototype:

virtual ParamBlockDesc2* GetDesc()=0;

Remarks:

Aquires the descriptor for this parameter block. Call ReleaseDesc() when done.

Prototype:

virtual void ReleaseDesc()=0;

Remarks:

Releases the descriptor for this parameter block. See GetDesc() above.

Prototype:

virtual void SetDesc(ParamBlockDesc2* desc)=0;

Remarks:

Sets the descriptor associated with the parameter block.

Parameters:

ParamBlockDesc2* desc

Points to the descriptor to set.

Index-to/from-ID Methods

Prototype:

virtual int IDtoIndex(ParamID id)=0;

Remarks:

Returns the zero based index of the parameter into the parameter definitions array of the given parameter ID or -1 if not found.

Parameters:

ParamID id

The parameter ID whose index to return.

Prototype:

virtual ParamID IndextoID()=0;

Remarks:

Returns the parameter ID of the parameter given its index into the parameter definitions array.

Parameters:

int i

The index of the parameter whose ID is to be returned.

Super Class ID Access

Prototype:

virtual SClass_ID GetAnimParamControlType(int anim)=0;

Remarks:

Returns the Super Class ID of the parameter's controller (specified by sub-anim number).

Parameters:

int anim

The sub-anim index of the parameter.

Prototype:

virtual SClass_ID GetParamControlType(ParamID id)=0;

Remarks:

Returns the Super Class ID of the parameter's controller (specified by paramter ID).

Parameters:

ParamID id

The ID of the parameter.

Parameter Type and Local Name

Prototype:

virtual ParamType2 GetParameterType(ParamID id)=0;

Remarks:

Returns the type of the specified parameter.

Parameters:

ParamID id

The ID of the parameter.

Prototype:

virtual TSTR GetLocalName(ParamID id, int tabIndex = -1)=0;

Remarks:

Returns the local name for the specified parameter or Tab<> parameter entry.

Parameters:

ParamID id

The permanent ID of the parameter.

int tabIndex = -1

If the parameter is a table this is the zero based index into the table of the parameter.

SetValue() Parameter Accessors

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, float v, int tabIndex=0);

Remarks:

Sets the floating point value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

float v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, int v, int tabIndex=0);

Remarks:

Sets the integer value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

int v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, Point3& v, int tabIndex=0);

Remarks:

Sets the Point3 value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

Point3& v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, Color& v, int tabIndex=0);

Remarks:

Sets the Color value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

Color& v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, TCHAR* v, int tabIndex=0);

Remarks:

Sets the string value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

TCHAR* v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, Mtl*v, int tabIndex=0);

Remarks:

Sets the Mtl* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

Mtl*v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, Texmap* v, int tabIndex=0);

Remarks:

Sets the Texmap* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

Texmap* v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, PBBitmap* v, int tabIndex=0);

Remarks:

Sets the PBBitmap* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

PBBitmap* v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, INode* v, int tabIndex=0);

Remarks:

Sets the INode* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

INode* v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, ReferenceTarget*v, int tabIndex=0);

Remarks:

Sets the ReferenceTarget* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

ReferenceTarget*v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL SetValue(ParamID id, TimeValue t, Matrix3& v, int tabIndex=0);

Remarks:

This method is available in release 4.0 and later only.

Sets the Matrix3 value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to set the value.

Matrix3& v

The value to set.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to set.

Return Value:

TRUE on success; otherwise FALSE.

GetValue() Parameter Accessors

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, float& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the floating point value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

float& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, int& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the integer value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

int& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, Point3& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the Point3 value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

Point3& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, Color& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the Color value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

Color& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, TCHAR*& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the string value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

TCHAR*& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, Mtl*& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the Mtl* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

Mtl*& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, Texmap*& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the Texmap* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

Texmap*& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, PBBitmap*& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the PBBitmap* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

PBBitmap*& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, INode*& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the INode* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

INode*& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, ReferenceTarget*& v, Interval &ivalid, int tabIndex=0);

Remarks:

Retrieves the ReferenceTarget* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

ReferenceTarget*& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Prototype:

virtual BOOL GetValue(ParamID id, TimeValue t, Matrix3& v, Interval &ivalid, int tabIndex=0);

Remarks:

This method is available in release 4.0 and later only.

Retrieves the Matrix3 value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time at which to get the value.

Matrix3& v

The value to retrieve is returned here.

Interval &ivalid

This is the validity interval which is updated by the validity of the retrieved parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Return Value:

TRUE on success; otherwise FALSE.

Shortcut Get Methods

Prototype:

virtual Color GetColor(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the Color value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual Point3 GetPoint3(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Retrieves the value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual int GetInt(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the integer value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual float GetFloat(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the floating point value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual TimeValue GetTimeValue(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the TimeValue value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual Mtl* GetMtl(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the Mtl* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual TCHAR* GetStr(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the string value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual Texmap* GetTexmap(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the Texmap* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual PBBitmap* GetBitmap(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the PBBitmap* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual INode* GetINode(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the INode* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual ReferenceTarget* GetReferenceTarget(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

Returns the ReferenceTarget* value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual PB2Value& GetPB2Value(ParamID id, int tabIndex=0)=0;

Remarks:

This methods is used for getting a parameter value as a PB2Value reference.

Parameters:

ParamID id

The permanent ID of the parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Prototype:

virtual Matrix3 GetMatrix3(ParamID id, TimeValue t=0, int tabIndex=0)=0;

Remarks:

This method is available in release 4.0 and later only.

Retrieves the value of the specified parameter at the specified time.

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t=0

The time at which to get the value.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the value to get.

Table (Tab<>) Management

Prototype:

virtual int Count(ParamID id)=0;

Remarks:

Returns the number of entries being used in the table.

Parameters:

ParamID id

The permanent ID of the parameter.

Prototype:

virtual void ZeroCount(ParamID id)=0;

Remarks:

Set the number of elements in the table that are actually used to zero.

Parameters:

ParamID id

The permanent ID of the parameter.

Prototype:

virtual void SetCount(ParamID id, int n)=0;

Remarks:

Set the number of elements in the table that are actually used to n.

Parameters:

ParamID id

The permanent ID of the parameter.

int n

The number of elements to set.

Prototype:

virtual int Delete(ParamID id, int start,int num)=0;

Remarks:

List-type delete of num elements starting with start

Parameters:

ParamID id

The permanent ID of the parameter.

int start

The start position for element deletion.

int num

The number of elements to delete.

Return Value:

Returns the number of items left in the table.

Prototype:

virtual int Resize(ParamID id, int num)=0;

Remarks:

Changes the number of allocated items to num.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The new size of the table.

Return Value:

Nonzero if the array was resized; otherwise 0.

Prototype:

virtual void Shrink(ParamID id)=0;

Remarks:

Reallocate so there is no wasted space.

Parameters:

ParamID id

The permanent ID of the parameter.

Prototype:

virtual void Sort(ParamID id, CompareFnc cmp)=0;

Remarks:

Sorts the array using the compare function.

Parameters:

ParamID id

The permanent ID of the parameter.

CompareFnc cmp

Type of function to pass to Sort(). Note: Sort() just uses the C library qsort function. The developer must implement the CompareFnc function.

typedef int( __cdecl *CompareFnc) (const void *elem1, const void *elem2);

The return value of CompareFnc is show below in the relationship of elem1 to elem2:

< 0

if elem1 less than elem2

0

if elem1 identical to elem2

> 0

if elem1 greater than elem2

Sample Code:

static int CompTable( const void *elem1, const void *elem2 ) {

 TCHAR *a = (TCHAR *)elem1;

 TCHAR *b = (TCHAR *)elem2;

 return(_tcscmp(a,b));

}

Table (Tab<>) Insert Methods

Prototype:

virtual int Insert(ParamID id, int at, int num, float* el)=0;

Remarks:

Insert num float elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

float* el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, Point3** el)=0;

Remarks:

Insert num Point3* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

Point3** el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, Color** el)=0;

Remarks:

Insert num Color* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

Color** el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, TimeValue* el)=0;

Remarks:

Insert num TimeValue elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

TimeValue* el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, TCHAR** vel)=0;

Remarks:

Insert num string (TCHAR*) elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

TCHAR** vel

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, Mtl** el)=0;

Remarks:

Insert num Mtl* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

Mtl** el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, Texmap** el)=0;

Remarks:

Insert num Texmap* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Texmap** el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, PBBitmap** el)=0;

Remarks:

Insert num PBBitmap* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

PBBitmap** el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, INode** v)=0;

Remarks:

Insert num INode* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

INode** v

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, ReferenceTarget** el)=0;

Remarks:

Insert num ReferenceTarget* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

ReferenceTarget** el

Array of elements to insert.

Return Value:

Returns at.

Prototype:

virtual int Insert(ParamID id, int at, int num, Matrix3** el)=0;

Remarks:

This method is available in release 4.0 and later only.

Insert num Matrix3* elements at position at.

Parameters:

ParamID id

The permanent ID of the parameter.

int at

Zero based array index where to insert the elements.

int num

Number of elements to insert.

Matrix3** el

Array of elements to insert.

Return Value:

Returns at.

Table (Tab<>) Append Methods

Prototype:

virtual int Append(ParamID id, int num, float* el, int allocExtra=0)=0;

Remarks:

Append num float elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

float* el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, Point3** el, int allocExtra=0)=0;

Remarks:

Append num Point3* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

Point3** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, Color** el, int allocExtra=0)=0;

Remarks:

Append num Color* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

Color** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, TimeValue* el, int allocExtra=0)=0;

Remarks:

Append num TimeValue elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

TimeValue* el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, TCHAR** el, int allocExtra=0)=0;

Remarks:

Append num string (TCHAR*) elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

TCHAR** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, Mtl** el, int allocExtra=0)=0;

Remarks:

Append num Mtl* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

Mtl** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, Texmap** el, int allocExtra=0)=0;

Remarks:

Append num Texmap* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

Texmap** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, PBBitmap** el, int allocExtra=0)=0;

Remarks:

Append num PBBitmap* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

PBBitmap** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, INode** el, int allocExtra=0)=0;

Remarks:

Append num INode* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

INode** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, ReferenceTarget** el, int allocExtra=0)=0;

Remarks:

Append num ReferenceTarget* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

ReferenceTarget** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Prototype:

virtual int Append(ParamID id, int num, Matrix3** el, int allocExtra=0)=0;

Remarks:

This method is available in release 4.0 and later only.

Append num Matrix3* elements at the end of the array.

Parameters:

ParamID id

The permanent ID of the parameter.

int num

The number of elements to append to the end of the array.

Matrix3** el

The elements to append.

int allocExtra=0

If you need to enlarge the array specify an non-zero value and this many extra slots will be allocated.

Return Value:

Returns the number of elements in use prior to appending.

Keyframe Checking

Prototype:

virtual BOOL KeyFrameAtTime(int i, TimeValue t, int tabIndex=0);

Remarks:

Checks to see if a keyframe exists for the given parameter at the given time

Parameters:

int i

Zero based index of the parameter to check.

TimeValue t

The time to check.

int tabIndex=0

If the parameter is a table this is the zero based index of the element in the table to check.

Return Value:

TRUE if a keyframe exists at the specified time; otherwise FALSE.

Prototype:

virtual BOOL KeyFrameAtTime(ParamID id, TimeValue t, int tabIndex=0);

Remarks:

Checks to see if a keyframe exists for the given parameter at the given time

Parameters:

ParamID id

The permanent ID of the parameter.

TimeValue t

The time to check.

int tabIndex=0

If the parameter is a table this is the zero based index of the element in the table to check.

Return Value:

TRUE if a keyframe exists at the specified time; otherwise FALSE.

Controller Access

Prototype:

virtual void RemoveController(int i, int tabIndex)=0;

Remarks:

Removes the 'i-th' controller.

Parameters:

int i

Specifies which controller using the zero based index of the parameter in the block.

int tabIndex

If the parameter is a table this is the zero based index of the element in the table whose controller is removed.

Prototype:

virtual Control* GetController(ParamID id, int tabIndex=0)=0;

Remarks:

Returns a pointer to the controller of the specified parameter.

Parameters:

ParamID id

The permanent ID of the parameter.

int tabIndex=0

If the parameter is a table this is the zero based index of the element in the table whose controller is returned.

Prototype:

virtual Control* GetController(int i, int tabIndex)=0;

Remarks:

Returns a pointer to the controller of the specified parameter.

Parameters:

int i

Specifies which controller using the zero based index of the parameter in the block.

int tabIndex

If the parameter is a table this is the zero based index of the element in the table whose controller is returned.

Prototype:

virtual void SetController(int i, int tabIndex, Control *c, BOOL preserveFrame0Value=TRUE)=0;

Remarks:

Sets the 'i-th' parameter controller to the one specified.

Parameters:

int i

Specifies which controller using the zero based index of the parameter in the block.

int tabIndex

If the parameter is a table this is the zero based index of the element in the table.

Control *c

The controller to set.

BOOL preserveFrame0Value=TRUE

If TRUE the controllers value at frame 0 is preserved.

Prototype:

virtual void SwapControllers(int i1, int tabIndex1, int i2, int tabIndex2)=0;

Remarks:

Swaps the two controllers of the parameters whose indices are passed.

Parameters:

int i1

The zero based index of one of the parameters in the parameter block.

int tabIndex1

If the parameter is a table this is the zero based index of the element in the table.

int i2

The zero based index of one of the other parameters in the parameter block.

int tabIndex2

If the parameter is a table this is the zero based index of the element in the table.

Reference Related Methods

Prototype:

virtual int GetRefNum(int i, int tabIndex=0)=0;

Remarks:

Given a parameter index this method will return the reference number of that parameter.

Parameters:

int i

The zero based index of the parameter in the parameter block.

int tabIndex=0

If the parameter is a table this is the zero based index of the element in the table.

Prototype:

virtual int GetControllerRefNum(int i, int tabIndex=0)=0;

Remarks:

Returns the reference number of the specified parameter's controller or -1 if not found.

Parameters:

int i

The zero based index into the parameter definitions array of the parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index in the table of the parameter.

Prototype:

virtual ParamID LastNotifyParamID(int& tabIndex)=0;

Remarks:

This method is available in release 4.0 and later only.

Like LastNotifyParamID(), but takes an int& tabIndex argument so that it can return both the ID of the changing parameter (as the result) and the changing element index for Tab<> parameters.

If the ParamID returns -1 because no parameter is currently changing, tabIndex is not updated. If the change to a Tab<> parameter is not to a single element (such as a sort), the tabIndex is set to -1. For multiple inserts, appends, deletes, the tabIndex returned is the index of the first element inserted, appended, deleted.

Parameters:

int& tabIndex

The index of the changing element for Tab<> parameters is returned here.

Prototype:

virtual void RefDeleted(ParamID id, int tabIndex=0)=0;

Remarks:

This method should be called when the parameter block owner has deleted the reference to a reference target parameter. This sets the value to NULL and invalidates the UI associated with the pblock. Note that this must only be called on P_OWNERS_REF parameters.

Parameters:

ParamID id

The ID of the reference target parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index into the table of the parameter.

Prototype:

virtual void EnableNotifications(BOOL onOff)=0;

Remarks:

This method is available in release 4.0 and later only.

Controls whether NotifyDependents() messages are sent when a parameter is changed, such as through

a SetValue() call. For example:

pblock->EnableNotifications(FALSE);

... param change code ...

pblock->EnableNotifications(TRUE);

Notifications are enabled by default. Note that this is a GLOBAL enable/disable, ALL paramblocks will be prevented from sending notifications while EnableNotifications(FALSE) is in effect.

Parameters:

BOOL onOff

TRUE to enable notifications, FALSE to disable them.

Anim Num / Param ID Conversion

Prototype:

virtual int GetAnimNum(ParamID id, int tabIndex=0)=0;

Remarks:

Returns the sub-anim number of the parameter whose ID is passed or -1 if not found.

Parameters:

ParamID id

The parameter ID of the parameter.

int tabIndex=0

If the parameter is a Tab<> this is the zero based index in the table of the parameter.

Prototype:

virtual int AnimNumToParamNum(int animNum, int& tabIndex)=0;

Remarks:

Returns the index into the parameter definitions array of the parameter whose sub-anim index is specified or -1 if not found.

Parameters:

int animNum

The zero based sub-anim index of the parameter.

int& tabIndex

If the parameter is a Tab<> this is the zero based index into the table of the parameter.

Parameter Dimension Related Methods

Prototype:

virtual ParamDimension* GetParamDimension(int subAnim)=0;

Remarks:

Returns the dimension of the parameter whose sub-anim index is passed or defaultDim if not found.

Parameters:

int subAnim

The zero based sub-anim index of the parameter.

Prototype:

virtual void RescaleParam(int paramNum, int tabIndex, float f)=0;

Remarks:

This is only for use in a RescaleWorldUnits() implementation: The parameter block implementation of RescaleWorldUnits scales only tracks that have dimension type = stdWorldDim. If letting the parameter block handle the rescaling is not sufficient, call this on just the parameters you need to rescale.

Parameters:

int paramNum

The index into the parmeter block of the parameter to rescale.

int tabIndex

If the parameter is a Tab<> this is the zero based index into the table of the parameter.

float f

The value to scale by.

Parameter Map Access

Prototype:

virtual void SetMap(IParamMap2* m, MapID map_id = 0)=0;

Remarks:

This method sets the parameter map2 associated with this parameter block2.

Parameters:

IParamMap2* m

Points to the parameter map.

MapID map_id

This parameter is available in release 4.0 and later only.

Specifies the ID of the map to set.

Prototype:

virtual IParamMap2* GetMap(MapID map_id = 0)=0;

Remarks:

Returns a pointer to the parameter map2 associated with this parameter block.

Parameters:

MapID map_id

This parameter is available in release 4.0 and later only.

Specifies the ID of the map to get.

Rollout Access

Prototype:

virtual void SetRolloutOpen(BOOL open, MapID map_id = 0)=0;

Remarks:

Sets the rollout state to open or closed.

Note: Normally, developers don't need to call this method (or the related ones below) explicitly; they are used internally to keep track of rollouts states. Instead, use the ClassDesc2 method RestoreRolloutState() at the end of a BeginEditParams() or CreateParamDlg() to reset the rollouts to the state last used for the current object.

Parameters:

BOOL open

TRUE for open; FALSE for closed.

MapID map_id

This parameter is available in release 4.0 and later only.

Specifies the ID of the map/rollout to set open/closed state for.

Prototype:

virtual BOOL GetRolloutOpen(MapID map_id = 0)=0;

Remarks:

Returns TRUE if the rollout is open; FALSE if closed. This is normally used internally -- see the note above in SetRolloutOpen().

Parameters:

MapID map_id

This parameter is available in release 4.0 and later only.

Specifies the ID of the map/rollout to get open/closed state for.

Prototype:

virtual void SetRolloutScrollPos(int pos, MapID map_id = 0)=0;

Remarks:

Sets the rollout scroll position. This is normally used internally -- see the note above in SetRolloutOpen().

Parameters:

int pos

The position to set.

MapID map_id

This parameter is available in release 4.0 and later only.

Specifies the ID of the map/rollout to set scroll position for.

Prototype:

virtual int GetRolloutScrollPos(MapID map_id = 0)=0;

Remarks:

Returns the rollout scroll position. This is normally used internally -- see the note above in SetRolloutOpen().

Parameters:

MapID map_id

This parameter is available in release 4.0 and later only.

Specifies the ID of the map/rollout to get scroll position for.

ParamDlg Access

Prototype:

virtual IAutoMParamDlg* GetMParamDlg()=0;

Remarks:

Returns a pointer to the automatic parameter dialog object for a plug-in material or texmap (which has its interface in the materias editor). See Class IAutoMParamDlg.

Prototype:

virtual IAutoEParamDlg* GetEParamDlg()=0;

Remarks:

Returns a pointer to the automatic parameter dialog object for the rendering effects plug-in. See Class IAutoEParamDlg.

MAXScript Default Parameter Initialization

Prototype:

virtual void InitMSParameters()=0;

Remarks:

This method initializes the parameters with MAXScript defaults.

The ParamBlockDesc2 descriptor lets you specify default values for parameters (using the tag p_default), and these get installed when you first create an object and its paramblocks. Sometimes, the default value needed for interactive creation is not the one you want when creating an object via the scripter. For example, a sphere should start out with radius 0 when you create it interactively, but you want a non-zero default if you create it in the scripter, say with sphere(), otherwise it would be invisible. There is another tag, p_ms_default, that lets you set a separate default for scripter-based creation (the p_ms_default for sphere radius is 25). This method is used internally by the scripter to set the p_ms_default values in after a script-based creation. It is not normally used by plug-in developers.

Alias Maintenance

Prototype:

virtual void DefineParamAlias(TCHAR* alias_name, ParamID id, int tabIndex=-1)=0;

Remarks:

This is used to allow parameter 'aliases' to be set up for MAXScript use. Individual Tab<> parameter elements can have aliases. This is used to set up dynamically-varying parameters, such as the texture maps in the new Standard material, which sets up aliases for elements in the texture map arrays.

Parameters:

TCHAR* alias_name

The name of the alias.

ParamID id

The permanent ID of the parameter.

int tabIndex=-1

If the parameter is a Tab<> this is the zero based index of the parameter in the table.

Prototype:

virtual ParamAlias* FindParamAlias(TCHAR* alias_name)=0;

Remarks:

Returns a pointer to a Structure ParamAlias object which describes the paramater alias whose name is passed. This includes the name, ParamID and Tab<> index.

Parameters:

TCHAR* alias_name

The name of the alias to find.

Prototype:

virtual TCHAR* FindParamAlias(ParamID id, int tabIndex=-1)=0;

Remarks:

Finds the name of a parmameter alias using the ID and Tab<> index passed.

Parameters:

ParamID id

The permanent ID of the parameter.

int tabIndex=-1

If the parameter is a Tab<> this is the zero based index into the table. If not a Tab<> use the default of -1.

Return Value:

The name of the alias or NULL if not found.

Prototype:

virtual void ClearParamAliases()=0;

Remarks:

Breaks the association between the aliases and their parameters in this block. The method ParamAliasCount() below will return 0 following this call.

Prototype:

virtual int ParamAliasCount()=0;

Remarks:

Returns the number of aliases currently defined.

Prototype:

virtual ParamAlias* GetParamAlias(int i)=0;

Remarks:

Returns a pointer to the 'i-th' alias. See Structure ParamAlias.

Parameters:

int i

The zero based index of the alias to return.

SubAnim Numbering Related Methods

Prototype:

virtual void SetSubAnimNum(ParamID id, int subAnimNum, int tabIndex=0)=0;

Remarks:

This method allows for the arbitrary ordering of sub-anim numbers for parameters and Tab<> parameter elements. It sets the sub-anim number for the specified parameter.

This call lets you set arbitrary sub-anim number ordering for the subAnim parameters and Tab<> parameter elements in the block. You must set numbers for ALL subAnims and take care that all numbers are used. Note that in the case of the various ReferenceTarget* parameter types, NULL values for any parameter or Tab<> elements are not included the subAnim count, so if such a parameter is made non-NULL (or vice-versa), you need to reassign the subanim numbers to take that change into account.

Parameters:

ParamID id

The permanent parameter ID

int subAnimNum

The zero based sub-anim number.

int tabIndex=0

The zero based index into the table of the parameter.

Prototype:

virtual void ClearSubAnimMap()=0;

Remarks:

This method clears any sub-anim map used to allow arbitrary ordering of sub-anim numbers for parameters.

Copying Parameter Values Between Blocks

Prototype:

virtual void Assign(ParamID id, IParamBlock2* src, ParamID src_id)=0;

Remarks:

This method is used for copying parameter values between parameter blocks (which is useful during old-version updating). This method copies from the 'src' block 'src_id' parameter into this parameter block's 'id' parameter. Developers are responsible for making sure the types are the same, otherwise an assert() may occur.

Parameters:

ParamID id

This ID specifies the destination parameter.

IParamBlock2* src

Points to the source parameter block 2.

ParamID src_id

The source parameter ID.

Finding Parameter IDs

Prototype:

virtual ParamID FindRefParam(ReferenceTarget* ref, int& tabIndex)=0;

Remarks:

This method that takes a reference target object ref stored somewhere in this parameter block and returns the ParamID and tabIndex of the containing parameter, or -1 if not found in the parameter block.

Parameters:

ReferenceTarget* ref

The reference target to find.

int& tabIndex

The table index if the parameter is a Tab<>.

Reset To Default Values

Prototype:

virtual void ResetAll(BOOL updateUI = TRUE, BOOL callSetHandlers = TRUE)=0;

Remarks:

This method resets all the parameters in the block to their default values and optionally updates any associated ParamMap2 UI that is currently displaying the contents of the block. It also optionally causing all the PBAccessor Set() methods to be called after the reset.

Parameters:

BOOL updateUI = TRUE

TRUE to update the user inteface; FALSE to not update.

BOOL callSetHandlers = TRUE

TRUE to call PBAccessor::Set() for all the parameters; otherwise FALSE.

Prototype:

virtual void Reset(ParamID id, int tabIndex=-1, BOOL updateUI = TRUE, BOOL callSetHandlers = TRUE)=0;

Remarks:

This method resets the single parameter specified to its default value. If the parameter is a Tab<> and the tabIndex is -1, all the elements in the table are reset.

Parameters:

ParamID id

The ID of the parameter to reset.

int tabIndex=-1

If the parameter is a Tab<> this is the index into the table of the parameter to reset. A value of -1 causes all the elements in the table to be reset.

BOOL updateUI = TRUE

Determines if the user inteface is updated for the parameter. TRUE to update; FALSE to not update.

BOOL callSetHandlers = TRUE

Determines if the method PBAccessor::Set() should be called on the parameter. TRUE to call it; FALSE to not call it.

PBAccessor Get / Set Methods

Prototype:

virtual void CallSet(ParamID id, int tabIndex=-1)=0;

Remarks:

This method forces a call to the PBAccessor::Set() method for the specified parameter. If the parameter is a Tab<> parameter and the tabIndex is -1, all the elements have the appropriate functions called.

Parameters:

ParamID id

The ID of the parameter.

int tabIndex=-1

If the parameter is a Tab<> parameter this is the zero based index into the table of the element. A value of -1 causes all the appropriate Set() methods to be called.

Prototype:

virtual void CallGet(ParamID id, int tabIndex=-1)=0;

Remarks:

This method forces a call to the PBAccessor::Get() method for the specified parameter. If the parameter is a Tab<> parameter and the tabIndex is -1, all the elements have the appropriate functions called.

Parameters:

ParamID id

The ID of the parameter.

int tabIndex=-1

If the parameter is a Tab<> parameter this is the zero based index into the table of the element. A value of -1 causes all the appropriate Get() methods to be called.

Prototype:

virtual void CallSets()=0;

Remarks:

This method forces a call to the PBAccessor::Set() method for every parameter in the block. Any parameters which are Tab<> parameters will have Set() call for every appropriate element.

Prototype:

virtual void CallGets()=0;

Remarks:

This method forces a call to the PBAccessor::Get() method for every parameter in the block. Any parameters which are Tab<> parameters will have Get() call for every appropriate element.

Validity of Parameters

Prototype:

virtual void GetValidity(TimeValue t, Interval &valid)=0;

Remarks:

This method updates the validity interval passed with the cumulative interval for every parameter in the parameter block.

Parameters:

TimeValue t

The time about which the interval is computed.

Interval &valid

The interval to update.