3ds Max C++ API Reference
IGameScene Class Referenceabstract

Main scene access. More...

#include <IGame.h>

+ Inheritance diagram for IGameScene:

Public Member Functions

virtual ~IGameScene ()
 Destructor. More...
 
virtual void SetPropertyFile (const MCHAR *fileName)=0
 Set the Property File to use. More...
 
virtual bool InitialiseIGame (bool selected=false)=0
 Initialise IGame. More...
 
virtual bool InitialiseIGame (INode *root, bool Hierarchy=true)=0
 Initialise IGame with a specific node. More...
 
virtual bool InitialiseIGame (Tab< INode * > nodes, bool Hierarchy=true)=0
 Initialise IGame with a specific set of nodes. More...
 
virtual const MCHARGetSceneFileName ()=0
 Get the active filename. More...
 
virtual void SetStaticFrame (int frameNum)=0
 Set the static frame. More...
 
virtual TimeValue GetSceneStartTime ()=0
 Get the start of the animation range. More...
 
virtual TimeValue GetSceneEndTime ()=0
 Get the end of the animation range. More...
 
virtual int GetSceneTicks ()=0
 Get the number of ticks per frame. More...
 
virtual int GetTopLevelNodeCount ()=0
 All node access is provides by parent nodes. More...
 
virtual int GetTotalNodeCount ()=0
 Get the complete number of nodes. More...
 
virtual IGameNodeGetTopLevelNode (int index)=0
 Get the actual toplevel node. More...
 
virtual int GetRootMaterialCount ()=0
 Get the total number of parent materials. More...
 
virtual IGameMaterialGetRootMaterial (int index)=0
 Access to the Root Material. More...
 
virtual IGameNodeGetIGameNode (INode *node)=0
 Access the IGameNode from the supplied INode. More...
 
virtual IGameNodeGetIGameNode (ULONG NodeID)=0
 Access the IGameNode from the supplied Node ID. More...
 
virtual Tab< IGameNode * > GetIGameNodeByType (IGameObject::ObjectTypes Type)=0
 Access the set IGameNodes from the specified IGame Type. More...
 
virtual IGameMaterialGetIGameMaterial (Mtl *mat)=0
 Access the IGameMaterial from the supplied Mtl. More...
 
virtual IGameTextureMapGetIGameTextureMap (Texmap *texMap)=0
 Access the IGameTextureMap from the supplied Texmap. More...
 
virtual void ReleaseIGame ()=0
 Releases IGame and free all associated memory. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

Main scene access.

IGameScene is the main entry point for an exporter. It contains the initialisation routines and access to the nodes and materials of the scene. The user can ask IGame to enumerate the whole scene, selected nodes or single nodes, with or with out hierarchy.

Constructor & Destructor Documentation

◆ ~IGameScene()

virtual ~IGameScene ( )
inlinevirtual

Destructor.

175 {;}

Member Function Documentation

◆ SetPropertyFile()

virtual void SetPropertyFile ( const MCHAR fileName)
pure virtual

Set the Property File to use.

You can define the name of the file to use, including full path, that IGame uses to parse for the supported parameters. This means that you could have multiple configs depending on the various games in development. You must call this before you call InitialiseIGame(). By default the the filename will be the maxroot/plugcfg/IGameProp.XML.

Parameters
fileNameThe name of the property file to use inthis session.

◆ InitialiseIGame() [1/3]

virtual bool InitialiseIGame ( bool  selected = false)
pure virtual

Initialise IGame.

IGame can be initialised specifying whether to search for selected nodes only

Parameters
selectedTrue if selected are searched for - default false
Returns
True if the scene was enumerated - A Possible reason for failure is that the Parameter IGameProp.XML file was not found or not parsed correctly

◆ InitialiseIGame() [2/3]

virtual bool InitialiseIGame ( INode root,
bool  Hierarchy = true 
)
pure virtual

Initialise IGame with a specific node.

Developer can specify a single node to parse.

Parameters
rootThe actual node to parse
Hierarchylets IGame know to initialise the children of the node
Returns
True if the scene was enumerated - A Possible reason for failure is that the Parameter IGameProp.XML file was not found or parsed correctly

◆ InitialiseIGame() [3/3]

virtual bool InitialiseIGame ( Tab< INode * >  nodes,
bool  Hierarchy = true 
)
pure virtual

Initialise IGame with a specific set of nodes.

Developer can specify a set of nodes to parse. This could be implemented by creating a Tab using the 3ds Max sdk. Look at Interface::GetSelNodes() and Interface::GetSelNodeCount().

Parameters
nodesThe actual tab containing the nodes to parse
Hierarchylets IGame know to initialise the children of the node
Returns
True if the scene was enumerated - A Possible reason for failure is that the Parameter IGameProp.XML file was not found or parsed correctly

◆ GetSceneFileName()

virtual const MCHAR* GetSceneFileName ( )
pure virtual

Get the active filename.

Returns
The current filename

◆ SetStaticFrame()

virtual void SetStaticFrame ( int  frameNum)
pure virtual

Set the static frame.

Specify the frame to use for Time access functions

Parameters
frameNumThe static frame to use - Internally this will be converted to Ticks

◆ GetSceneStartTime()

virtual TimeValue GetSceneStartTime ( )
pure virtual

Get the start of the animation range.

This provides the animation start time in ticks

Returns
The start time in ticks

◆ GetSceneEndTime()

virtual TimeValue GetSceneEndTime ( )
pure virtual

Get the end of the animation range.

This provides the animation end time in ticks

Returns
The end time in ticks

◆ GetSceneTicks()

virtual int GetSceneTicks ( )
pure virtual

Get the number of ticks per frame.

Returns
The number of ticks per frame

◆ GetTopLevelNodeCount()

virtual int GetTopLevelNodeCount ( )
pure virtual

All node access is provides by parent nodes.

This does not include the Root node as in 3ds Max. This method can be used to traverse the scene

Returns
The number of parent nodes

◆ GetTotalNodeCount()

virtual int GetTotalNodeCount ( )
pure virtual

Get the complete number of nodes.

The is useful for implementing a progress bar in the exporter

Returns
The total node count

◆ GetTopLevelNode()

virtual IGameNode* GetTopLevelNode ( int  index)
pure virtual

Get the actual toplevel node.

A Top level node is a node at the top of the Hierarchy, i.e it has no Parent.

Parameters
indexThe index into the the toplevel parent list
Returns
A pointer to a IGameNode
See also
IGameNode

◆ GetRootMaterialCount()

virtual int GetRootMaterialCount ( )
pure virtual

Get the total number of parent materials.

This does not include sub materials - just the number of actual material containers

Returns
The total number of parent materials

◆ GetRootMaterial()

virtual IGameMaterial* GetRootMaterial ( int  index)
pure virtual

Access to the Root Material.

This is the parent material that is stored on the Node. The material will host any sub materials and access is provided by the IGameMaterial interface.

Parameters
indexThe root material to access
Returns
A Pointer to an IGameMaterial
See also
IGameMaterial

◆ GetIGameNode() [1/2]

virtual IGameNode* GetIGameNode ( INode node)
pure virtual

Access the IGameNode from the supplied INode.

Some IGame methods provide access to INode lists. You can use this method to retrieve the IGameNode equivelent IGame must be initialised first, as the node must be in the Database

Parameters
nodeThe 3ds Max node to find
Returns
A pointer to IGameNode, NULL if not found

◆ GetIGameNode() [2/2]

virtual IGameNode* GetIGameNode ( ULONG  NodeID)
pure virtual

Access the IGameNode from the supplied Node ID.

You can use this method to retrieve the IGameNode based on a Node ID IGame must be initialised first, as the node must be in the Database

Parameters
NodeIDThe Node ID to find
Returns
A pointer to IGameNode, or NULL if not found

◆ GetIGameNodeByType()

virtual Tab<IGameNode*> GetIGameNodeByType ( IGameObject::ObjectTypes  Type)
pure virtual

Access the set IGameNodes from the specified IGame Type.

You can use this method to retrieve the IGameNode based on IGameObject::ObjectTypes. IGame must be initialised first, as the node must be in the Database

Parameters
TypeThe IGameObject::ObjectTypes to find
Returns
A Tab of IGameNodes. The developer should check the Count() method to see if any were found

◆ GetIGameMaterial()

virtual IGameMaterial* GetIGameMaterial ( Mtl mat)
pure virtual

Access the IGameMaterial from the supplied Mtl.

You can use this method to retrieve the IGameMaterial equivelent IGame must be initialised first, Material doesn't have to be part of database

Parameters
matThe 3ds Max Material
Returns
A pointer to IGameMaterial

◆ GetIGameTextureMap()

virtual IGameTextureMap* GetIGameTextureMap ( Texmap texMap)
pure virtual

Access the IGameTextureMap from the supplied Texmap.

You can use this method to retrieve the IGameTextureMap equivelent IGame must be initialised first, Texture doesn't have to be part of database

Parameters
texMapThe 3ds Max Texture Map
Returns
A pointer to IGameTextureMap

◆ ReleaseIGame()

virtual void ReleaseIGame ( )
pure virtual

Releases IGame and free all associated memory.

This must be called after you have finished with IGame. It makes sure all data is freed and general clean up is performed. Without calling this there is the risk of corrupting memory, and causing incorrect data to returned the next time IGame is run