Animating IsHidden


The callback needs to validate objects.

fn visibilityFilter node = (not node.visibility)
registerDisplayFilterCallback visibilityFilter "Visibility"
k = getNumberDisplayFilters()
setDisplayFilter k on

delete objects
max select all

Now try to move the box and you get:

>> MAXScript Display filter Callback Exception:
-- Unknown property: "visibility" in $<root> <<


Actually what drives the visibility is a Custom Attribute. Here we used an EmptyModifier to hold it as the OP used it too, but you can attach it to any modifier or to the base object and so it won’t change the class of the object.


the callback function should be:

fn visibilityFilter node = (isvalidnode node and not node.visibility)

the sdk method for DisplayFilterCallback is:

BOOL IsVisible(SClass_ID sid, Class_ID cid, INode *node); 

it paases any INode including RootNode and deleted nodes… so we need to check it.


I prefer to use custom attributes for the base object … but the problem is this: all notifications go first to the subanims of the node, and then to the base object, plugins and attributes.

so if we bind some node’s subanimes with CA, it means they are evaluating multiple times on a very time sample. First time is before CA parameters changed, and next is after.


This is awesome Denis, Thank You!