Notifications
Clear all

[Closed] Hide Them Bones

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!

7 Replies
1 Reply
(@lucpet)
Joined: 11 months ago

Posts: 0

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
)

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.

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

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 , 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?!

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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


hideByCategory.bones = not hideByCategory.bones
redrawviews()

 PEN

Yup. Why wouldn’t you?

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

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.