[Closed] Hide/Show Based On Custom Attribute
Hey everybody. What I want to do is simple, but for the life of me I can’t figure it out in Max. All I want to do is connect a custom attribute – a check box – and the show/hide property of an object.
I know there are many possibilities with maxscript, but I can’t even figure out where to “put” a script in max so that it’s, say, tied to a button. All the tutorials seem to be geared around tools and so forth.
I figured this out but didn’t have a chance to post back.
One way to do this is to create a Visibility Track. You select the object you want to hide/unhide, go to Track View, and add a Visibility Track. Then you just Wire the Visibility to a Custom Attribute. It works. The downside is that there remains on screen a ghost of the object that is being hidden. Still, it works well enough.
hi StanrickKubley,
It is possible to set the visibility of multiple nodes on a rig within a custom attribute using weak referencing. I have placed an attribute utility that does what you ask for on my site along with a tutorial detailing what it is doing. Click the link and go to the MXS section. There’s just the one page at the moment, i will be updating it as I go and providing scripts for download.
For anyone else who is interested I have updated a few bits of my dotnet research there also.
regards,
Pete
One thing to keep in mind – the Visibility track is evaluated by the Renderer (well, by most renderers) per frame. So if the attribute is animated, rendering the sequence should potentially show the objects appearing and diapperaring as expected.
Changing the node hidden property through would not allow for such animation of visibility because the hidden state is checked once before the sequence starts rendering, and any object that was hidden at that point cannot appear on later frames, while objects evaluated as unhidden will be there for the whole sequence.
Thus, if you intend to use the attribute control to hide and unhide objects in an animation, use the visibility track approach.
I’m just using the visibility to hide and unhide pieces of clothing for variety, so the thing that is hidden/unhidden is that way throughout the whole animation. I’m not animating the visibility in other words.