Notifications
Clear all

[Closed] custattributes+ floater rollout

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!

21 Replies

hey guys, is my question isn t clear or is it repeated? i really wnat to know coz i really need the answer

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 

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

haven’t tested, but try the method outlined here:
http://forums.cgsociety.org/showthread.php?t=752318 How to control Custom Attributes?

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

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

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?

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

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
 
Page 1 / 3