View Full Version : How to create joint "rotateOrder" style button in a UI?
02-23-2011, 11:47 AM
hi guys looking for a way to create a control in an UI similar to the one found in the attr editor of the joint the one call "draw Style" or "rotateOrder", one where I can click on and have a list appear in which I can choose. Can't get my head around this simple thing..I tried searching in the AE template of joint but found nothing..sorry if it sound like a noob question.
Joint is just the exemple for the style of button I need.
thanks a lot.
02-23-2011, 11:59 AM
optionMenuGrp control, while there is an example in the docs, I found it to be tricky to add/remove stuff from that list, so here is an example how I do it
// Use a global string to find your option menu later
global string $popChar;
// create the optionMenuGrp control
$popChar = `optionMenuGrp -cw2 100 100 -label "current Character" -columnWidth 2 80`;
// Add stuff to the list
menuItem -label "No Character" -parent ($popChar + "|OptionMenu") ;
menuItem -label "Homer" -parent ($popChar + "|OptionMenu") ;
menuItem -label "Bart" -parent ($popChar + "|OptionMenu") ;
Depending on what you want, there is also the
attrEnumOptionMenu control, so I hope that helps...
02-23-2011, 02:56 PM
great my friend, will test all that!! thanks a lot seriously I was stuck!! :)
how many beers do I own you already? :)
02-23-2011, 03:59 PM
Not a single, but I would take one anyway ; )
02-23-2011, 04:00 PM
after exploring that for an hour or so, it seems that it won't do what I want, cause it's not meant obviously to create list of dynamic object and being able to change them on the fly :/ too bad would have been nice in the Ui, I'll stay with a good old textScrollList. thanks for the help though.
02-23-2011, 04:01 PM
sending you a pack of fresh one right away :)
02-23-2011, 04:08 PM
It is a little bit tricky to maintain it, but certainly doable, sorry to hear it`s not working for you. Feel free to post more specific info on your task, then maybe we can help you.
02-23-2011, 04:22 PM
well actually what I meant to do with it was that it give me the name of specific "sets" of object that are in the scene, set that of course are not always the same because they are imported and deleted as being use, I found that it would be easier to read than a textScrollList to be able to select the sets I wanted to do something with.
not sure it's clear :)
02-23-2011, 07:27 PM
I think that is doable, what you probably need is:
- a GUI where that thing resides
- a proc that updates the list
- something that triggers the update of the list ( like a callback for example)
- a proc that does something when the user changes the selection in the optionMenu
If you want to have only certain objects in the list, what I like to do is mark them with some attribute.
I hope that helps a little bit : )
02-24-2011, 09:48 AM
thanks for heads up, but using a callBack I don't really see how at this point,(doesn't the callback work only with middle mouse button?) + I can't find a way to remove the menu item without killing the optionMenuGrp above it, Iguess I must overlook something but it seems weird to do that.
Spend enough time trying to figure that out so I guess I wil stay with what I know, I've never been good at writting UI anyway.
thanks a lot for the info
02-24-2011, 09:48 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.