Retrieving the Material from a Node
 
 
 

In 3ds Max there is only one material per node. In the INode class there are methods INode::GetMtl() and INode::SetMtl() that provide access to and allow changing of the node's material. INode::GetMtl() returns a pointer to an instance of class Mtl. If the value returned is NULL this means the user has not assigned a material to the node. In such a case the renderer uses the wire frame color of the node (as well as many defaults) for the rendering properties.

The material returned can be any material that may be assigned by the user. These include those from 3ds Max itself as well as those created by third party developers. One may look at the Class_ID of the material to determine its type. For example, the 3ds Max Standard material has a Class_ID of DMTL_CLASS_ID while a multi-material uses MULTI_CLASS_ID. Consult the C++ Reference's "Related Pages > Lists and Functions > List of Class IDs" to review the complete list provided by 3ds Max.