Hide / Show bones

Hello
I would like to show/hide bones by a toggle.
I found different scripts, but in max2014, these script can show bones but can't hide bones even with a redraw fonction ???
Anybody can help ?

Comments

Comment viewing options

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

this is working for me as

this is working for me as toggle. Change category and names by your needs.

macroScript BonesToggle category:"Test" toolTip:"BonesToggle" (
if hideByCategory.bones == true then ( hideByCategory.bones = false)
else (hideByCategory.bones = true)
)
titane357's picture

Thanks Barigazy, I found

Thanks Barigazy, I found :
hideByCategory.bones = (not hideByCategory.bones)
it works on bones but not on bipedobjects...
strangely, "hide category" "Bone Object" is switched "on" by the script, but biped objects not hidden...

barigazy's picture

...

hideByCategory.bones = (not hideByCategory.bones) 

Code above not works in max2014 even if you force view redrawing.

bga

barigazy's picture

...

I write simple tool In your request
http://www.scriptspot.com/3ds-max/scripts/hide-unhide-skeleton

bga

titane357's picture

Thanks very much Barigazy, it

Thanks very much Barigazy, it works.
As I really want a shortcut : i'll keep ( one with "on" and another "off" )=
-------
fn collectClasses optArr:#(cb_bone,cb_bip,cb_cat,cb_hub) =
(
for c in 1 to optArr.count collect
(
case c of
(
(1): BoneGeometry
(2): Biped_Object
(3): CATBone
(4): HubObject
)
)
)
fn hide_unhide_Skeleton state: =
(
local skeletonClasses = collectClasses()
(for b in geometry where findItem skeletonClasses (classof b.baseobject) != 0 collect b).ishidden = state
)
hide_unhide_Skeleton state:on
-------------------------

I'd be better with a switch ;-)

barigazy's picture

But how you can chack which

But how you can chack which option ei sceleton type you want to consider in process?

bga

titane357's picture

for now, I just need to

for now, I just need to hide/show bones or biped objects...
So nevermind if I can't choose for the moment.
Very annoying that in max you can toogle visibility for shape, geometry, light,... but not bones with shortcut...
So, your script is enough for me at the moment. Thanks.

barigazy's picture

...

Or if you want to no loop trough all scene objects then use simply

(for b in geometry where isKindof b.baseobject BoneGeometry collect b).ishidden = on
(for b in geometry where isKindof b.baseobject BoneGeometry collect b).ishidden = off

bga

barigazy's picture

...

Can you try this

--to hide bones
(for b in objects where isKindof b.baseobject BoneGeometry collect b).ishidden = on
--to unhide
(for b in objects where isKindof b.baseobject BoneGeometry collect b).ishidden = off

bga

Comment viewing options

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