Topic: version 4 MAXScript Language Improvements / Material Editor, Material and Textures
The showTextureMap() function has been updated to allow control over material level texture showing in the viewport. The full form is now:
showTextureMap <material> [<texmap>] <boolean>
If the optional <texmap> is supplied, it must be a direct subtexture of the supplied material and its show-in-viewport state will be set on or off according to the <boolean> argument. If only a <material> is supplied, its show-in-viewport state will be set by the <boolean> argument.
Example:
showTextureMap $foo.material on
showTextureMap $foo.material $foo.material.diffusemap off
Note: Mapping coordinates aren't explicitly enabled for the objects at creation time. When a script is run in the Listener, using 'showTextureMap' is indirectly turning mapping coordinates on. This happens during the scene redraw which happens after each line is executed, if needed. If a script is run from a script editor, or if you put parenthesis around a script, no scene redraw is performed until the entire script is run. Since no redraw is performed, no mapping coordinates exist on the object when the script tries to access them. Solutions: explicitly perform a scene redraw [redrawViews()] after 'showTextureMap', or explicitly turn on mapping coordinates for the object.
See also
TextureMap Common Properties, Operators, and Methods
Material Level Show-in-viewport State