Shortcut for hide bone object toggle


#1

Hi, this is a simple question: how can I assign a shortcut for hide bone object toggle, since it is not listed in the action list. Any ideas?

Thanks in advance. :slight_smile:

Flávio


#2
macroScript sc_toggleBoneDisplay
category:"scrimskiUI"
Buttontext:"Toggle Bone Display"
tooltip:"Toggle Bone Display"


(	
	on execute do
	(
		case of
		(
			(hideByCategory.bones == true): (hideByCategory.bones = false)
			
			(hideByCategory.bones == false): (hideByCategory.bones = true)
							     
			
		)					   
	)	
)

#3

Thanks a lot, works great! I assigned to shift+b as I think it should be by default. :smiley:


#4

Just for the record: it’d be cleaner to do it like this:

[color=#007700][color=#fffffe]on execute do (
hideByCategory.bones = (not hideByCategory.bones);
)

[/color][/color][color=#fffffe]
[/color]


#5

Good to know. Still learning by (ab)using other peoples code.


#6

I thought I’d add this little tidbit:

 
 
( 
on execute do hideByCategory.bones = (not hideByCategory.bones)
on isChecked return hideByCategory.bones
)
 

This way when used in a quad menu or toolbar you get visual feedback to the state of the toggle, just like the other built-in toggles.


#7

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.