[Closed] pop-up user interface?
hey
currently i’ve got all my rigging wired controllers, inside a custom user interface, held by an attribute holder modifier, on my main controller object. that will give me sliders and spinners right on the command pannel, but i was wondering, how to put all that inside a whole custom new window?
also, what would be the best way to pop up that window? a button on my attribute holder maybe? or a macroscript button?
last thing, is it possible to assign a scripted button to hide/show objects? for example, a character with a hat, i open my controllers interface, and theres a hat section, with an on/off button, and when its off, it wont show on viewport or render, well, pretty much like hiding the object. possible?
thanks in advance!
You can simply do createDialog of any scripted rollout either in a custom attribute or a scripted modifier. I have such a button in another rollout in the same tool.
Hiding objects is really that, hiding the objects, make sure you have a array of nodes that define the hat and simply loop over them setting the obj.isHidden = true.
Hope this helps,
-Johan
last thing, is it possible to assign a scripted button to hide/show objects? for example, a character with a hat, i open my controllers interface, and theres a hat section, with an on/off button, and when its off, it wont show on viewport or render, well, pretty much like hiding the object. possible?
I wrote an article about this (quite a while back now!) on how to use weak references to nodes.There is an example to download showing how you can implement a hide/show visibilty system on a character’s custom attribute.
read it here – http://lonerobot.net/?p=158
thanks mate!
it does help, well kinda, becoz my maxscript knowledge is limited, so…
CustAttributes.getDef $.modifiers[1].buttonroll
attributes buttonroll
redefine:ca
(
rollout roll "Button"
(
button popupbut "Popup"
on popupbut pressed do
(
createdialog poproll width:200 height:200 menu:popmenu
)
)
)
--custAttributes.add $.modifiers[1] ca
so what next? lol
ok, i made a quick macroscript, to have a window poped from a ui button, but thats it, and i dont know how to wire anything to that.
also, i cant manage to have a button right off the attribute holder to pop up the same window.
heres what i got so far:
macroScript vizble category:"Rafael"
(
try(destroyDialog visible)catch()
rollout visible "Hide or show object" width:160 height:36
(
group "Visibility"
(
checkbutton visb "Hide/Show"
)
)
createdialog visible width:220 height:55
)
and my failed attempt to pop it from an attribute holder:
--CustAttributes.getDef $.modifiers[1].bodyControls
ca=attributes bodyControls
--redefine:ca
(
rollout buttoni "Button"
(
button click "PopUp"
)
on click pressed do
(
rollout visible "Hide or show object" width:160 height:36
(
group "Visibility"
(
checkbutton visb "Hide/Show"
)
)
createdialog visible width:220 height:55
)
)
custAttributes.add $.modifiers[1] ca
any help appreciated since i fail at this as you can see
ca = attributes bodyControls
(
rollout roBodyControls "Button"
(
button btnPopup "PopUp Toggle"
on btnPopup pressed do
(
if roBodyControls.inDialog then
(
max create mode
destroyDialog roBodyControls
max modify mode
) else (
max create mode
createDialog roBodyControls
max modify mode
)
)
)
)
custAttributes.add $.modifiers[1] ca
For the popup,
-Johan
thats it johan, thanks
but just one thing
that will pop up the actual rollout that is displayed on the attribute holder
is it possible to pop up a different interface, for example, put on the attribute holder, just the button, and when you press it, open a whole new ui?
ca = attributes bodyControls
(
-- Create a function that returns a rollout
fn getFloatingRollout =
(
rollout roPopMe "Pop Me"
(
button btnPop "Pop me"
on btnPop pressed do
(
destroyDialog roPopMe
)
)
)
-- the CA rollout
rollout roDontPopMe "Don't Pop Me"
(
button btnPopup "Pop Him"
on btnPopup pressed do
(
-- call the function to get the rollout and create a floating dialog
createDialog (this.getFloatingRollout())
)
)
)
custAttributes.add $.modifiers[1] ca
Something like that?
-Johan