[Closed] Better SetSelectFilter check
I created a couple of toolbar buttons for picking a selection filter, and also visually shows you what is picked with pressed toolbar buttons.
Basically I have this code that works with no problem, for SetSelectFilter 1 to 7
on isChecked do (try(GetSelectFilter() == 7)catch())
on execute do
(
--filein (TiMScriptPath + "UI\Select_Filter_Warps.ms")
SetSelectFilter 7
)
Initially, I thought there were up to 11.
When I entered Combos, I noticed I could create permanent combos and the number sequence 8 and up changed. What previously was 8 was now something else.
So my question is if there is a better check to see what SelectFilter is currently on, otherwise set it, with the usage of their names instead.
This code shows you the Selection Filters by name
for i = 1 to GetNumberSelectFilters() do –go through all
format “%: %\n”i (GetSelectFilterName i) –print index and name –result:
Also, could you please help me with one more thing.
We might have a case with combos, or without combos. For example the combo LC stands for Lights and Cameras or GS for Geometry and Shapes.
Can you give please me an example code that checks IF there is a certain name at all- otherwise print “Option unavailable”. If you provide me an example, I can create multiple buttons for those combos I might want.
For example, I would check if “LC” does exist, then set that SelectionFilter, otherwise Print “Option unavailable”.
Why would I even create a button for an option I don’t have? I store my UI settings and use them on multiple computers. There is a chance that a particular Selection Filter doesn’t exist and I dont want my toolbar to break Max because of that.