Attribute Holder controlling hide unhide commands!

hi,
I'm really in trouble about this rig I'm building. I need to make an on off button that hides and shows specific objects within an attribute holder of another object. I searched for 3 hours and couldn't come up with something.

it can be a name tag that can differ them from other objects. Like $hhh*

the closest I achieved was this and it didn't work.

ca=attributes EXPRESSIONCTRL
(
 
	parameters EXPRESSIONParameter rollout:EXPRESSIONrollout
	(
	)
	rollout EXPRESSIONrollout "Expressions I/O"
	(
	button btn_I "On" align: #left across:3
	button btn_O "OFF" align: #right across:3
	)
 
	on btn_I pressed do
	(
		global unhide $hhh*
	)
 
	on btn_O pressed do
	(
		global hide $hhh*
	)
 
 
)
custAttributes.add $.modifiers[1] ca

I'm on my babysteps however I need this to be done due to the deadline

I would appriciate if anyone could help.

Thanks.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pixamoon's picture

`

i found 2 things:

1. ")" in wrong place - handles "on btn_I pressed ...." should be also in rollout (....)
2. why global  unhide $hhh* ? try just unhide $hhh*

so it can look like this:

ca=attributes EXPRESSIONCTRL
(
 
	parameters EXPRESSIONParameter rollout:EXPRESSIONrollout
	(
	)
	rollout EXPRESSIONrollout "Expressions I/O"
	(
		button btn_I "On" align: #left across:3
		button btn_O "OFF" align: #right across:3
 
 
		on btn_I pressed do
		(
			unhide $hhh*
		)
 
		on btn_O pressed do
		(
			hide $hhh*
		)
 
	)
)
 
--this will remove all other custom parameters
--for i = custAttributes.count $.modifiers[1] to 1 by -1 do custAttributes.delete $.modifiers[1] i
 
custAttributes.add $.modifiers[1] ca

hope it helps

AtillaMentes's picture

Much thanks! thanks for your

Much thanks!
thanks for your definitive, detailed and helpful answer works like a charm.

pixamoon's picture

`

no problem, glad it helped :)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.