[Closed] Selectively display rollouts for custom attributes by current subobjectlevel
Hi,
Does anyone know how to selectively display rollouts for custom attributes based on what the current subobjectlevel is?
What I mean is this: If I add a custom attribute to an object that is to be a property of the whole object is there a way to not display the associated rollout when the user is in face or vertex mode?
sounds cool, but i think it may not be possible… i just tried this:
theCA = attributes test
(
parameters main rollout:main_rlt
(
)
rollout main_rlt "main"
(
button bla_btn "bla"
on main_rlt open do
(
if subObjectLevel == 1 then main_rlt.open = true else main_rlt.open = false
)
)
)
custAttributes.add $.baseObject theCA
this sort of works, but i’m only using the .open property (not sure you can hide the rollout completely, and i don’t think there’s a way to catch a switch in the subobject level, so this one only works when you switch from some other panel to the modify panel, that’s when the open handler gets called rollout
if you apply this to an editable poly baseobject and open the rollout, when you switch to another panel and then back to the modify panel, the rollout should close… so here’s something to get you started
Thanks, I’ll try working with that.
The code below works but caused wierd bugs when switching between tabs in the tool panel. Like, when the user clicked on modify it would automatically go to utillities !?!?
Maxscript makes my head hurt 🙁
fn removeRollouts =
(
if isproperty $ #my_option do
(
if subobjectlevel != 0 then
(
removerollout $.optionsRollout
)
else
(
addrollout $.optionsRollout
)
)
)
registerRedrawViewsCallback removeRollouts
The code below works but caused wierd bugs when switching between tabs in the tool panel. Like, when the user clicked on modify it would automatically go to utillities !?!?
i think the addrollout and removerollout functions are for utilities, so there’s your explanation for that
i’d be careful with viewport redraw callbacks too, although with the check you have in there it shouldn’t cause problems.