The Visibility Mismatch: Find What’s Hidden in a Molecular Scene

A familiar scene-inspection puzzle: you select a molecular node, expect it to be visible, and still cannot see it. The node’s own visibility setting may not be the whole story. In SAMSON, nodes sit in a hierarchy, and an ancestor’s visibility can affect everything beneath it. Knowing the difference between a visibility flag and effective visibility helps you diagnose the scene instead of changing settings at random.

Two different questions: “Is its flag on?” and “Can I see it?”

NSL provides two useful attributes for separating these cases:

  • node.visibilityFlag, or n.vf, checks the node’s own visibility flag. For example, n.vf false matches nodes whose flag is off.
  • node.visible, or n.v, checks effective visibility: the node’s flag is on and its ancestors are visible. The expression n.v matches visible nodes; not n.v matches nodes that are not visible.

That distinction matters in a hierarchical scene. A node can have its own flag set to true and still be invisible because an ancestor’s flag is false. Conversely, checking only the node’s flag doesn’t tell you whether the entire path through its hierarchy is visible.

A quick way to investigate

Start with not n.v to find nodes that are currently not visible. This answers the practical question, “What in the scene is hidden from view?” If you want to check the node’s own setting separately, query n.vf false. Comparing the results can help narrow down the cause:

  1. Run not n.v to identify nodes that are not effectively visible.

  2. Run n.vf false to identify nodes whose own visibility flags are off.

  3. If a node is not visible but does not have a false visibility flag of its own, inspect its ancestors in the node hierarchy. An ancestor may be preventing it from being visible.

This comparison is useful when a group, molecule, or other parent node controls the visibility of many descendants. Instead of assuming every invisible atom or structural component has been individually hidden, check whether visibility is inherited from higher in the hierarchy.

Choose the query that matches the task

Use n.v when you need nodes that are actually visible in the current scene. Use n.vf when you are investigating the visibility setting attached directly to nodes. Use not n.v to find nodes that are not currently visible, regardless of whether that state comes from their own flag or an ancestor.

For example, n.t a matches atoms. You can use that query when your investigation is specifically about atom nodes, then use the visibility queries to distinguish an atom’s own flag from its effective state. The key is not to treat “flag on” and “visible in the scene” as interchangeable: hierarchy makes them different questions.

One more distinction: hidden versus a hidden flag

The node.hidden attribute, short name n.h, describes nodes that are hidden because their visibility flag is false or because an ancestor’s visibility flag is false. It is therefore an effective-state query, unlike n.vf, which checks the node’s own flag. When troubleshooting, this gives you another way to think about the difference between a local setting and what the hierarchy produces.

These small distinctions can save time during scene cleanup, selection, and visual inspection. When something seems to have vanished, check effective visibility first; then use the flag query and the hierarchy to locate the source.

For the complete list of node attributes and additional examples, see the SAMSON node attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.