A simple Bone Toggle script

I've seen several simple scripts for Toggling on/off bones, but according to lots of people these script don't work in 3dsmax 2013, I tried them all and they don't work.

Here you can see a post about this from another user, but no replies with a working code.

http://3dsmaxfeedback.autodesk.com/forums/76763-small-annoying-things/su...

Can anyone write a working Bone Toggle tool?

Many many thanks!

Comments

Comment viewing options

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

here is what i use

(for obj in selection where \
obj.inode.boneEnable \
collect obj).isHidden = on/off

my recent MAXScripts RSS (archive here)

barigazy's picture

:)

Nice approach.Clean and smooth

bga

tassel's picture

And if you want to hide Biped

And if you want to hide Biped also:

try(destroydialog ::testRoll) catch() 
rollout testRoll "BonesHide"
(
	checkbutton btn_bone "Hide Bones" pos:[5,5] width:140 height:40
	on btn_bone changed state do (for b in objects where isKindOf b BoneGeometry or classOf b == Biped_Object do b.isHidden = state)
)
createDialog testRoll 150 50 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)

/ Raymond

barigazy's picture

Hi tassel, you forget CAT

Hi tassel, you forget CAT bones also :)
Anyway this is the macroscript

macroScript hideBones category:"bgaTools" tooltip:"Hide|Unhide Bones Toogle" buttontext:"HideBones"
(
	on isChecked do
	(
		(for b in objects where isKindOf b BoneGeometry collect b)[1].isHidden
	)
	on execute do
	(
		for b in objects where isKindOf b BoneGeometry do b.isHidden = on
	)
	on closeDialogs do
	(
		for b in objects where isKindOf b BoneGeometry do b.isHidden = off
	)
)

bga

Jan Van Akkere's picture

thanks also!!

thanks also!!

barigazy's picture

hide bones

This works

try(destroydialog ::testRoll) catch() 
rollout testRoll "BonesHide"
(
	checkbutton btn "Hide Bones" pos:[5,5] width:140 height:40
	on btn changed state do (for b in objects where isKindOf b BoneGeometry do b.isHidden = state)
)
createDialog testRoll 150 50 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)	

bga

Jan Van Akkere's picture

barigazy, it does work, but

barigazy, it does work, but is there a way to make it a "toggable" button to dock in a toolbar? I got all categories lined up in one toolbar (geo, light, cams, shapes..)

Many thanks! It already works, that's great!

Comment viewing options

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