Structure ParamDef

3DS Max Plug-In SDK

Structure ParamDef

See Also: Class ParamBlockDesc2, Structure PB2Value, Class PBValidator, Class PBBitmap, List of ParamType2 Choices, Class ParamDimension, Template Class Tab.

struct ParamDef

Description:

This structure is available in release 3.0 and later only.

The data members of this class provide a definition of a parameter. An array of these parameter definitions is a data member of class ParamBlockDesc2.

struct ParamDef

{

ParamID ID;

This is the permanent, position independent ID of the parameter.

TCHAR* int_name;

This is a fixed internal name of the parameter. This name is not localized. Internal names are meant to be parsable as identifiers. As such they should begin with an alpha character, have only alphanumerics, and have no spaces, punctuations, etc. The convention for multi-word names is to use studly-caps, eg, paintRadius.

ParamType2 type;

This is the type of the parameter. See List of ParamType2 Choices.

int flags;

They are the per-parameter constructor flags (P_ANIMATABLE, P_TRANSIENT, etc.) Normally, the flags are set up as a result of things you specify in the ParamBlockDesc2 constructor and should generally be read-only at runtime.

int local_name;

This is the string table resource ID for the localized (sub-anim) name.

ParamDimension* dim;

This is the parameter dimension. See Class ParamDimension.

PB2Value def;

The default value for the parameter.

PB2Value ms_def;

This is the default value for MAXScript and the MacroRecorder.

PB2Value cur_def;

This is the current 'sticky' default value, used to maintain creation defaults within a session.

int description;

This is a one sentence description. Use a string resource ID.

PB2Value range_low;

This indicates the low allowable range used in MAXScript validation and spinner setup.

PB2Value range_high;

This indicates the high allowable range used in MAXScript validation and spinner setup.

PBValidator* validator;

Points to an instance of the validator object. This object has a Validate() method used to check if the parameter is valid.

PBAccessor* accessor;

Points to an instance of an accessor object. Any parameter in a block can have an accessor callback object that has its Get() or Set() method called whenever the parameter is accessed. This may be used to provide access to dynamically-computed virtual parameters and sometimes to allow parameter-specific processing by the class as the parameter in the block is modified.

short tab_size;

If the parameter is a table (Tab<>) this is the initial table size.

short ref_no;

This is a block-owner's reference number for non-hosted ReferenceTargets parameters.

short subtex_no;

This is a block-owner's SubTex index for Texmap parameters in Mtl owners.

Class_ID class_ID;

This is the Class_ID validator for reference targets.

SClass_ID sclass_ID;

This is the SClass_ID validator for reference targets (similar to above).

ControlType2 ctrl_type;

This is the type of user interface control.

EditSpinnerType spin_type;

This is the spinner type if the associated UI control is a spinner. One of the following values may be used:

EDITTYPE_INT

Any integer value.

EDITTYPE_FLOAT

Any floating point value.

EDITTYPE_UNIVERSE

This is a value in world space units. It respects the system's unit settings (for example feet and inches).

EDITTYPE_POS_INT

Any integer >= 0

EDITTYPE_POS_FLOAT

Any floating point value >= 0.0

EDITTYPE_POS_UNIVERSE

This is a positive value in world space units. It respects the system's unit settings (for example feet and inches) .

EDITTYPE_TIME

This is a time value. It respects the system time settings (SMPTE for example).

int* ctrl_IDs;

This is the array of control IDs for this parameter.

short ctrl_count;

This is the number of controls in the ctrl_IDs array above.

int* val_bits;

These are radio button vals or bit numbers for int bits controlled by multiple checkboxes. The numbers in the int array are used to indicate which bit to flip in the TYPE_INT parameter depending on the state of the associated (by order) checkbox. This is not yet implemented.

float scale;

This is the scale given to the ISpinnerControl, as is used in SetupFloatSpinner(), for example.

int numSegs;

This is the slider segments count.

ParamID* enable_ctrls;

The array of which other parameters have their UI controls automatically enabled by this parameter.

short enable_count;

This is the number of parameter IDs in the enable_ctrls array above.

int prompt;

The status line prompt string resource ID for various picker buttons.

int caption;

The caption string resource ID for open/save file dialogs.

TCHAR* init_file;

The initial filename for open/save file dialogs.

int file_types;

The file types string resource ID for open/save file dialogs (in MAXScript type: form)

void DeleteThis();

This function deletes this instance of the structure.