3ds Max C++ API Reference
Loading...
Searching...
No Matches
iparamb2.h File Reference
#include "PB2Export.h"
#include "maxheap.h"
#include "iparamb.h"
#include "iparamm.h"
#include "assetmanagement/AssetType.h"
#include "assetmanagement/AssetId.h"
#include "iparamb2Typedefs.h"
#include "TabTypes.h"
#include <memory>
#include "paramtype.h"
#include "iparamb2.inline.h"

Classes

struct  PB2Value
 
struct  ParamAlias
 
class  IParamBlock2
 
class  PBValidator
 
class  PBAccessor
 
class  PBRescaleParamAccessor
 
struct  ParamDef
 
class  ClassDesc2
 
class  ModelessParamMapClassDesc2
 Extension class that adds functionality to class ClassDesc2 for parameter block-linked modeless UI. More...
 
class  ParamBlockDesc2
 
struct  ParamBlockDesc2::map_spec
 
class  ParamBlock2PLCB
 
class  IParamBlock2PostLoadInfo
 Informational class about ParamBlock2 objects loaded from file. More...
 
class  IParamBlock2::ParameterIterator
 Provides standard C++ iteration functionality for the parameters stored by an IParamBlock2. More...
 

Namespaces

namespace  MaxSDK
 
namespace  MaxSDK::AssetManagement
 

Macros

#define P_CLASS_PARAMS   0x0001
 this block holds class-level parameters, attached to ClassDesc
 
#define P_AUTO_CONSTRUCT   0x0002
 instructs ClassDesc2 to auto-construct this block & wire it in, requires parameter block reference number
 
#define P_AUTO_UI   0x0004
 this block support automatic UI rollout managements, requires rollout template res ID, etc.
 
#define P_USE_PARAMS   0x0008
 this block shares (exactly) the paramdefs from another descriptor, requires address of source descriptor
 
#define P_INCLUDE_PARAMS   0x0010
 this block loads in a copy the paramdefs from another descriptor, requires address of source descriptor
 
#define P_MULTIMAP   0x0020
 indicates this block as multiple parameter maps ### move me
 
#define P_CALLSETS_ON_LOAD   0x0040
 causes CallSets() to be called during load PLCB for this block
 
#define P_HASCATEGORY   0x0080
 indicates, that category field is defined for rollup (after rollup proc)
 
#define P_TEMPLATE_UI   0x0100
 indicates that dialog templates will be provided or constructed
 
#define P_VERSION   0x0200
 Indicates a parameter block version number is specified.
 
#define P_AUTO_UI_QT   0x0400
 This block supports automatic UI management through Qt.
 
#define P_SCRIPTED_CLASS   0x1000
 belongs to a scripted plug-in class
 
#define P_TEMPORARY   0x2000
 temporary descriptor built during scene load to support schema migration
 
#define P_LOAD_AS_TEMPORARY   0x4000
 This block is loaded as a dynamic param block.
 
#define P_ANIMATABLE   0x00000001
 animatable parameter
 
#define P_TRANSIENT   0x00000002
 do not store actual value, PBAccessor-derived
 
#define P_NO_INIT   0x00000004
 do not initialize
 
#define P_COMPUTED_NAME   0x00000008
 call compute name fn to get name
 
#define P_INVISIBLE   0x00000010
 not visible in track view (if an animatable)
 
#define P_RESET_DEFAULT   0x00000020
 do not make create params sticky, reset to defaults always
 
#define P_SUBANIM   0x00000040
 non-animatable reference parameter is still a subanim (makes it visible in TV)
 
#define P_TV_SHOW_ALL   0x00000080
 for Tab<> animatables, show all entries even if no controller assigned
 
#define P_NO_REF   0x00000100
 for reference target params do not maintain Reference automatically
 
#define P_OWNERS_REF   0x00000200
 reference parameter maintained by owner, specify owner's reference number via the p_refno tag
 
#define P_CAN_CONVERT   0x00000400
 indicates the p_classid validator is is in a CanConvertoTo() call, rather than as exact class
 
#define P_SUBTEX   0x00000800
 indicates texmap parameter is kept by owner using MtlBase::xSubTexmap protocol, give subtex # in p_subtexno
 
#define P_VARIABLE_SIZE   0x00001000
 Tab<> parameter is variable size allowing scripted changes.
 
#define P_NO_AUTO_LABELS   0x00002000
 don't auto-set map & mtl names for associated button UI controls
 
#define P_SHORT_LABELS   0x00004000
 use short auto names for associated button UI controls
 
#define P_READ_ONLY   0x00008000
 this parameter is not assignable through MAXScript (allows try-and-buy 3rd-party plugins)
 
#define P_OBSOLETE   0x40000000
 Indicates parameter is obsolete.
 
#define P_READ_SECOND_FLAG_VALUE   0x80000000
 Indicates that a second per parameter constructor-specifiable flag value follows the first in the ParamBlockDesc2.
 
#define P_USE_ACCESSOR_ONLY   0x00000001
 Indicates whether or not when doing a get or set on a param2 value that we only go through the accessor if one is available.
 
#define P_USE_ACCESSOR_ONLY_INTERNAL   0x0000000100000000
 Used internally in ParamDef::flags when P_USE_ACCESSOR_ONLY is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).
 
#define P_USE_NODE_TM_VALIDITY   0x00000002
 Indicates that the parameter block's validity interval is intersected with that of the Node parameter's transform.
 
#define P_USE_NODE_TM_VALIDITY_INTERNAL   0x0000000200000000
 Used internally in ParamDef::flags when P_USE_NODE_TM_VALIDITY is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).
 
#define P_USE_NODE_OS_VALIDITY   0x00000004
 Indicates that the parameter block's validity interval is intersected with that of the Node parameter's object state (including the world space modifiers).
 
#define P_USE_NODE_OS_VALIDITY_INTERNAL   0x0000000400000000
 Used internally in ParamDef::flags when P_USE_NODE_OS_VALIDITY is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).
 
#define P_NO_MACRO_RECORDER   0x00000008
 Indicates that changes to this parameter will not be recorded by the macro recorder.
 
#define P_NO_MACRO_RECORDER_INTERNAL   0x0000000800000000
 Used internally in ParamDef::flags when P_NO_MACRO_RECORDER is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).
 
#define P_ENUMERATE_AS_ASSET   0x00000010
 Indicates that the parameter's value will be recognized and treated as an asset without extra code from the plug-in developer.
 
#define P_ENUMERATE_AS_ASSET_INTERNAL   0x0000001000000000
 Used internally in ParamDef::flags when P_ENUMERATE_AS_ASSET is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).
 
#define P_READ_ONLY_ASSET   0x00000020
 Indicates that the parameter's value cannot be changed via asset retargetting operations, or direct editing via Maxscript.
 
#define P_READ_ONLY_ASSET_INTERNAL   0x0000002000000000
 Used internally in ParamDef::flags when P_READ_ONLY_ASSET is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).
 
#define P_IS_REF   0x0000000000010000
 is a reference target parameter
 
#define P_HAS_DEFAULT   0x0000000000020000
 parameter has a default value
 
#define P_HAS_CUR_DEFAULT   0x0000000000040000
 has a snapshotted current default value
 
#define P_HAS_MS_DEFAULT   0x0000000000080000
 has a MAXScript default
 
#define P_HAS_RANGE   0x0000000000100000
 has a range specified
 
#define P_HAS_CLASS_ID   0x0000000000200000
 a classID validator was given
 
#define P_HAS_SCLASS_ID   0x0000000000400000
 an SClassID validator was given
 
#define P_UI_ENABLED   0x0000000000800000
 indicates whether UI controls are initially enabled or disabled
 
#define P_HAS_PROMPT   0x0000000001000000
 has status line prompt string res ID for various picker buttons
 
#define P_HAS_CAPTION   0x0000000002000000
 has caption string res ID for open/save file dialogs
 
#define P_HAS_FILETYPES   0x0000000004000000
 has file types string res ID for open/save file dialogs (in MAXScript type: form)
 
#define P_HAS_REFNO   0x0000000008000000
 has reference number supplied
 
#define P_HAS_SUBTEXNO   0x0000000010000000
 has sub-texture number supplied
 
#define P_INCLUDED   0x0000000020000000
 [INTERNAL ONLY] Sets a ParamDef as included from another descriptor.
 
#define P_HAS_TOOLTIP   0x0001000000000000
 has ToolTip string
 
#define P_HAS_ASSETTYPE   0x0002000000000000
 has asset type
 
#define P_HAS_ASSETTYPENAME   0x0004000000000000
 has asset type name
 
#define P_DEFAULTS_AND_RANGES_IN_METERS   0x0008000000000000
 p_defaults_and_ranges_in_meters tag specified
 
#define P_DELETE_LOCAL_NAME_STRING   0x0010000000000000
 local_name contains a pointer to a string, delete string when ParamDef is deleted
 
#define root_type(t)   ((ParamType2)((t) & ~(TYPE_TAB | TYPE_BY_VAL | TYPE_BY_REF | TYPE_BY_PTR)))
 get base type ignoring all flags
 
#define root_value_type(t)   ((ParamType2)((t) & ~(TYPE_BY_VAL | TYPE_BY_REF | TYPE_BY_PTR)))
 get base type ignoring all flags except Tab
 
#define is_tab(t)   ((t) & TYPE_TAB)
 is this parameter a table?
 
#define is_by_val(t)   ((t) & TYPE_BY_VAL)
 is this parameter passed by value? (only for function publishing)
 
#define is_by_ref(t)   ((t) & TYPE_BY_REF)
 is this parameter passed by reference? (only for function publishing)
 
#define is_by_ptr(t)   ((t) & TYPE_BY_PTR)
 is this parameter passed by pointer? (only for function publishing)
 
#define is_ref(d)   (((d).flags & (P_IS_REF | P_NO_REF | P_OWNERS_REF)) == P_IS_REF)
 is this parameter a true local reference maker?
 
#define has_ui(d)   ((d).ctrl_count > 0)
 this parameter has UI info defined
 
#define reftarg_type(t)
 
#define PB_RESCALE_PARAM_ACCESSOR_INTERFACE   Interface_ID(0x195f6f32, 0x5f2126d0)
 This interface should be implemented by PBAccessor-derived classes if it needs to respond differently to Set calls when the system is performing rescaling of parameter block parameters.
 
#define IPARAMBLOCK2POSTLOADINFO_ID   Interface_ID(0x6c7b290a, 0x7c56423c)
 

Functions

ParamType2 base_type (ParamType2 t)
 get base type ignoring Tab flag
 
ParamType2 base_type (int t)
 get base type ignoring Tab flag
 
PB2Export IParamBlock2CreateParameterBlock2 (ParamBlockDesc2 *pdesc, ReferenceMaker *iowner)
 
PB2Export void SetPB2MacroRecorderInterface (MacroRecorder *mri)
 
PB2Export IParamBlock2UpdateParameterBlock2 (ParamBlockDescID *pdescOld, int oldCount, IParamBlock *oldPB, ParamBlockDesc2 *pdescNew, IParamBlock2 *newPB=nullptr)
 
PB2Export IParamBlock2UpdateParameterBlock2 (ParamBlockDescID *pdescOld, int oldCount, IParamBlock *oldPB, ParamBlockDesc2 *pdescNew, Tab< DWORD > &subAnimRenumbering, IParamBlock2 *newPB=nullptr)
 
PB2Export int CopyParamBlock2ToParamBlock (IParamBlock2 *pb2, IParamBlock *pb1, ParamBlockDescID *pdescPB1, int pb1Count)
 
PB2Export void ProcessPB2ToPB1SaveToPrevious (ReferenceMaker *pb2_owner, IParamBlock2 *pb2, int pb2_refno, ParamBlockDescID *pdesc, int count, DWORD version)
 Helper function for handling Save To Previous for a ParamBlock to ParamBlock2 migration.
 
PB2Export bool IsParamTypeAnimatable (const ParamType2 t)
 
PB2Export bool IsParamTypeRefTarg (const ParamType2 t)
 

Macro Definition Documentation

◆ P_CLASS_PARAMS

#define P_CLASS_PARAMS   0x0001

this block holds class-level parameters, attached to ClassDesc

◆ P_AUTO_CONSTRUCT

#define P_AUTO_CONSTRUCT   0x0002

instructs ClassDesc2 to auto-construct this block & wire it in, requires parameter block reference number

◆ P_AUTO_UI

#define P_AUTO_UI   0x0004

this block support automatic UI rollout managements, requires rollout template res ID, etc.

◆ P_USE_PARAMS

#define P_USE_PARAMS   0x0008

this block shares (exactly) the paramdefs from another descriptor, requires address of source descriptor

◆ P_INCLUDE_PARAMS

#define P_INCLUDE_PARAMS   0x0010

this block loads in a copy the paramdefs from another descriptor, requires address of source descriptor

◆ P_MULTIMAP

#define P_MULTIMAP   0x0020

indicates this block as multiple parameter maps ### move me

◆ P_CALLSETS_ON_LOAD

#define P_CALLSETS_ON_LOAD   0x0040

causes CallSets() to be called during load PLCB for this block

◆ P_HASCATEGORY

#define P_HASCATEGORY   0x0080

indicates, that category field is defined for rollup (after rollup proc)

◆ P_TEMPLATE_UI

#define P_TEMPLATE_UI   0x0100

indicates that dialog templates will be provided or constructed

◆ P_VERSION

#define P_VERSION   0x0200

Indicates a parameter block version number is specified.

When used as a ParamBlockDesc2 flag, a version number is expected immediately after the flags field, before the reference number field. This version number will be stored as ParamBlockDesc2::version and returned as IParamBlock2::GetVersion() indicates a version number is specified (integer value, before the reference number field)

◆ P_AUTO_UI_QT

#define P_AUTO_UI_QT   0x0400

This block supports automatic UI management through Qt.

Requires the class descriptor, and the implementation of ClassDesc2::CreateQtWidget(). Incompatible with P_AUTO_UI and P_TEMPLATE_UI. See: Qt in Parameter Maps and Parameter Blocks.

◆ P_SCRIPTED_CLASS

#define P_SCRIPTED_CLASS   0x1000

belongs to a scripted plug-in class

◆ P_TEMPORARY

#define P_TEMPORARY   0x2000

temporary descriptor built during scene load to support schema migration

◆ P_LOAD_AS_TEMPORARY

#define P_LOAD_AS_TEMPORARY   0x4000

This block is loaded as a dynamic param block.

A plugin has to set a ClassDesc2 later on that block, during a postLoad callback, e.g.

◆ P_ANIMATABLE

#define P_ANIMATABLE   0x00000001

animatable parameter

◆ P_TRANSIENT

#define P_TRANSIENT   0x00000002

do not store actual value, PBAccessor-derived

◆ P_NO_INIT

#define P_NO_INIT   0x00000004

do not initialize

◆ P_COMPUTED_NAME

#define P_COMPUTED_NAME   0x00000008

call compute name fn to get name

◆ P_INVISIBLE

#define P_INVISIBLE   0x00000010

not visible in track view (if an animatable)

◆ P_RESET_DEFAULT

#define P_RESET_DEFAULT   0x00000020

do not make create params sticky, reset to defaults always

◆ P_SUBANIM

#define P_SUBANIM   0x00000040

non-animatable reference parameter is still a subanim (makes it visible in TV)

◆ P_TV_SHOW_ALL

#define P_TV_SHOW_ALL   0x00000080

for Tab<> animatables, show all entries even if no controller assigned

◆ P_NO_REF

#define P_NO_REF   0x00000100

for reference target params do not maintain Reference automatically

◆ P_OWNERS_REF

#define P_OWNERS_REF   0x00000200

reference parameter maintained by owner, specify owner's reference number via the p_refno tag

◆ P_CAN_CONVERT

#define P_CAN_CONVERT   0x00000400

indicates the p_classid validator is is in a CanConvertoTo() call, rather than as exact class

◆ P_SUBTEX

#define P_SUBTEX   0x00000800

indicates texmap parameter is kept by owner using MtlBase::xSubTexmap protocol, give subtex # in p_subtexno

◆ P_VARIABLE_SIZE

#define P_VARIABLE_SIZE   0x00001000

Tab<> parameter is variable size allowing scripted changes.

◆ P_NO_AUTO_LABELS

#define P_NO_AUTO_LABELS   0x00002000

don't auto-set map & mtl names for associated button UI controls

◆ P_SHORT_LABELS

#define P_SHORT_LABELS   0x00004000

use short auto names for associated button UI controls

◆ P_READ_ONLY

#define P_READ_ONLY   0x00008000

this parameter is not assignable through MAXScript (allows try-and-buy 3rd-party plugins)

◆ P_OBSOLETE

#define P_OBSOLETE   0x40000000

Indicates parameter is obsolete.

◆ P_READ_SECOND_FLAG_VALUE

#define P_READ_SECOND_FLAG_VALUE   0x80000000

Indicates that a second per parameter constructor-specifiable flag value follows the first in the ParamBlockDesc2.

◆ P_USE_ACCESSOR_ONLY

#define P_USE_ACCESSOR_ONLY   0x00000001

Indicates whether or not when doing a get or set on a param2 value that we only go through the accessor if one is available.

◆ P_USE_ACCESSOR_ONLY_INTERNAL

#define P_USE_ACCESSOR_ONLY_INTERNAL   0x0000000100000000

Used internally in ParamDef::flags when P_USE_ACCESSOR_ONLY is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).

◆ P_USE_NODE_TM_VALIDITY

#define P_USE_NODE_TM_VALIDITY   0x00000002

Indicates that the parameter block's validity interval is intersected with that of the Node parameter's transform.

This flag has no effect for parameters types other than TYPE_INODE and TYPE_INODE_TAB. This flag needs to be specified as the second flag value when declaring ParameterBlock2 parameters (see P_READ_SECOND_FLAG_VALUE).

◆ P_USE_NODE_TM_VALIDITY_INTERNAL

#define P_USE_NODE_TM_VALIDITY_INTERNAL   0x0000000200000000

Used internally in ParamDef::flags when P_USE_NODE_TM_VALIDITY is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).

◆ P_USE_NODE_OS_VALIDITY

#define P_USE_NODE_OS_VALIDITY   0x00000004

Indicates that the parameter block's validity interval is intersected with that of the Node parameter's object state (including the world space modifiers).

This flag has no effect for parameters types other than TYPE_INODE and TYPE_INODE_TAB. This flag needs to be specified as the second flag value when declaring ParameterBlock2 parameters (see P_READ_SECOND_FLAG_VALUE).

◆ P_USE_NODE_OS_VALIDITY_INTERNAL

#define P_USE_NODE_OS_VALIDITY_INTERNAL   0x0000000400000000

Used internally in ParamDef::flags when P_USE_NODE_OS_VALIDITY is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).

◆ P_NO_MACRO_RECORDER

#define P_NO_MACRO_RECORDER   0x00000008

Indicates that changes to this parameter will not be recorded by the macro recorder.

Useful when using P_USE_ACCESSOR_ONLY entries to control other parameters indirectly. This flag needs to be specified as the second flag value when declaring ParameterBlock2 parameters (see P_READ_SECOND_FLAG_VALUE).

◆ P_NO_MACRO_RECORDER_INTERNAL

#define P_NO_MACRO_RECORDER_INTERNAL   0x0000000800000000

Used internally in ParamDef::flags when P_NO_MACRO_RECORDER is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).

◆ P_ENUMERATE_AS_ASSET

#define P_ENUMERATE_AS_ASSET   0x00000010

Indicates that the parameter's value will be recognized and treated as an asset without extra code from the plug-in developer.

For example, the plugin will not need to override Animatable::EnumAuxFiles() in order for the parameter's value to show up in the Asset Tracker System, to be archived, etc. This flag needs to be specified as the second flag value when declaring ParameterBlock2 parameters (see P_READ_SECOND_FLAG_VALUE).

◆ P_ENUMERATE_AS_ASSET_INTERNAL

#define P_ENUMERATE_AS_ASSET_INTERNAL   0x0000001000000000

Used internally in ParamDef::flags when P_ENUMERATE_AS_ASSET is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).

◆ P_READ_ONLY_ASSET

#define P_READ_ONLY_ASSET   0x00000020

Indicates that the parameter's value cannot be changed via asset retargetting operations, or direct editing via Maxscript.

By setting this flag, the parameter cannot be retargetted via the Asset Tracking System, and cannot be edited via Maxscript. This flag needs to be specified as the second flag value when declaring ParameterBlock2 parameters (see P_READ_SECOND_FLAG_VALUE).

◆ P_READ_ONLY_ASSET_INTERNAL

#define P_READ_ONLY_ASSET_INTERNAL   0x0000002000000000

Used internally in ParamDef::flags when P_READ_ONLY_ASSET is specified in the second flag parameter of the ParamDef constructor (see P_READ_SECOND_FLAG_VALUE).

◆ P_IS_REF

#define P_IS_REF   0x0000000000010000

is a reference target parameter

◆ P_HAS_DEFAULT

#define P_HAS_DEFAULT   0x0000000000020000

parameter has a default value

◆ P_HAS_CUR_DEFAULT

#define P_HAS_CUR_DEFAULT   0x0000000000040000

has a snapshotted current default value

◆ P_HAS_MS_DEFAULT

#define P_HAS_MS_DEFAULT   0x0000000000080000

has a MAXScript default

◆ P_HAS_RANGE

#define P_HAS_RANGE   0x0000000000100000

has a range specified

◆ P_HAS_CLASS_ID

#define P_HAS_CLASS_ID   0x0000000000200000

a classID validator was given

◆ P_HAS_SCLASS_ID

#define P_HAS_SCLASS_ID   0x0000000000400000

an SClassID validator was given

◆ P_UI_ENABLED

#define P_UI_ENABLED   0x0000000000800000

indicates whether UI controls are initially enabled or disabled

◆ P_HAS_PROMPT

#define P_HAS_PROMPT   0x0000000001000000

has status line prompt string res ID for various picker buttons

◆ P_HAS_CAPTION

#define P_HAS_CAPTION   0x0000000002000000

has caption string res ID for open/save file dialogs

◆ P_HAS_FILETYPES

#define P_HAS_FILETYPES   0x0000000004000000

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

◆ P_HAS_REFNO

#define P_HAS_REFNO   0x0000000008000000

has reference number supplied

◆ P_HAS_SUBTEXNO

#define P_HAS_SUBTEXNO   0x0000000010000000

has sub-texture number supplied

◆ P_INCLUDED

#define P_INCLUDED   0x0000000020000000

[INTERNAL ONLY] Sets a ParamDef as included from another descriptor.

If this is set on a ParamDef, its member pointers have been copied from another descriptor, and will not be released.

◆ P_HAS_TOOLTIP

#define P_HAS_TOOLTIP   0x0001000000000000

has ToolTip string

◆ P_HAS_ASSETTYPE

#define P_HAS_ASSETTYPE   0x0002000000000000

has asset type

◆ P_HAS_ASSETTYPENAME

#define P_HAS_ASSETTYPENAME   0x0004000000000000

has asset type name

◆ P_DEFAULTS_AND_RANGES_IN_METERS

#define P_DEFAULTS_AND_RANGES_IN_METERS   0x0008000000000000

p_defaults_and_ranges_in_meters tag specified

◆ P_DELETE_LOCAL_NAME_STRING

#define P_DELETE_LOCAL_NAME_STRING   0x0010000000000000

local_name contains a pointer to a string, delete string when ParamDef is deleted

◆ root_type

#define root_type (   t)    ((ParamType2)((t) & ~(TYPE_TAB | TYPE_BY_VAL | TYPE_BY_REF | TYPE_BY_PTR)))

get base type ignoring all flags

◆ root_value_type

#define root_value_type (   t)    ((ParamType2)((t) & ~(TYPE_BY_VAL | TYPE_BY_REF | TYPE_BY_PTR)))

get base type ignoring all flags except Tab

◆ is_tab

#define is_tab (   t)    ((t) & TYPE_TAB)

is this parameter a table?

◆ is_by_val

#define is_by_val (   t)    ((t) & TYPE_BY_VAL)

is this parameter passed by value? (only for function publishing)

◆ is_by_ref

#define is_by_ref (   t)    ((t) & TYPE_BY_REF)

is this parameter passed by reference? (only for function publishing)

◆ is_by_ptr

#define is_by_ptr (   t)    ((t) & TYPE_BY_PTR)

is this parameter passed by pointer? (only for function publishing)

◆ is_ref

#define is_ref (   d)    (((d).flags & (P_IS_REF | P_NO_REF | P_OWNERS_REF)) == P_IS_REF)

is this parameter a true local reference maker?

◆ has_ui

#define has_ui (   d)    ((d).ctrl_count > 0)

this parameter has UI info defined

◆ reftarg_type

#define reftarg_type (   t)
Value:
base_type(t) == TYPE_REFTARG || base_type(t) == TYPE_PBLOCK2 || base_type(t) == TYPE_OBJECT || base_type(t) == TYPE_CONTROL)
ParamType2 base_type(ParamType2 t)
get base type ignoring Tab flag
Definition: iparamb2.h:164
@ TYPE_TEXMAP
A pointer to a Texmap (texture map) object.
Definition: paramtype.h:76
@ TYPE_REFTARG
A pointer to a ReferenceTarget object.
Definition: paramtype.h:79
@ TYPE_OBJECT
Identifies an Object argument type or return value.
Definition: paramtype.h:122
@ TYPE_MTL
A pointer to a Mtl (material) object.
Definition: paramtype.h:75
@ TYPE_PBLOCK2
A pointer to an IParamBlock2 object.
Definition: paramtype.h:83
@ TYPE_INODE
A pointer to an INode.
Definition: paramtype.h:78
@ TYPE_CONTROL
Identifies a Control argument type or return value.
Definition: paramtype.h:123

◆ PB_RESCALE_PARAM_ACCESSOR_INTERFACE

#define PB_RESCALE_PARAM_ACCESSOR_INTERFACE   Interface_ID(0x195f6f32, 0x5f2126d0)

This interface should be implemented by PBAccessor-derived classes if it needs to respond differently to Set calls when the system is performing rescaling of parameter block parameters.

See the EggShape sample plugin for an example.

◆ IPARAMBLOCK2POSTLOADINFO_ID

#define IPARAMBLOCK2POSTLOADINFO_ID   Interface_ID(0x6c7b290a, 0x7c56423c)

Function Documentation

◆ base_type() [1/2]

ParamType2 base_type ( ParamType2  t)
inline

get base type ignoring Tab flag

◆ base_type() [2/2]

ParamType2 base_type ( int  t)
inline

get base type ignoring Tab flag

◆ CreateParameterBlock2()

PB2Export IParamBlock2 * CreateParameterBlock2 ( ParamBlockDesc2 pdesc,
ReferenceMaker iowner 
)
Remarks
This method is used to create a parameter block2.
Parameters:
ParamBlockDesc2 *pdesc

This is an array of parameter block descriptors.

ReferenceMaker* iowner

Points to the owner of the parameter block.
Returns
A pointer to the created parameter block. On error NULL is returned.

◆ SetPB2MacroRecorderInterface()

PB2Export void SetPB2MacroRecorderInterface ( MacroRecorder mri)
Remarks
This function for internal use only.

◆ UpdateParameterBlock2() [1/2]

PB2Export IParamBlock2 * UpdateParameterBlock2 ( ParamBlockDescID pdescOld,
int  oldCount,
IParamBlock oldPB,
ParamBlockDesc2 pdescNew,
IParamBlock2 newPB = nullptr 
)
Remarks
This function updates or creates a new ParamBlock2, based on an existing ParamBlock of an earlier version. The new parameter block inherits any parameters from the old parameter block whose parameter IDs match. This may also be used to partially update an existing ParamBlock2. The parameter type of the ParamBlock and ParamBlock2 entries must match, with a special case that if the ParamBlock parameter type is TYPE_RGBA, the ParamBlock2 parameter type can be either TYPE_RGBA or TYPE_FRGBA
Parameters:
ParamBlockDescID *pdescOld

The array of parameter block descriptors which describes each parameter in the old parameter block.

int oldCount

The number of elements in the array above.

IParamBlock *oldPB

The old parameter block.

ParamBlockDesc2* pdescNew

Points to the new parameter block 2 descriptor.

IParamBlock2* newPB=NULL

Points to an existing IParamBlock2 indicating that this paramblock should be filled in from the old ParamBlock, rather than creating a new one.
Returns
The new parameter block2.

◆ UpdateParameterBlock2() [2/2]

PB2Export IParamBlock2 * UpdateParameterBlock2 ( ParamBlockDescID pdescOld,
int  oldCount,
IParamBlock oldPB,
ParamBlockDesc2 pdescNew,
Tab< DWORD > &  subAnimRenumbering,
IParamBlock2 newPB = nullptr 
)
Remarks
This function updates or creates a new ParamBlock2, based on an existing ParamBlock of an earlier version. The new parameter block inherits any parameters from the old parameter block whose parameter IDs match. This may also be used to partially update an existing ParamBlock2. The parameter type of the ParamBlock and ParamBlock2 entries must match, with a special case that if the ParamBlock parameter type is TYPE_RGBA, the ParamBlock2 parameter type can be either TYPE_RGBA or TYPE_FRGBA. This override of the method fills in a Tab<DWORD>& with the subAnim renumbering when doing the pb1 to pb2 conversion. When replacing a pb1 with a pb2, all instances of the pb1 should be replaced with the pb2, as objects such as scripted controllers may hold a pointer to the pb1 to support subAnims (refmaker pointer/subanim number data pairs). After replacing all pb1 instances, a REFMSG_SUBANIM_NUMBER_CHANGED NotifyDependents call should be made on the pb2 to update the subanim numbers if necessary.
Sample Code:
// replace old ParamBlock with a new ParamBlock2 filled in from old block
Tab<DWORD> subAnimRenumbering;
IParamBlock2* newPB2 = UpdateParameterBlock2(extVer10, NPARAMS, pblock, curdesc, subAnimRenumbering);
SingleRefMaker srm(pblock); // make sure pblock not deleted while we are using it here
targ->ReplaceReference(pbRefNum, newPB2); // make sure this reference transfer occurs
newPB2->TransferReferences(pblock); // things like scripted controllers may be pointing at the pb1 for subAnims, update those to point at the pb2
// may have have subAnim renumbering due to pb1 to pb2 conversion, if so tell the pb2's immediate dependents
if (subAnimRenumbering.Count() != 0)
newPB2->NotifyDependents(FOREVER, (PartID)&subAnimRenumbering, REFMSG_SUBANIM_NUMBER_CHANGED, NOTIFY_ALL, FALSE);
Definition: iparamb2.h:279
CoreExport RefResult NotifyDependents(const Interval &changeInt, PartID partID, RefMessage message, SClass_ID sclass=NOTIFY_ALL, BOOL propagate=TRUE, RefTargetHandle hTarg=nullptr, NotifyDependentsOption notifyDependentsOption=REFNOTIFY_ALLOW_OPTIMIZATIONS) override
Notify all dependent RefMakers concerned with the message.
CoreExport RefResult TransferReferences(RefTargetHandle oldTarget, BOOL delOld=FALSE)
Transfers all the references from oldTarget to this.
Reference Maker to single entity.
Definition: ref.h:2777
Generic container class.
Definition: tab.h:180
int Count() const
Retrieves the number of items in the Tab.
Definition: tab.h:219
#define REFMSG_SUBANIM_NUMBER_CHANGED
This notification is sent to dependents when a subanim's changes order.
Definition: ref.h:595
ULONG_PTR PartID
This is NOT just a bitmask, the parameter is also used to stuff pointers, hence the ULONG_PTR.
Definition: ref.h:51
#define FOREVER
Definition: interval.h:168
PB2Export IParamBlock2 * UpdateParameterBlock2(ParamBlockDescID *pdescOld, int oldCount, IParamBlock *oldPB, ParamBlockDesc2 *pdescNew, IParamBlock2 *newPB=nullptr)
#define NOTIFY_ALL
If this super class is passed to NotifyDependents() all dependents will be notified.
Definition: ref.h:820
Parameters:
ParamBlockDescID *pdescOld

The array of parameter block descriptors which describes each parameter in the old parameter block.

int oldCount

The number of elements in the array above.

IParamBlock *oldPB

The old parameter block.

ParamBlockDesc2* pdescNew

Points to the new parameter block 2 descriptor.

Tab<DWORD>& subAnimRenumbering

Will hold any subAnim renumbering when converting from pb1 to pb2.

IParamBlock2* newPB=NULL

Points to an existing IParamBlock2 indicating that this paramblock should be filled in from the old ParamBlock, rather than creating a new one.
Returns
The new parameter block2.

◆ CopyParamBlock2ToParamBlock()

PB2Export int CopyParamBlock2ToParamBlock ( IParamBlock2 pb2,
IParamBlock pb1,
ParamBlockDescID pdescPB1,
int  pb1Count 
)
Remarks
This function updates a ParamBlock based on an existing ParamBlock2. The ParamBlock inherits any parameters from the ParamBlock2 whose parameter IDs match. The parameter type of the ParamBlock and ParamBlock2 entries must match, with a special case that if the ParamBlock parameter type is TYPE_RGBA, the ParamBlock2 parameter type can be either TYPE_RGBA or TYPE_FRGBA This is mainly intended for use in Save To Previous, where the current version is ParamBlock2 based, and the old version is ParamBlock based. Note that if a ParamBlock2 parameter is animated, the ParamBlock2 will hold a reference to a controller for that parameter. This function does not clone the controller and have the ParamBlock hold a reference to that clone, rather the ParamBlock will hold a reference to the original controller. This is normally ok, since the ParamBlock will be deleted at the end of the save process. If the ParamBlock is being created other than for Save To Previous, you should consider replacing any references held by the ParamBlock with a clone of that reference.
Parameters:
IParamBlock2* pb2

Points to source IParamBlock2. IParamBlock* pb1

Points to destination IParamBlock. ParamBlockDescID *pdescPB1

The array of parameter block descriptors which describes each parameter in the ParamBlock.

int pb1Count

The number of elements in the array of parameter block descriptors.

Returns
The number of parameters copied from the IParamBlock2 to the IParamBlock.
bool BoxObject::SpecifySaveReferences(ReferenceSaveManager& referenceSaveManager)
{
// if saving to previous version that used pb1 instead of pb2...
DWORD saveVersion = GetSavingVersion();
if (saveVersion != 0 && saveVersion <= MAX_RELEASE_R19)
{
// create the pb1 instance
IParamBlock* paramBlock1 = CreateParameterBlock( pbdesc,swirl_num_params_ver1,1);
DbgAssert(paramBlock1 != NULL);
if (paramBlock1)
{
// copy data from the pb2 to the pb1
int numParamsCopied = CopyParamBlock2ToParamBlock(pblock,paramBlock1,pbdesc,swirl_num_params_ver1);
DbgAssert(numParamsCopied == swirl_num_params_ver1);
// register the reference slot replacement
referenceSaveManager.ReplaceReferenceSlot(PBLOCK_REF,paramBlock1);
// register transferring all refs to the pb2 to the pb1
ReferenceSaveManager& pb2_referenceSaveManager = pblock2->GetReferenceSaveManager();
pb2_referenceSaveManager.SetReplacementReferenceTarget(paramBlock1);
}
}
return Texmap::SpecifySaveReferences(referenceSaveManager);
}
#define NULL
Definition: autoptr.h:18
Definition: iparamb.h:282
virtual CoreExport bool SpecifySaveReferences(ReferenceSaveManager &referenceSaveManager)
Used to specify reference slot remapping during scene file save.
Used to specify and enumerate the save reference hierarchy, if different from the normal reference hi...
Definition: ReferenceSaveManager.h:72
virtual void ReplaceReferenceSlot(int which, ReferenceTarget *theRef)=0
Replaces the contents of a reference slot in the save reference hierarchy.
virtual void SetReplacementReferenceTarget(ReferenceTarget *theRef)=0
Specifies a ReferenceTarget that is to be saved instead of the ReferenceTarget represented by this in...
#define DbgAssert(expr)
Definition: assert1.h:83
#define MAX_RELEASE_R19
3ds Max R19 (2017) release id
Definition: plugapi.h:137
PB2Export int CopyParamBlock2ToParamBlock(IParamBlock2 *pb2, IParamBlock *pb1, ParamBlockDescID *pdescPB1, int pb1Count)
CoreExport IParamBlock * CreateParameterBlock(ParamBlockDesc *pdesc, int count)
CoreExport DWORD GetSavingVersion()
Function to find out if we are saving an old version of a .MAX file.
See also
ProcessPB2ToPB1SaveToPrevious

◆ ProcessPB2ToPB1SaveToPrevious()

PB2Export void ProcessPB2ToPB1SaveToPrevious ( ReferenceMaker pb2_owner,
IParamBlock2 pb2,
int  pb2_refno,
ParamBlockDescID pdesc,
int  count,
DWORD  version 
)

Helper function for handling Save To Previous for a ParamBlock to ParamBlock2 migration.

This method does all the required handling to support the Save To Previous handling of a ParamBlock to ParamBlock2 migration. The code creates a ParamBlock from a ParamBlock2 and registers the ParamBlock to be saved instead of the ParamBlock2.

Parameters
pb2_ownerThe owner of the ParamBlock2 instance.
pb2The ParamBlock2 instance to process.
pb2_refnoThe owner's reference number of the ParamBlock2 instance.
pdescAn array of parameter block descriptors.
countThe number of parameter block descriptors in the array.
versionThe version number of the parameter block The following is an example usage, where all references to the ParamBlock2 instance are replaced with a ParamBlock instance. /code bool BoxObject::SpecifySaveReferences(ReferenceSaveManager& referenceSaveManager) { if saving to previous version that used pb1 instead of pb2... DWORD saveVersion = GetSavingVersion(); if (saveVersion != 0 && saveVersion <= MAX_RELEASE_R19) { ProcessPB2ToPB1SaveToPrevious(this, pblock2, PBLOCK_REF_NO, descVer1, PBLOCK_LENGTH, CURRENT_VERSION); } return __super::SpecifySaveReferences(referenceSaveManager); } /endcode

◆ IsParamTypeAnimatable()

PB2Export bool IsParamTypeAnimatable ( const ParamType2  t)
Remarks
This function determines whether a param type is animatable.

◆ IsParamTypeRefTarg()

PB2Export bool IsParamTypeRefTarg ( const ParamType2  t)
Remarks
This function determines whether a param type is a type of reftarg.