This works for the first 8 subtools in the list (as long as I haven’t scrolled down). It doesn’t work on any other subtool. Why? I believe it has something to do with SubToolGetActiveIndex.
I’m stumped. Thanks.
//Create button[IButton,"PolyPnt Sel","Toggle PolyPaint On/Off for ACTIVE subtool",
[IFreeze,
[IShowActions,0]
//Create variable for polypaint state (On or Off?)
[VarDef,ppStateSel,0]
//Create variable to store currently selected subtool
[VarSet,activeSubT,[SubToolGetActiveIndex]]
//Put polypaint state/value into variable
[VarSet,ppStateSel,[IModGet,[StrMerge,"Tool:Subtool:Subtool ",#activeSubT]]]
//If on, turn off ... If off, turn on
[If,ppStateSel = 25, //Vis On,PP On
[IUnPress,Tool:Polypaint:Colorize] //turn PP off
]
[If,ppStateSel = 17, //Vis On,PP Off
[IPress,Tool:Polypaint:Colorize] //turn PP On
]
[If,ppStateSel = 9, //Vis Off,PP On
[IUnPress,Tool:Polypaint:Colorize] //turn PP Off
]
[If,ppStateSel = 1, //Vis Off,PP Off
[IPress,Tool:Polypaint:Colorize]
]
]//end freeze
[IShowActions,-1]
,,.5
]//end PP Toggle button