ScriptSpot

Forum topic · General Scripting

strange bug

By roosterMAP · 2012-09-07

Description

hello. I have this script that lets me navigate through my modifyer stack with a hotkey. Bellow is the source code for it.
The problem is that when I reach the bottom of the stack, and the "try" fails, in order for my "catch" to work, max requires me to move the camera (click and drag middle mouse button). I dont want to have to move the cam every time the selection reaches the bottom of the stack.
I've tried adding a redrawviews(), but that doesn't work.

Plz help. Im out of ideas!

(
try
(
i = modPanel.getModifierIndex $ (modPanel.getCurrentObject())
)
catch
(
--reached root
i = 999
print i
)
if(i<$.modifiers.count) then
(
--next
i=i+1
modPanel.setCurrentObject $.modifiers[i]
)
else if(i==999) then
(
--back to top
i = 1
modPanel.setCurrentObject $.modifiers[i]
)
else
(
modPanel.setCurrentObject $.baseObject
)
)

Comments (2)

barigazy · 2012-09-07

I don't undertand what do you want to achive.
Post some screenshots.