Skip to content

Instantly share code, notes, and snippets.

@Arahnoid
Last active April 21, 2019 23:16
Show Gist options
  • Save Arahnoid/fe302b0f317cb133f5f1 to your computer and use it in GitHub Desktop.
Save Arahnoid/fe302b0f317cb133f5f1 to your computer and use it in GitHub Desktop.
[Togle material in viewport] #3dmax
-- by Denis Trofimov
-- http://forums.cgsociety.org/showthread.php?f=98&t=1316990&page=2
macroScript MaterialDisplayToggle
category:"Display"
toolTip:"Viewport Material Display Toggle"
buttontext:"Mat Toggle"
autoUndoEnabled:off
(
local act = off
on isChecked do act -- optional
on isEnabled do geometry.count > 0 -- optional
on execute do undo "Material Display Toggle" on
(
act = not act
for node in geometry where node.mat != undefined do showTextureMap node.material act
completeredraw() -- in case if render meshes cached it needs forcing redraw
updateToolbarButtons() -- update state of macro button
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment