MAXScript Language Reference > 3ds Max Objects > Material : MAXWrapper >

# Material Common Properties, Operators, and Methods

Value > MAXWrapper > Material

| Materials and Maps - Quick Navigation

Properties

    <material>.name

All the material subclasses can access the name property and specify it as a constructor parameter.

    <material>.effectsChannel

All the material subclasses can access the effectsChannel property and specify it as a constructor parameter.

    <material>.showInViewport

Accesses the material-level show-in-viewport state, which can also be set on a material constructor call using the showInViewport : parameter.

EXAMPLE
    b=box()
    b.material = standard diffuseMap:(checker()) showInViewport:true

Methods

    assignNewName <material>

Modifies the name of the specified material to make it unique. The name is of the form "Material #1" where the number is incremented as required to make ensure it’s unique.

    okMtlForScene <material>

Tests the material name against other material names in the scene, and returns true if there are no other materials with the same name, false otherwise. Before assigning material to scene, call this to avoid duplicate names.

    getMTLMEditFlags ( <material> | <texture> ) setMTLMEditFlags ( <material> | <texture> ) <bitarray>

Get and set the MEdit options for the specified material or texture as a <bitarray>. If a bit is on, the corresponding option is turned on. The order of the bits is: #{MTL_BEING_EDITED,BACKGROUND,BACKLIGHT,VIDEO_COLOR_CHECK}

The first bit is set if the rollout for the specified material or texture is currently displayed in the active MEdit slot. The state of this bit is ignored in setMTLMEditFlags().

    getMTLMeditObjType ( <material> | <texture> ) setMTLMeditObjType ( <material> | <texture> ) <integer>

Get and set the MEdit sample object type for the specified material or texture. The valid values are: 1 - sphere; 2 - cylinder; 3 - cube; 4 - custom

    getMTLMeditTiling ( <material> | <texture> ) setMTLMeditTiling ( <material> | <texture> ) <integer>

Get and set the MEdit tiling type for the specified material or texture. The valid values are: 1 - 1x1; 2 - 2x2; 3 - 3x3; 4 - 4x4

    updateMTLInMedit ( <material> | <texture> )

Performs a set of 3ds Max notifications that forces an update of the material or texture throughout 3ds Max, including the MEdit and material browser.

You can get and set Material Editor materials using the getMeditMaterial() and setMeditMaterial() functions. You can also get a material from the Material Editor using the editMaterials virtual array. See Material Editor and MaterialLibrary Values for more information.

The following methods are available in 3ds Max 6 and higher:

    getNumSubMtls <material>

This method returns the number of sub materials for the material.

    getSubMtl <material> <index>

This method returns the indexed sub material of the material.

    setSubMtl <material> <index> <material>

This method sets the indexed sub material of the material to the specified material.

    getSubMtlSlotName <material> <index>

This method returns the slot name of the indexed sub material of the material.

    getNumSubTexmaps (<material> | <texture>)

This method returns the number of sub textures for the material or texture.

    getSubTexmap (<material> | <texture>) <index>

This method returns the indexed sub texture of the material or texture.

    setSubTexmap (<material> | <texture>) <index> <texture>

This method sets the indexed sub texture of the material or texture to the specified texture.

    getSubTexmapSlotName (<material> | <texture>) <index>

This method returns the slot name of the indexed sub texture of the material or texture.

#### See Also

- MAXWrapper Common Properties, Operators, and Methods

- Value Common Properties, Operators, and Methods