I have this bound to a hotkey and when I run it 3 times windows makes a "no" sound between the second and third button press. But then it will run on the forth press?
Any ideas? Any help would be very appreciated.
it just jumps between the top modifier and either last edit poly mod or base modifier.
local BaseSwitchSOL
if classof (modpanel.getcurrentobject()) == Editable_Poly or classof (modpanel.getcurrentobject()) == Edit_Poly then
(
BaseSwitchSOL = subobjectlevel
modPanel.setCurrentObject $.modifiers[1]
)
else
(
try
(
modPanel.setCurrentObject $.editpoly
subobjectlevel = BaseSwitchSOL
)
catch
(
modPanel.setCurrentObject $.baseObject
if BaseSwitchSOL != undefined then
(
subobjectlevel = BaseSwitchSOL
)
else
(
subobjectlevel = 0
)
)
)
Replies
Whenever I run it as a button I can hit the button a hundred times no problem. However the moment I run it through a hotkey, trying F and also tested Y, it gives me the "No!" sound as if I am not in the right window.
If I move the viewport each time inbetween the hotkey press it will work. This is kinda stupid Do I need to be setting the viewport to active or something?
so you would refresh the screen, but not actually change its focus
But your script works for me every time, as a button or hotkey.
I did take a crack at it too. It has a little extra error checking so there is no need for a try/catch.
!
That is strange. It works fine at work... Guess it is something with my setup at home? ugh!
Yeah haha! I don't know why but before I uploaded the code it was global. People always seem to get onto me for using globals so out of paranoia I switched it to local. BaseSwitchSOL is meant to remember the subobject level of the edit poly or editable poly so that it takes you back there when you switch back and forth.
Here is where I was at with the code when I went to bed last night. Monster I will be sure to tweak it up to implement the extra checks. Is try catch generally a bad idea or is it just showing me being lazy? lol I thought I read somewhere that it was slower but I have never really felt the impact of a try catch.
As always man thanks for the help.