Hide Them Bones


#1

Hi all,

So I just wanted a simple button to hide/unhide bones, I searched around and have found a few good examples, however, they don’t seem to work? What have I missed here, it seems pretty straight forward?!

(
		if hideByCategory.bones == true then
		(
		hideByCategory.bones = false
		)
		else
		(
		hideByCategory.bones = true
		)
)

Thanks!


#2

There is probably a much better way to write this but try…

if hideByCategory.bones == false then
(
	hideByCategory.bones = true
)
else 

if hideByCategory.bones == true do
(
	hideByCategory.bones = false
)

#3

Simplest possible way might be

hideByCategory.bones = NOT ( hideByCategory.bones )

Type that in the listener, select/mark the text and drag it onto a toolbar of choice. That should generate the button functionality for you.


#4

why is to hide bones? they are not visible behind a mesh anyway. :wink:
are anyone still using bones in the rig?


#5

Thanks guys,

Weird things happening, when I run the code, nothing happens but when I try to click on a bone it disappears. Might just be my max, I still need to patch it to the latest hotfix! But then again with 2014 round the corner I might just wait till it comes up in my subscription.

It seems to hide the bones but no re-draw the viewport?!

Frog tried your code but it didn’t seem to work either. Again does weird things.

Denis I’m using Character studio :blush:, hey you gotta make things work when you’re a one man show. Is that your real pic, maxscript programmers aren’t supposed to look like Die hard 3 villans?!


#6

there is some issue with screen redraw with some viewport settings.
try:


hideByCategory.bones = not hideByCategory.bones
redrawviews()


#7

Yup. Why wouldn’t you?


#8

let’s talk about ‘bones’ what hidebycategory hides… a ‘bone’ in this case is any geometry superclass object with boneEnable inode property set to ON.
so using this ‘bone’ i have two limitations (geometry and boneEnable set on) and one very questionable advantage (any).
that’s #1
#2 any geometry in wire mode renders slower in viewport than a helper (dummy, point…)
#3 when i debug my own rig i like to havesolid’classic bone’ preview for bones, but my animators who make animation like a la motion builder (maya) ‘picker’ style controls (wire). so my rig ‘bone’ has to have two (or maybe more) different previews.
the only one class can solve these problems it’s… the scripted manipulator. or a custom class that extends the scripted manipuator. the last thing i use as a rig bone object.


#9

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.