3ds Max C++ API Reference
ParamBlockData::ContainerTypeAndIndex Struct Reference

Is a data structure for parameter blocks container information Retrieve the parameter block that was updated in the references or custom attributes or whatever of the Object* from the INode* or Mtl* or Texmap* etc... More...

#include <NotificationAPI_Events.h>

Public Member Functions

bool operator== (const ContainerTypeAndIndex &other)
 
bool operator!= (const ContainerTypeAndIndex &other)
 

Public Attributes

ParameterBlockContainerType m_Type
 is the parameter block container type More...
 
int m_Index
 is the index in the array of container type (as an example say m_Type = REFERENCES, then m_Index should be used with Object* pObj; IParamBlock* pbock = pObj->GetReference(m_Index); More...
 

Detailed Description

Is a data structure for parameter blocks container information Retrieve the parameter block that was updated in the references or custom attributes or whatever of the Object* from the INode* or Mtl* or Texmap* etc...

Example is a parameter from the shadow generator of a light node has been updated : m_ParamBlockType is the type of the param block such as PB1 or PB2 m_ParamBlockIndexPath contains the path to retrieve which parameter block was udpated. Example : if m_ParamBlockIndexPath contains 2 elements like : m_ParamBlockIndexPath[0].m_Type = CUSTOM_ATTRIBUTES; m_ParamBlockIndexPath[0].m_Index = 3; m_ParamBlockIndexPath[1].m_Type = REFERENCES; m_ParamBlockIndexPath[1].m_Index = 4; So to retrieve which paramblock was updated you have to use : Say, it's a node : INode* pNode = initialized somewhere; //Using minimal code checking for clarity ICustAttribContainer* custAttribCont = pNode->GetCustAttribContainer(); const int indexInCustAttr = m_ParamBlockIndexPath[0].m_Index; CustAttrib* custAttrib = custAttribCont->GetCustAttrib(indexInCustAttr); //Now get i-th reference from that custom attrib. using the index from m_ParamBlockIndexPath[1].m_Index const int indexInReferences = m_ParamBlockIndexPath[1].m_Index; RefTargetHandle pSubRefTarg = custAttrib->GetReference(indexInReferences); //And what we get now should be a paramblock of type PB_ONe or PB_TWO switch (m_Type){ case PB_ONE:{ IParamBlock* pblock1 = dynamic_cast<IParamBlock*>(pSubRefTarg); }break; case PB_TWO:{ IParamBlock2* pblock2 = dynamic_cast<IParamBlock2*>(pSubRefTarg); }break; } m_ParametersIDsUpdatedInThatParamBlock contains the ParamIDs(in case of type PB_TWO or the Param indices in case of type PB_ONE) which were updated m_ParametersNames contains all the parameters names that were updated wherever they come from so you can use only the names if you want.

Member Function Documentation

◆ operator==()

bool operator== ( const ContainerTypeAndIndex other)
inline
192 {return (other.m_Index == m_Index && other.m_Type == m_Type);}
int m_Index
is the index in the array of container type (as an example say m_Type = REFERENCES,...
Definition: NotificationAPI_Events.h:191
ParameterBlockContainerType m_Type
is the parameter block container type
Definition: NotificationAPI_Events.h:190

◆ operator!=()

bool operator!= ( const ContainerTypeAndIndex other)
inline
193 {return (other.m_Index != m_Index || other.m_Type != m_Type);}

Member Data Documentation

◆ m_Type

is the parameter block container type

◆ m_Index

int m_Index

is the index in the array of container type (as an example say m_Type = REFERENCES, then m_Index should be used with Object* pObj; IParamBlock* pbock = pObj->GetReference(m_Index);