ScriptSpot

Forum topic · Scripts Wanted

A simple Bone Toggle script

By Jan Van Akkere · 2013-02-24

Description

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 (7)

here is what i use

Anubis · 2013-02-25

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

:)

barigazy · 2013-02-25

Nice approach.Clean and smooth

tassel · 2013-02-24

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)

barigazy · 2013-02-24

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
)
)

Jan Van Akkere · 2013-02-24

thanks also!!

hide bones

barigazy · 2013-02-24

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)

Jan Van Akkere · 2013-02-24

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!