MAXScript Language Reference > 3ds Max Objects > Interfaces > Core Interfaces > Core Interfaces Documentation > M >

# Interface: medit

Interfaces > Core Interfaces > medit

| Core Interfaces - Quick Navigation

The medit Core Interface is available for Texture maps and Materials and exposes the Material Editor slots to MAXScript.

Methods:

    <maxObject>medit.GetCurMtl()

This method returns the material currently selected in one of the 24 sample slots of the Material Editor.

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

This method allows you to set the active material slot, where

The first (index) argument is the material slot index, range from 1 to 24.

The second (boolean) argument controls whether to update the slot contents or not.

    <index>medit.GetActiveMtlSlot()

This method returns the index of the active material slot.

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

This method allows you to put the specified material to the specified material editor slot, where

The first argument is the material to put in the editor's slot.

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

FOR EXAMPLE
    MatEditor.Open() --open the material editor.
    theMat = multiMaterial numsubs:5 --create a new material
    medit.PutMtlToMtlEditor theMat 3 --add it to slot 3
    medit.SetActiveMtlSlot 3 true --set slot 3 as the active slot

    <maxObject>medit.GetTopMtlSlot <index>slot

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

    <boolean>medit.OkMtlForScene <material>mtl

Before assigning material to scene, call this method to avoid duplicate names.

Available in 3ds Max 4 and higher.

    <void>medit.UpdateMtlEditorBrackets()

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 developer should need to call it.

Available in 3ds Max 3 and higher.

#### See Also

- Material Editor

- BitmapTex Reload and viewImage