Material Editor Access

Topic: version 4 MAXScript Language Improvements / Material Editor, Material and Textures

Interface available for Texmap and Mtl, Interface: medit.

<maxObject>GetCurMtl()

This method returns a material base pointer for the current material.

<void>SetActiveMtlSlot <index>slot <boolean>forceUpdate

<index>slot

The material slot index.

<boolean>forceUpdate

Set this to TRUE to update the slot contents.

This method allows you to set the active material slot.

<index>GetActiveMtlSlot()

This method returns the index of the active material slot.

<void>PutMtlToMtlEditor <maxObject>mtl <index>slot

<maxObject>mtl

The material you want to put.

<index>slot

The index of the material slot you wish to put the material into.

This method allows you to put the specified material to the specified material editor slot.

<maxObject>GetTopMtlSlot <index>slot

<index>slot

The index of the material slot for which you wish to obtain the material.

This method returns a pointer to the material base from the specified slot.

<boolean>OkMtlForScene <material>mtl

<material>mtl

The pointer to the material.

This method is available in release 4.0 and later only. Before assigning material to scene, call this to avoid duplicate names.

<void>UpdateMtlEditorBrackets()

This method is available in release 3.0 and later only. It makes sure the Materials Editor slots correctly reflect which materials are used in the scene, which are used by selected objects, etc. This is used internally for the drag-and-drop of materials to nodes -- there is no reason why a plug-in developer should need to call it.

See also