This reference page is linked to from the following overview topics: XRef Scenes and Objects.
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 master 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.),
#include <iXrefItem.h>
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 Member Functions |
|
virtual Interface_ID | GetID () |
BEGIN_FUNCTION_MAP | 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
END_FUNCTION_MAP FPInterfaceDesc * |
GetDesc () |
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::AssetUser & |
GetSrcFile () const =0 |
Retrieves the file asset that the source
scene entity comes from. |
|
virtual const MCHAR * | GetSrcItemName () const =0 |
Retrieves the name of the source scene
entity. |
|
virtual ReferenceTarget * | GetSrcItem (bool resolveNested=false) const =0 |
Retrieves the source scene entity xrefed by
this xref item. |
|
virtual bool | IsUnresolved () const =0 |
Allows to verify whether the xref item is
unresolved. |
|
virtual IObjXRefRecord * | GetXRefRecord () const =0 |
Retrieves the xref record this xref item
belongs to. |
|
virtual void | GetNodes (INodeTab &xrefNodes) const =0 |
Retrieves the nodes associated with this
xref item. |
|
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. |
|
virtual unsigned int | GetChildItems (Tab< ReferenceTarget * > &childItems) const =0 |
Returns the list of every xref item for
which GetParentItem() would return 'this'. |
|
virtual unsigned int | GetRootItems (Tab< ReferenceTarget * > &rootItems) const =0 |
Retrieves the root (top-level) xref items of
this xref item. |
|
virtual bool | IsNested () const =0 |
Checks whether this xref item is a nested
one. |
|
Static Public Member Functions |
|
static bool | IsIXRefItem (InterfaceServer &is) |
Allows to determine whether a scene entity
implements this interface. |
|
static IXRefItem * | GetInterface (InterfaceServer &is) |
Retrieves the IXRefItem
interface from a scene entity. |
|
Static Public Attributes |
|
static FPInterfaceDesc | mFPInterfaceDesc |
Protected Member Functions |
|
Function Publishing methods
|
|
virtual void | FPSetSrcFileName (const MCHAR *fileName)=0 |
Sets file name of xref. Implemented by the
system. |
|
virtual const MCHAR * | FPGetSrcFileName ()=0 |
Gets file name of xref. Implemented by the
system. |
|
virtual void | FPSetSrcItemName (const MCHAR *itemName)=0 |
Sets item name of xref. Implemented by the
system. |
enum XRefItemType |
List of xref item types or categories of xref-able scene entities.
Use the following values when retrieving xref items from xref records.
{ kType_Object = 1<<0, kType_Material = 1<<1, // Xref controller type - Unsupported kType_Controller = 1<<2, kType_Atmospheric = 1<<3, kType_All = (kType_Object | kType_Material | kType_Controller | kType_Atmospheric), kType_All_No_Atmospherics = (kType_Object | kType_Material | kType_Controller), };
anonymous enum |
virtual const MaxSDK::AssetManagement::AssetUser& GetSrcFile | ( | ) | const [pure virtual] |
Retrieves the file asset that the source scene entity comes from.
virtual const MCHAR* GetSrcItemName | ( | ) | const [pure virtual] |
Retrieves the name of the source scene entity.
virtual ReferenceTarget* GetSrcItem | ( | bool | resolveNested =
false |
) | const [pure virtual] |
Retrieves the source scene entity xrefed by this xref item.
[in] | resolveNested | - If true, the method looks for the first non-xref source item. This could be a direct or indirect source item. |
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.
virtual IObjXRefRecord* GetXRefRecord | ( | ) | const [pure virtual] |
Retrieves the xref record this xref item belongs to.
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.
[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. |
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.
[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. |
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.
[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. |
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.
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. |
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.
static bool IsIXRefItem | ( | InterfaceServer & | is | ) | [inline, static] |
Allows to determine whether a scene entity implements this interface.
[in] | is | - Reference to scene entity |
{ return (is.GetInterface(IID_XREF_ITEM) != NULL); };
static IXRefItem* GetInterface | ( | InterfaceServer & | is | ) | [inline, static] |
Retrieves the IXRefItem interface from a scene entity.
[in] | is | - Reference to scene entity |
{ return static_cast<IXRefItem*>(is.GetInterface(IID_XREF_ITEM)); };
virtual Interface_ID GetID | ( | ) | [inline, virtual] |
Reimplemented from FPMixinInterface.
{ return IID_XREF_ITEM; }
BEGIN_FUNCTION_MAP 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 END_FUNCTION_MAP FPInterfaceDesc* GetDesc | ( | ) | [inline, virtual] |
Implements FPInterface.
{ return &mFPInterfaceDesc; }
virtual void FPSetSrcFileName | ( | const MCHAR * | fileName | ) | [protected, pure virtual] |
Sets file name of xref. Implemented by the system.
virtual const MCHAR* FPGetSrcFileName | ( | ) | [protected, pure virtual] |
Gets file name of xref. Implemented by the system.
virtual void FPSetSrcItemName | ( | const MCHAR * | itemName | ) | [protected, pure virtual] |
Sets item name of xref. Implemented by the system.