What is wrong with this script? (Toggle SliderBar color)
Im checking if the timeSliderBar is gray, if it is, do script A and turn it blue...but if its blue, then do script B and color it gray:
if (colorMan.getColor #timeSliderBg == [0.2, 0.2, 0.2])then
(
actionMan.executeAction 1937596344 "8" -- dRaster: Maya Style Navigation (Toggle)
macros.run "Tools" "SmartScale"
macros.run "DaveTools" "DaveTools_SubObjectModeToggle"
colorMan.setColor #timeSliderBg[0.0, 0.0, 0.6]
colorMan.repaintUI #repaintTimeBar
)
else if (colorMan.getColor #timeSliderBg == [0.0, 0.0, 0.6])then
(
actionMan.executeAction 1937596344 "8" -- dRaster: Maya Style Navigation (Toggle)
macros.run "Tools" "SmartScale"
macros.run "DaveTools" "DaveTools_SubObjectModeToggle"
colorMan.setColor #timeSliderBg[0.2, 0.2, 0.2]
colorMan.repaintUI #repaintTimeBar
)
Comments
Try this: -- if the color is
Try this:
Tools and Scripts for Autodesk 3dsMax
Now I get it!!
Thanks, I see what I did wrong...this will help me a lot to do my own scripts now!
Back to reading the manual :)
I use dark color scheme for
I use dark color scheme for max2009.
When I execute this line:
(colorMan.getColor #timeSliderBg == [0.2, 0.2, 0.2])
the returned result is FALSE
Then the script should go to this line:
if (colorMan.getColor #timeSliderBg == [0.0, 0.0, 0.6])then
but the returned result again is FALSE.
So there is nothing to execute, change or whatever.
:)
Tools and Scripts for Autodesk 3dsMax
So how would one do it?
Im not too familiar yet with maxscript's way of doing else/if's...Im reading the manual though!
If someone would be kind enough to show an example of how this could work, Im sure I can get a lot of info out of it!
Thnx,
David