MaxwellMayaMaterial class

Description

This is the abstract base class for materials. It allows you to handle materials in a uniform way and identify the concrete type of the underlying object through the GetMaterialType method.

Subclasses: MaxwellMayaEmbeddedMaterial, MaxwellMayaReferencedMaterial.

Methods

voidSetName(const MString& name)
MStringGetName() const
MaterialTypeGetMaterialType() const
MaxwellMayaMaterial*Copy() const
voidDestroy()

void SetName(const MString& name)

Sets the name of the material in the Maxwell scene.

MString GetName() const

Returns the name of the material.

MaterialType GetMaterialType() const

Returns the concrete type of the underlying Maxwell material. Can be one of:

  • MaterialType_Embedded: an embedded material. The parameters of this material are stored in the exported scene directly. The object can be cast to MaxwellMayaEmbeddedMaterial.
  • MaterialType_Referenced: this material is referenced from an external MXM file. The object can be cast to MaxwellMayaReferencedMaterial.

MaxwellMayaMaterial* Copy() const

Creates and returns a copy of the material.

void Destroy()

Removes the material from the Maxwell scene and destroys it. As explained here, this method does not destroy the API handle, so in C++ you must still call DeleteThis() when you are done with it (or let a smart pointer do it).