PDA

View Full Version : custattributes+ floater rollout


shalabology
04-24-2009, 12:29 PM
i am involved in rigging i am working on building ui and what i am trying to do is:

adding custattributes on an object which includes a button what i want is when pressing this button a floater will emerge i did it but couldnt have tracks for spinners and buttons in the floter herer what i wrote

ca=attributes tota
(
parameter param rollout:cons
(pressbut type:#floater ui:btn)

rollout cons "total collection"
(button btn "...."
on btn pressed do
(rollout ntnt "tete"
spinner ........
slider ............
button .....)
new=newrolloutfloater ....
addrolloutfloater ........ )


)

custattributes.add $.modifiers[1] ca


i tried to add parameters block in many oppos but invain always error messages

i hope you could get what i mean, i am in dire need for help!

shalabology
04-26-2009, 07:38 PM
hey guys, is my question isn t clear or is it repeated? i really wnat to know coz i really need the answer

Kameleon
04-26-2009, 09:17 PM
Hi, I never worked with CA's but I think I've managed to get what you want, look at the example code and see if that helps. Cheers.

ca=attributes tota
(
parameters main rollout:cons
(
pressbut type:#string ui:btn_main
)
rollout cons "total collection"
(
button btn_main "...."

on btn_main pressed do
(
rollout test "test"
(
spinner spn_test "test"
slider sld_test "test"
button btn_test "test"
)
createdialog test
)
)
)
custattributes.add $Sphere01 ca

shalabology
04-26-2009, 10:42 PM
Kameleon , that was almost what i wrote for my script except it was a floater the issue was only to have parameters for the ui items in the floater like spinner.....etc
in other words try after evaluating the code you wrote to wire any of the parameters of the spinner you will not prpmted for any!
i hope that will be declaring what i need coz i am in real dire need for it by the way thank you very much for your collection of dot net.mxsc files i hope get more coz .net is confusing me and i really hope to get grasp on its items and contrls the same way that mxscript documents demos

ZeBoxx2
04-27-2009, 04:39 AM
haven't tested, but try the method outlined here:
http://forums.cgsociety.org/showthread.php?t=752318 - How to control Custom Attributes?

shalabology
04-27-2009, 09:36 AM
richard thats ok , but didnt solve it all what if iwant to close that rollout before it open in otherwords i dont wnt the rollout to be displayed except after pressing that button .
i tried dstroydialog everywhere but invain the roolout still appear in the stack .
i will reitrate what i exactly want:

-attributeholder with single button , press button you will get floater window with many controllers in it theses controllers have parameters that can be wired or what ever
i could achieve every thing except attaining parameters for the floater contrllers

thank you very much for your contribution and help but i still really in need for help

Kameleon
04-27-2009, 10:43 AM
How about this way?

ca=attributes tota
(
parameters main rollout:cons
(
pressbut type:#string ui:btn_main
tspinner type:#float ui:spn_main
)
rollout cons "total collection"
(
button btn_main "...."
spinner spn_main visible:false

on btn_main pressed do
(
rollout test "test"
(
spinner spn_test "test"
slider sld_test "test"
button btn_test "test"

on spn_test changed arg do
(
spn_main.value=spn_test.value
)
)
createdialog test
)
)
)
custattributes.add $Sphere01 ca

shalabology
04-27-2009, 11:09 AM
Kameleon, brilliant trick i tried it worked so far good , really liked that tiny effective trick
however paul neale suggested something in brief that i couldnt get it right here it is


Parameter blocks can only exist in Custom Attribute definitions or scripted plugins. You can't add them to standard rollouts as they don't persist in the scene. What you can do is add the rollout and parameter blocks to the existing CA def and then when the button is pressed it removes the rollout from the CA Def and adds it to a createDialog. The rollout will retain its connection to the pBlock. You need to remove it from the CAdef first as you can't have an instance of a rollout open twice. If you don't want it to show up in the CAdef at all then just close it as soon as it opens in the on open handler of the rollout.

i tried to apply wat he said but i think i missed the right coding or something sohow do u think it can be like?

Kameleon
04-27-2009, 12:20 PM
Well, I've tried this, but it doesnt seem to work... sorry.

ca=attributes tota
(
parameters main rollout:cons
(
pressbut type:#string ui:btn_main
tspinner type:#float ui:spn_main
)
rollout cons "total collection"
(
button btn_main "...."
spinner spn_main

on btn_main pressed do
(
removeRollout cons
createDialog cons
)
)
)
custattributes.add $Sphere01 ca

PEN
04-27-2009, 06:15 PM
Try this instead...


--Make a box
b=box()

--Create an attribute holder modifier and add it to the box.
ah=emptyModifier()
addModifier b ah

--Create the Custom Attribute definition.
def=attributes caDef
(
parameters paramsP rollout:paramsR
(
height type:#float UI:heightSp
)
rollout paramsR "Params"
(
spinner heightSp "Height"

)
rollout floatR "Float"
(
button openFloaterBt "Open Floater"

on openFloaterBt pressed do
(
removeRollout paramsR
createDialog paramsR
)
)
)

--Add the definition to the attribute holder modifier
custAttributes.add ah def

--Wire the height of the box to the height parameter.
paramWire.connect ah.caDef[#height] b.baseObject[#height] "height"

max modify mode
select b

ZeBoxx2
04-27-2009, 06:23 PM
which is exactly what's in that other thread (except that it's just a button instead of a toggle-state).

If you want the rollout to not display at all, I think you would have to either...

A. make two rollouts
One rollout contains the button to open the other rollout
The other rollout you remove (removeRollout) as soon as it opens (on <rollout> open do ( ) ). I don't think you can prevent it from -at all-, so removing it as soon as it opens would be your best bet. You can define the rollout as being rolledUp initially to minimize UI flickering.

B. move UI elements around
You only have 1 rollout with a given size to match just the button and all other UI elements moved out of the client area (say, negative coordinates [-1024,-1024] (not sure how that ends up displaying in e.d. the command panel). When you press the button, remove that rollout, create it as a new dialog with the proper size to fit all UI elements, and move all UI elements to where they are supposed to be.

shalabology
04-28-2009, 12:30 PM
i think i should post this before , here s within attachments that what i want to achieve
the way that worked fine is hidding spinners and sliders but:
the floater controllers dont work except the object holding the attributes is selected
i wish that the image will declare wat desired , thank you everybody for support and follow up!

ZeBoxx2
04-28-2009, 02:33 PM
ah... well in that case, just don't select the object / go to the modifier panel, and instead open the rollout directly yourself.



-- using PEN's example above, use this:
createDialog b.modifiers[1].paramsR

-- and ignore this:
-- max modify mode
-- select b

shalabology
04-28-2009, 02:45 PM
no no thats not the problem the floater opens and i coulsd wire watever the controllers the effect of the spinner in the floaters poped up takes place only when the attributes holder object is selected and this makes difference between the real spinner no and the real one

PEN
04-28-2009, 02:57 PM
I don't follow what you are after then?

shalabology
04-28-2009, 03:10 PM
look pen, i made for example :fk/ik blend spinner on ordinary controller for hand for example
i wanted to make this floater to be the place wher the whloe characters controllers are within for rapid acceess for animator so as not to go for hand controller to find tha spinner that blends fk ik instead he has the option to go throgh this via the poped up floater
the problem is to make the floater spinner to control the actual ik fk spinner that only takes place only when the object holding the custattributes is selected , that may annoy the animator i believe , sorry for being vague!

PEN
04-28-2009, 03:26 PM
What I have there will work. Wire to the parameter in the param block, float the UI and the spinner in the floater will still control the parameter. I do this all the time.

shalabology
04-29-2009, 06:52 PM
ok, but in my case i wire soinner to control another spinner that already controls ik fk issue !
i make the wire is two ways i.e mutual so one spinner changes the other does changes this thng exactly doesnt happen unless u r choosing the object holding the attribtes of the floater
anyway i think i wil give up and make the parameters controlled from one place rather than many ones unless u know something better!

PEN
04-30-2009, 01:24 PM
I still don't completely follow what you are trying to do. How about a diagram.

shalabology
05-02-2009, 04:56 PM
i really appreciate ur interest to help i will 4 sure send a detailed pics asap coz i m logging via my cell phone as i am moving around nowadays
But u can read topic by viro instance ca floater i think that he has same trouble
Thanks pen!

shalabology
05-03-2009, 06:29 AM
finally i have done it ! the controller part of spinner and slider controller as dictated by reference


<name> [ <caption> ] [ range:[min,max,val] ] [type:<name>] [scale:<float>] [ fieldWidth:<integer>] [indeterminate:<boolean>] [controller:(<controller>)]


controller omitted the need for wiring and such things as long as i wanted mutual control
i could connect the floating ui to any spinner and got both affect each other
that also omit the need for parameter part for the newly formed ui as i only care about the original spinners and sliders that the floating ui will give quick access to them.
i have completed my ui with the full functionatlity i wanted , i will attach the diagram to clear everything out but it sno w 8.30am after sleepless long night of work so i m feeling dead!

shalabology
05-16-2009, 12:42 PM
http://img34.imageshack.us/img34/79/muscleman1p.jpghttp://img29.imageshack.us/gal.php?g=muscleman.jpg

i think after all this noise i made that i should show wat i came up with here r some pics from view port , i already made cloth and hair simulation with some test animations , i will do some editing to show all my rigs in reel , thank you very much for your support

CGTalk Moderation
05-16-2009, 12:42 PM
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.