Last active
April 21, 2019 23:16
-
-
Save Arahnoid/fe302b0f317cb133f5f1 to your computer and use it in GitHub Desktop.
[Togle material in viewport] #3dmax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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