Parameter Tags
 
 
 

The following are the optional parameter tags. These are special values used in the ParamBlockDesc2 constructor or the ParamBlockDesc2::ParamOption() method to indicate additional information is present. They are defined as enumerated values in the enumeration ParamTags.

p_default - This identifies the next values as the default value assigned when a block is first created. The default value must be of the correct type to match the ParamType of the parameter. For example float (or TYPE_FLOAT_TYPE) for TYPE_FLOATs, Point3 (or TYPE_RGBA_TYPE) for TYPE_RGBA, etc.) Defaults can only be supplied for the following base types: TYPE_ANGLE, TYPE_PCNT_FRAC, TYPE_COLOR_CHANNEL, TYPE_FLOAT, TYPE_TIMEVALUE, TYPE_INT, TYPE_BOOL, TYPE_RADIOBTN_INDEX, TYPE_POINT3, TYPE_RGBA, TYPE_STRING, TYPE_FILENAME, TYPE_MATRIX3.

Examples:

p_default,   FALSE,
p_default,   1,
p_default,   Point3(0,0,0),
p_default,   25.0,

p_ms_default - This establishes the default value used during MAXScript creation. For example the MAXScript command sphere. radius defaults to 25.0 when created by the script engine, but p_default is set to 0.0 so interactive creation starts out with a point-sized sphere when the first mouse click is made.

Example:

p_ms_default, 25.0,

p_range - This establishes allowable ranges used in MAXScript validation and spinner setup. Supplied as two values of the correct type. Ranges can only be supplied for the following types: TYPE_ANGLE, TYPE_PCNT_FRAC, TYPE_COLOR_CHANNEL, TYPE_FLOAT, TYPE_TIMEVALUE, TYPE_INT, TYPE_RADIOBTN_INDEX, TYPE_POINT3, TYPE_RGBA.

Example:

p_range,   -99999999.0, 99999999.0,

p_ui - This is the user interface control specification. For more information see the topic Parameter UI Controls.

p_uix - This specifies which additional rollup / map the parameter is supposed to appear in.

p_validator - Specifies a validator object. You supply a pointer to an instance of a class derived from PBValidator. This class has a PBValidator::Validate() method which should return TRUE if the PB2Value passed to it is valid, or FALSE otherwise. This can be used for instance by a node pick button to check if a chosen node is acceptable.

Example:

p_validator, &fOutValidator,

p_accessor - Specifies an accessor object (see Class PBAccessor). You supply a pointer to an instance of a class derived from PBAccessor. This class is used to provide a parameter Get/SetValue callback. The callback can be used to monitor parameter value changes, or to implement dynamically-computed virtual parameters. The class has two virtual methods, Get() and Set(), each given a PB2Value&, parameter ID, etc. In the case of a Get() you can modify the value in the PB2Value& to implement a virtual get.

Example:

p_accessor,  &cmap_accessor,

p_vals - This defines radio button values in button order if button settings need to correspond to non-ordinal numbers. The value of the parameter defaults to the ordinal number of the radio button, starting at 0. You can optionally supply this tag immediately following the TYPE_RADIO. This tag should be followed by a list of numbers, one for each radio button. These numbers will become the (non-ordinal) parameter value corresponding to which button is set.

Example:

p_vals,  0,1,2,4,3 ,

p_refno - This is used if the flag value in a <required_param_specs> includes P_OWNERS_REF. For these reference target parameters this specifies the reference number in the block's owner for this reference. If the parameter is a Tab<>, then the reference number supplied is the base reference number of the 0'th element, with sequential reference numbers for the following elements.

Example:

p_refno,  UVGEN_REF,

p_subtexno - For Texmap items in Mtls this defines the integer SubTexmap index for this Texmap in the owner Mtl. This is used by TYPE_TEXMAPBUTTON ParamMap2 control types to give to the Material Edtor for automatic button and Drag And Drop handling.

Example:

p_subtexno,  0,

p_submtlno - Defines the sub-material integer index for this material in an owner material. This is used by TYPE_MTLBUTTON ParamMap2 control types to give to the Material Edtior for automatic button and Drag And Drop handling.

Example:

p_submtlno,  1,

p_dim - This allows you to supply a dimension for this parameter. You specify a ParamDimension* as the argument. Certain parameter types have an implied dimension. Defaults to defaultDim.

Example:

p_dim,    stdWorldDim,

p_classID - This specifies the class ID used as a validator for the various reference target parameters. This is used by the scripter, picknode filter, etc. For example, if you supply this in a TYPE_INODE parameter and use a TYPE_PICKNODE parammap control, the picker uses this class ID in the picking filter. If you set the P_CAN_CONVERT parameter flag, it applies an Object::CanConvertTo() test to the node's world state using the Class_ID supplied to perform the filter test.

p_sclassID - This specifies the super class ID used as a validator for the various reference target parameters. For example, if you supply this in a TYPE_INODE parameter and use a TYPE_PICKNODE parammap control, the picker uses this super class ID in the picking filter.

Example:

p_sclassID,  SHAPE_CLASS_ID,

p_enabled - Supply TRUE or FALSE to indicate whether associated UI controls are enabled or disabled when the rollout dialog is first opened. If not supplied, defaults to TRUE. Can be overridden by p_enable_ctrls.

Example:

p_enabled,  FALSE,

p_enable_ctrls - For TYPE_BOOLs, lists which other parameters would be automatically UI enabled/disabled by changes in state of this parameter. This allows you to easily set up conditional enabling of other UI controls based on the state of the controlling parameter.

Example:

p_enable_ctrls, 3, sel_falloff, sel_pinch, sel_bubble,

p_prompt - This sets the status line prompt string resource ID for various picker buttons.

Example:

 p_prompt, IDS_PICK_CAM_PROMPT,

p_caption - This is a caption string resource ID for TYPE_FILEOPENBUTTON or TYPE_FILESAVEBUTTON open/save file dialogs.

p_init_file - This establishes the initial filename for open/save file dlgs. Use a direct string for the argument, not a resource ID. The filename can be changed at runtime; do this by setting the init_file member of the ParamDef for the parameter.

Example:

ParamBlockDesc2* pbdesc = ...;
pbdesc->GetParamDef(file_param).init_file = new_file_name;

p_file_types - This is used by open/save file dialogs. The argument is a string resource ID. This string sets up the file type drop-down in the open/save dialog. It is in the following form:

"<description1>|<pattern1>|<description2>|<pattern2>|...|"

In other words, it is a sequence of file type descriptions and file type patterns each separated by a '|' vertical bar and terminated by a '|' vertical bar. For example:

"Data(*.dat)|*.dat|Excel(*.csv)|*.csv|All|*.*|"

specifies 3 types in the file type dropdown, the first reading "Data(*.dat)" and matching *.dat and the second reading "Excel(*.csv)" and matching *.csv and the third reading "All" and matching any file.

p_tooltip - This lets you specify a tooltip string to be displayed for the user interface control associated with a parameter described in a parameter block. The p_tooltip tag needs to be followed by the resource id of the string representing the tooltip.

Example:

 p_tooltip, <tooltip_str_id>

end - Signals the end of the <required_param_specs> entry.