3ds Max C++ API Reference
IXRefItem Class Referenceabstract

Generic interface that represents an xrefed scene entity. More...

#include <iXrefItem.h>

+ Inheritance diagram for IXRefItem:

Public Types

enum  XRefItemType {
  kType_Object = 1<<0 , kType_Material = 1<<1 , kType_Controller = 1<<2 , kType_Atmospheric = 1<<3 ,
  kType_All , kType_All_No_Atmospherics
}
 List of xref item types or categories of xref-able scene entities. More...
 
enum  {
  kfpGetSrcFileName , kfpSetSrcFileName , kfpGetSrcItemName , kfpSetSrcItemName ,
  kfpGetSrcItem , kfpGetParentItems , kfpGetChildItems , kfpGetRootItems ,
  kfpGetXRefRecord , kfpIsUnresolved , kfpIsNested , kfpGetNodes ,
  kfpLastID
}
 
- Public Types inherited from BaseInterface
enum  LifetimeType { noRelease , immediateRelease , wantsRelease , serverControlled }
 

Public Member Functions

virtual Interface_ID GetID ()
 
 PROP_FNS (kfpGetSrcFileName, FPGetSrcFileName, kfpSetSrcFileName, FPSetSrcFileName, TYPE_FILENAME)
 
 PROP_FNS (kfpGetSrcItemName, GetSrcItemName, kfpSetSrcItemName, FPSetSrcItemName, TYPE_STRING)
 
 RO_PROP_FN (kfpGetXRefRecord, GetXRefRecord, TYPE_INTERFACE)
 
 RO_PROP_FN (kfpIsUnresolved, IsUnresolved, TYPE_bool)
 
 RO_PROP_FN (kfpIsNested, IsNested, TYPE_bool)
 
 FN_1 (kfpGetSrcItem, TYPE_REFTARG, GetSrcItem, TYPE_bool)
 
 FN_1 (kfpGetParentItems, TYPE_DWORD, GetParentItems, TYPE_REFTARG_TAB_BR)
 
 FN_1 (kfpGetRootItems, TYPE_DWORD, GetRootItems, TYPE_REFTARG_TAB_BR)
 
 FN_1 (kfpGetChildItems, TYPE_DWORD, GetChildItems, TYPE_REFTARG_TAB_BR)
 
 VFN_1 (kfpGetNodes, FPGetNodes, TYPE_INODE_TAB_BR)
 
virtual FPInterfaceDescGetDesc ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
XRef Item Property Access

The following methods give access to the properties of xref items.

These properties are allowed to be modified only via methods of IObjXRefManager8 in order to ensure the integrity of xref items and records where they are stored.

virtual const MaxSDK::AssetManagement::AssetUserGetSrcFile () const =0
 Retrieves the file asset that the source scene entity comes from. More...
 
virtual const MCHARGetSrcItemName () const =0
 Retrieves the name of the source scene entity. More...
 
virtual ReferenceTargetGetSrcItem (bool resolveNested=false) const =0
 Retrieves the source scene entity xrefed by this xref item. More...
 
virtual bool IsUnresolved () const =0
 Allows to verify whether the xref item is unresolved. More...
 
virtual IObjXRefRecordGetXRefRecord () const =0
 Retrieves the xref record this xref item belongs to. More...
 
virtual void GetNodes (INodeTab &xrefNodes) const =0
 Retrieves the nodes associated with this xref item. More...
 
Nested XRef Item Management

When xrefing scene entities that are themselves xrefs, nested xref items are created.

The following methods allow working with nested xref items.

virtual unsigned int GetParentItems (Tab< ReferenceTarget * > &parentItems) const =0
 Retrieves the xref items under which this xref item is nested. More...
 
virtual unsigned int GetChildItems (Tab< ReferenceTarget * > &childItems) const =0
 Returns the list of every xref item for which GetParentItem() would return 'this'.
More...
 
virtual unsigned int GetRootItems (Tab< ReferenceTarget * > &rootItems) const =0
 Retrieves the root (top-level) xref items of this xref item. More...
 
virtual bool IsNested () const =0
 Checks whether this xref item is a nested one. More...
 
- Public Member Functions inherited from FPMixinInterface
 FPMixinInterface ()
 
virtual LifetimeType LifetimeControl ()
 
virtual CoreExport bool RegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
virtual void UnRegisterNotifyCallback (InterfaceNotifyCallback *incb)
 
CoreExport ~FPMixinInterface ()
 
virtual BaseInterfaceGetInterface (Interface_ID id)
 
virtual FPInterfaceDescGetDescByID (Interface_ID id)
 
- Public Member Functions inherited from FPInterface
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t=0, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPParams *params)
 
virtual CoreExport FPStatus Invoke (FunctionID fid, TimeValue t, FPValue &result, FPParams *params=NULL)
 
virtual FPStatus Invoke (FunctionID fid, FPValue &result, FPParams *params=NULL)
 
virtual CoreExport FunctionID FindFn (const MCHAR *name)
 
virtual CoreExport BOOL IsEnabled (FunctionID actionID)
 
virtual CoreExport BOOL IsChecked (FunctionID actionID)
 
virtual CoreExport BOOL IsVisible (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsEnabled (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsChecked (FunctionID actionID)
 
virtual CoreExport FunctionID GetIsVisible (FunctionID actionID)
 
virtual ActionTableGetActionTable ()
 
virtual void EnableActions (BOOL onOff)
 
- Public Member Functions inherited from BaseInterface
virtual UtilExport ~BaseInterface ()
 Destructor. More...
 
virtual BaseInterfaceAcquireInterface ()
 
virtual void ReleaseInterface ()
 
virtual void DeleteInterface ()
 
virtual BaseInterfaceCloneInterface (void *remapDir=NULL)
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 
template<class InterfaceType >
InterfaceType * GetTypedInterface ()
 

Static Public Member Functions

static bool IsIXRefItem (InterfaceServer &is)
 Allows to determine whether a scene entity implements this interface. More...
 
static IXRefItemGetInterface (InterfaceServer &is)
 Retrieves the IXRefItem interface from a scene entity. More...
 
- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Static Public Attributes

static FPInterfaceDesc mFPInterfaceDesc
 
- Static Public Attributes inherited from FPInterface
static CoreExport FPInterfaceDesc nullInterface
 

Protected Member Functions

Function Publishing methods

Sets file name of xref.

Implemented by the system.

virtual void FPSetSrcFileName (const MCHAR *fileName)=0
 Gets file name of xref. Implemented by the system. More...
 
virtual const MCHARFPGetSrcFileName ()=0
 Gets file name of xref. Implemented by the system. More...
 
virtual void FPSetSrcItemName (const MCHAR *itemName)=0
 Sets item name of xref. Implemented by the system. More...
 
- Protected Member Functions inherited from FPMixinInterface
 FPMixinInterface (const FPMixinInterface &rhs)
 
FPMixinInterfaceoperator= (const FPMixinInterface &rhs)
 
- Protected Member Functions inherited from FPInterface
virtual FPStatus _dispatch_fn (FunctionID fid, TimeValue t, FPValue &result, FPParams *p)
 

Additional Inherited Members

- Protected Attributes inherited from FPMixinInterface
Tab< InterfaceNotifyCallback * > * interfaceNotifyCBs
 

Detailed Description

Generic interface that represents an xrefed scene entity.

This interface exposes services common to all xref scene entities. 3rd party plugins do not need to derive from this interface. Support for xrefing different plugin categories is provided by the system (3ds Max). Each plugin category that supports xrefing is modeled as a class that implements this interface.

Xref items can be created and modified via the Object XRef Manager (IObjXRefManager8), and live in xref records (IObjXRefRecord). An xref item can live in one and only one xref record.

Sub-object animation of a scene entity is maintained when the scene entity is xrefed. Transform animation of a scene entity such as a node is brought into the main file, but is not updated when the xref record is updated.

In order to retrieve this interface from a scene entity, one must call either IXRefItem::GetInterface with a reference to a scene entity (Object, Atmospherics, etc.),

See also
IObjXRefManager8, IObjXRefRecord

Member Enumeration Documentation

◆ XRefItemType

List of xref item types or categories of xref-able scene entities.

Use the following values when retrieving xref items from xref records.

Enumerator
kType_Object 

Xref object type.

kType_Material 

Xref material type.

kType_Controller 
kType_Atmospheric 

Xref atmospheric type.

kType_All 

All xref item types.

kType_All_No_Atmospherics 

All xref item types, except atmospherics.

52  {
54  kType_Object = 1<<0,
56  kType_Material = 1<<1,
57  // Xref controller type - Unsupported
58  kType_Controller = 1<<2,
60  kType_Atmospheric = 1<<3,
70  };
@ kType_Material
Xref material type.
Definition: iXrefItem.h:56
@ kType_All
All xref item types.
Definition: iXrefItem.h:62
@ kType_Controller
Definition: iXrefItem.h:58
@ kType_All_No_Atmospherics
All xref item types, except atmospherics.
Definition: iXrefItem.h:67
@ kType_Atmospheric
Xref atmospheric type.
Definition: iXrefItem.h:60
@ kType_Object
Xref object type.
Definition: iXrefItem.h:54

◆ anonymous enum

anonymous enum
Enumerator
kfpGetSrcFileName 
kfpSetSrcFileName 
kfpGetSrcItemName 
kfpSetSrcItemName 
kfpGetSrcItem 
kfpGetParentItems 
kfpGetChildItems 
kfpGetRootItems 
kfpGetXRefRecord 
kfpIsUnresolved 
kfpIsNested 
kfpGetNodes 
kfpLastID 
190  {
199  kfpIsNested,
200  kfpGetNodes,
201  kfpLastID,
202  };
@ kfpIsUnresolved
Definition: iXrefItem.h:198
@ kfpIsNested
Definition: iXrefItem.h:199
@ kfpGetNodes
Definition: iXrefItem.h:200
@ kfpGetRootItems
Definition: iXrefItem.h:196
@ kfpSetSrcItemName
Definition: iXrefItem.h:192
@ kfpGetParentItems
Definition: iXrefItem.h:194
@ kfpLastID
Definition: iXrefItem.h:201
@ kfpGetSrcFileName
Definition: iXrefItem.h:191
@ kfpGetXRefRecord
Definition: iXrefItem.h:197
@ kfpSetSrcFileName
Definition: iXrefItem.h:191
@ kfpGetChildItems
Definition: iXrefItem.h:195
@ kfpGetSrcItemName
Definition: iXrefItem.h:192
@ kfpGetSrcItem
Definition: iXrefItem.h:193

Member Function Documentation

◆ GetSrcFile()

virtual const MaxSDK::AssetManagement::AssetUser& GetSrcFile ( ) const
pure virtual

Retrieves the file asset that the source scene entity comes from.

Returns
- The file asset that the source scene entity comes from.
See also
IObjXRefManager8::SetSrcFile

◆ GetSrcItemName()

virtual const MCHAR* GetSrcItemName ( ) const
pure virtual

Retrieves the name of the source scene entity.

Returns
- Pointer to the name of the source scene entity or NULL if there's no source item name specified.
See also
IObjXRefManager8::SetXRefItemSrcName

◆ GetSrcItem()

virtual ReferenceTarget* GetSrcItem ( bool  resolveNested = false) const
pure virtual

Retrieves the source scene entity xrefed by this xref item.

Parameters
[in]resolveNested- If true, the method looks for the first non-xref source item. This could be a direct or indirect source item.
Returns
- Pointer to the source scene entity xrefed by this xref item. The source entity can be itself an xref item or a derived object if the supplied parameter is false. If the source scene entity is NULL, the xref item is unresolved.
See also

◆ IsUnresolved()

virtual bool IsUnresolved ( ) const
pure virtual

Allows to verify whether the xref item is unresolved.

An xref item is unresolved if the source scene entity is invalid. This can happen for example if the source scene entity does not exist in the source file or the xref item has been pointed to a source file that does not exist. Unresolved xref items will not render, but have a default viewport representation. Unresolved xref items may get re-resolved on a subsequent reload of the xref item's record.

Returns
- true if this is an unresolved xref item
See also
IObjXRefRecord::Update

◆ GetXRefRecord()

virtual IObjXRefRecord* GetXRefRecord ( ) const
pure virtual

Retrieves the xref record this xref item belongs to.

Returns
The xref record this xref item belongs to. An xref item can belong to one and only one xref record at any one time. A return value of NULL, indicates that the xref item is not part of an xref record yet.

◆ GetNodes()

virtual void GetNodes ( INodeTab xrefNodes) const
pure virtual

Retrieves the nodes associated with this xref item.

This method retrieves all the nodes that reference this xref item. If this xref item is an xref atmospheric, no nodes will be reported. If this xref item is nested, this method retrieves the nodes that reference it indirectly. Note that nodes that are not in the scene could also be returned by this method.

Parameters
[in,out]xrefNodes- The tab of nodes that reference this xref item. The tab is not cleared by this method. The tab is guaranteed to not contain duplicated nodes.

◆ GetParentItems()

virtual unsigned int GetParentItems ( Tab< ReferenceTarget * > &  parentItems) const
pure virtual

Retrieves the xref items under which this xref item is nested.

A nested xref item can have multiple parent items (when for example a nested xref item is cloned), and all of them have the same type as their child item.

Parameters
[out]parentItems- Array where the parent xref items of this item are returned. The parent xref items are added to the array without clearing it out first.
Returns
- The number of parent xref items returned.

◆ GetChildItems()

virtual unsigned int GetChildItems ( Tab< ReferenceTarget * > &  childItems) const
pure virtual

Returns the list of every xref item for which GetParentItem() would return 'this'.

A child xref item is a xref item encountered when walking down any given path in the reference hierarchy of this xref item. An xref item may have several child xref items.

Parameters
[out]childItems- Array where the child xref items of this item are returned. The child xref items are added to the array without clearing it out first.
Returns
- The number of child xref items returned.

◆ GetRootItems()

virtual unsigned int GetRootItems ( Tab< ReferenceTarget * > &  rootItems) const
pure virtual

Retrieves the root (top-level) xref items of this xref item.

This method retrieves all top-level parent xref items of this item. A top-level xref item is an item that does not have an ancestor. The top-level xref item of an item that doesn't have ancestors is itself.

Parameters
rootItems- Array where the top-level (root) xref items of this item are returned. This array is guaranteed to contain at least this xref item.
Returns
- The number of top-level (root) xref items returned.

◆ IsNested()

virtual bool IsNested ( ) const
pure virtual

Checks whether this xref item is a nested one.

This method offers a more efficient way of finding out if this xref item is nested than calling GetParentItems.

Returns
- true if this xref item is a nested one.

◆ IsIXRefItem()

static bool IsIXRefItem ( InterfaceServer is)
inlinestatic

Allows to determine whether a scene entity implements this interface.

Parameters
[in]is- Reference to scene entity
Returns
- true if the scene entity implements the IXRefItem interface, false otherwise
174  {
175  return (is.GetInterface(IID_XREF_ITEM) != NULL);
176  };
#define NULL
Definition: autoptr.h:18
virtual UtilExport BaseInterface * GetInterface(Interface_ID id)
#define IID_XREF_ITEM
Id for IXRefItem interface.
Definition: iXrefItem.h:26

◆ GetInterface() [1/2]

static IXRefItem* GetInterface ( InterfaceServer is)
inlinestatic

Retrieves the IXRefItem interface from a scene entity.

Parameters
[in]is- Reference to scene entity
Returns
- Pointer to the IXRefItem interface of the scene entity or NULL if it's not an xref item
183  {
184  return static_cast<IXRefItem*>(is.GetInterface(IID_XREF_ITEM));
185  };
Generic interface that represents an xrefed scene entity.
Definition: iXrefItem.h:46

◆ GetID()

virtual Interface_ID GetID ( )
inlinevirtual
Remarks
This method overrides GetID() in those interfaces that do not publish metadata but instead have a unique Interface_ID for quick internal identification in implementation code that might be shared by a bunch of mixin interfaces.
Returns
The Interface_ID.
Default Implementation:
{ return GetDesc()->ID; }

Reimplemented from FPMixinInterface.

188 { return IID_XREF_ITEM; }

◆ PROP_FNS() [1/2]

◆ PROP_FNS() [2/2]

◆ RO_PROP_FN() [1/3]

RO_PROP_FN ( kfpGetXRefRecord  ,
GetXRefRecord  ,
TYPE_INTERFACE   
)

◆ RO_PROP_FN() [2/3]

RO_PROP_FN ( kfpIsUnresolved  ,
IsUnresolved  ,
TYPE_bool   
)

◆ RO_PROP_FN() [3/3]

RO_PROP_FN ( kfpIsNested  ,
IsNested  ,
TYPE_bool   
)

◆ FN_1() [1/4]

FN_1 ( kfpGetSrcItem  ,
TYPE_REFTARG  ,
GetSrcItem  ,
TYPE_bool   
)

◆ FN_1() [2/4]

◆ FN_1() [3/4]

◆ FN_1() [4/4]

◆ VFN_1()

VFN_1 ( kfpGetNodes  ,
FPGetNodes  ,
TYPE_INODE_TAB_BR   
)

◆ GetDesc()

virtual FPInterfaceDesc* GetDesc ( )
inlinevirtual
Remarks
Returns a pointer to the class which contains the interface metadata.

Implements FPInterface.

218 { return &mFPInterfaceDesc; }
static FPInterfaceDesc mFPInterfaceDesc
Definition: iXrefItem.h:219

◆ FPSetSrcFileName()

virtual void FPSetSrcFileName ( const MCHAR fileName)
protectedpure virtual

Gets file name of xref. Implemented by the system.

◆ FPGetSrcFileName()

virtual const MCHAR* FPGetSrcFileName ( )
protectedpure virtual

Gets file name of xref. Implemented by the system.

◆ FPSetSrcItemName()

virtual void FPSetSrcItemName ( const MCHAR itemName)
protectedpure virtual

Sets item name of xref. Implemented by the system.

◆ GetInterface() [2/2]

virtual BaseInterface* GetInterface
inline
595 { if (id == FPMIXININTERFACE_ID) return this; else return FPInterface::GetInterface(id); }
virtual BaseInterface * GetInterface(Interface_ID id)
Definition: ifnpub.h:142
#define FPMIXININTERFACE_ID
Definition: ifnpub.h:61

Member Data Documentation

◆ mFPInterfaceDesc

FPInterfaceDesc mFPInterfaceDesc
static