Hi all
my question may be a little silly, but failed to find an answer, on the internet or the 3ds max manual.
what I want is to assign a keyboard shortcut to navigate between the different levels in the modifier stack, I want to clarify that I do not mean to navigate between subobjects levels (1,2,3,4,5) but to navigate between different modifiers.
I have looked at the customize shortcut list within 3ds max, but I fail to know which or if there is one for this.
I really apreciate the help (I attach an image to clarify my question)
Hi, I used to have the same issue with instanced modifiers. Finally I found some solution. So far is working only with single selected object. I'll add multi-selection later.
[code]
macroScript modifier_stack_jump
category:"Pixamoon"
toolTip:"Jump to lower Modifier"
(
if getCommandPanelTaskMode() == #modify then
(
if selection.count == 1 then
(
selectedObj= $
a = modPanel.getCurrentObject()
if a != selectedObj.baseobject then
(
b = modPanel.getModifierIndex selectedObj a
try(modPanel.setCurrentObject selectedObj.modifiers[b+1])catch(modPanel.setCurrentObject selectedObj)
)
else
(
deselect
select selectedObj
)
)
else
print "Select only 1 object"
)
else setCommandPanelTaskMode mode:#modify
)
[/code]
I add also automatic jump to Modify Tab in Command Panel if other Tab is curently selected.
Hope it work for you as well.
Przemek
Ah, this one works only if there is one modifier instanced -> the lowest one. If there is more in the middle it do the same issue 😞 sorry
ok, it should works now.
[code]
macroScript modifier_stack_jump
category:"Pixamoon"
toolTip:"Jump to lower Modifier"
(
if getCommandPanelTaskMode() == #modify then
(
if selection.count == 1 then
(
selectedObj= $
a = modPanel.getCurrentObject()
if a != selectedObj.baseobject then
(
b = modPanel.getModifierIndex selectedObj a
try(modPanel.setCurrentObject selectedObj.modifiers[b+1] node:selectedObj)catch(modPanel.setCurrentObject selectedObj node:selectedObj)
)
else
(
deselect
select selectedObj
)
)
else
print "Select only 1 object"
)
else setCommandPanelTaskMode mode:#modify
)
[/code]
Threre is still one issue: when 2 or more instance modifiers are on the same object/node. Than is jumping to higher one on the stack. I'll work on it later, but I think can be very rare situation. What you think ?
Przemek
Hi again. I have a lot of modeling recently and had this annoying issue so many times. (when instanced Turbosmooth UVMap etc).
This one should fix also the issue with instanced modifiers on the same object (for example: Turbosmoth 1 than Noise/Edit Poly and instanced same Turbosmoth)
+ fixed problem with jumping to othe node/object
+ looping to top modifier when it gets to the bottom (base object) - so there can be just 1 shortcut and it loops over
macroScript modifier_stack_jump
category:"Pixamoon"
toolTip:"Jump to lower Modifier"
(
global pxModIndex
global pxObj
if getCommandPanelTaskMode() == #modify then
(
if selection.count == 1 then
(
selectedObj= $
a = modPanel.getCurrentObject()
if a != selectedObj.baseobject then
(
b = modPanel.getModifierIndex selectedObj a
if pxObj == selectedObj then pxModIndex += 1 else
(
pxObj = selectedObj
pxModIndex = b + 1
)
try(modPanel.setCurrentObject selectedObj.modifiers[pxModIndex] node:selectedObj)catch(modPanel.setCurrentObject selectedObj node:selectedObj)
)
else
(
deselect
pxObj = undefined
select selectedObj
)
)
else
print "Select only 1 object"
)
else setCommandPanelTaskMode mode:#modify
)
Let me know it works for you.
I apologize for the late review.. I finally ran the script and it surely does the job!
I only noticed a minor misbehavior or rather not even this. Just a tiny confusion in terms of usability. I'm not sure, though, that I've followed its pattern. And maybe I would, if i had a careful look at the script, but anyway, I think I noticed the following cases. (Let's call it "jump into" a modifier, when the modifier has been selected by applying the script and "mouse-select" a modifier, when it is selected by clicking with the mouse (or maybe the other shortcuts).)
Case 1.One object involved: It seems that the last modifier we jumped into is kept in memory. If we then mouse-select another modifier and then jump into the next, not the one lower than the mouse-selected modifier will be highlighted, but the one lower than the last we jumped into.
E.g. modifier stack from base to higher level:
Box -> (a)Edit Mesh -> (b)Edit Poly -> (c)Smooth -> (d)UVW
Actions:
jump, jump (we end in (b)),
mouse-select (c), jump (we end in (a), not in (b))
Case 2.Two or more objects involved: If we select an object and jump into a mod. We then select another object, we don’t jump there (ha, it gets funny:)), we select again the first object and mouse-select any random modifier there and we jump. The result would be: not the one lower than the randomly mouse-selected mod. is selected, but that lower than the one we jumped into before.
E.g. Object A: modifier stack from base to higher level:
Box -> (a) -> (b) -> (c) -> (d)
Object B: modifier stack from base to higher level:
Sphere -> (a) -> (b) -> (c)
Actions:
Select Obj A,
jump, jump (we end in (b)),
select Obj B,
(we may mouse-select a modifier but no jumping there),
select Obj A,
mouse-select (c), jump (we end in (a), not in (b))
Case 3.With two or more objects involved. However, when we have an object selected and we have jumped into a mod. there. If we then select a new object and we jump into a mod. and finally turn back to the originally selected object, the memory thing is somehow reset (or actually replaced by the latest jump). Anymore, once activated, the jumping script will either start from the top mod jumping downwards or will start from a mod. we have mouse-selected and continue downwards from there. If we further mouse-select another mod. and try to jump, we end in the 1st case.
I am sorry for my English and the resulting confusing/weird/funny way I tried to explain the situation. Also for giving such a huge description for a small inconvenience.
Ha, thanks for testing and reporting! You're totaly right.
Yes it keeps the object and modifier position in memory. (the reason was to not jump to original/main instanced modifier on other object).
I see misbehaviors you wrote about them. I'll try to fix them soon.
Thanks !
Hello again, I found a bit of time to play with it and so far I fixed some issues. (there was one more problem with reference divider but it should be fixed too. 🙂
macroScript modifier_stack_jump category:"Pixamoon" toolTip:"Jump to lower Modifier" -- modifier stack jump v0.37 ( global pxModIndex global pxObj global pxMod if getCommandPanelTaskMode() == #modify then ( if selection.count == 1 then ( selectedObj= $ a = modPanel.getCurrentObject() if a != selectedObj.baseobject then ( try(b = modPanel.getModifierIndex selectedObj a)catch() if pxObj == selectedObj and pxMod == a then pxModIndex += 1 else ( pxObj = selectedObj pxModIndex = b + 1 ) try(modPanel.setCurrentObject selectedObj.modifiers[pxModIndex] node:selectedObj)catch(modPanel.setCurrentObject selectedObj node:selectedObj) ) else ( pxModIndex = 1 try(modPanel.setCurrentObject selectedObj.modifiers[1] node:selectedObj)catch() ) pxMod = modPanel.getCurrentObject() ) else print "This shortcut works only 1 selected object" ) else setCommandPanelTaskMode mode:#modify )
There is still problem with instanced modifiers in one object. (only if you select another of them by mouse) But this one I will try to fix when I find more time.
Let me know how does it work.
Hi,
Script is avaialble to download now on http://www.scriptspot.com/3ds-max/scripts/modifier-stack-jump-and-loop