A molecular structure can look hidden even when the node you are inspecting has its visibility flag turned on. The reason is hierarchy: a node may inherit visibility state from an ancestor. This can make it tricky to tell whether you should search for a node’s own setting or for its effective state across the structure.
SAMSON’s Node Specification Language (NSL) provides two useful ways to ask these questions. The distinction is small in wording, but important when you are troubleshooting what appears in a molecular scene.
Ask about the effective state
Use node.visible (short form: n.v) to match nodes that are visible. A node counts as visible only when its own visibility flag is true and its ancestors are visible. To find nodes that are not effectively visible, use not node.visible (or not n.v).
Similarly, node.hidden (short form: n.h) matches nodes that are hidden because their own visibility flag is false, or because an ancestor’s visibility flag is false. This makes n.h useful when the practical question is simply, “Which nodes are currently hidden?”
Ask about the node’s own flag
Use node.visibilityFlag (short form: n.vf) when you want to inspect the flag set directly on each node. For example, n.vf false matches nodes whose own flag is false. It does not mean exactly the same thing as n.h: a node can have its own flag set to true and still be hidden because an ancestor’s flag is false.
That difference gives you a practical way to narrow down a visibility problem:
n.hfinds nodes hidden in the hierarchy, regardless of which level caused it.n.vf falsefinds nodes whose own visibility flag is off.n.vfinds nodes that are visible after considering their ancestors.
A simple troubleshooting sequence
Suppose part of a model is absent from the view, and you want to determine whether individual nodes or a parent group may be responsible. First, search for n.h to identify nodes that are effectively hidden. Then search for n.vf false to focus on nodes with their own flags switched off. If a node is hidden but its own flag is true, the documentation’s definition points you toward checking its ancestors’ visibility flags.
This approach is useful because it separates two questions that are easy to conflate: “Is this node’s flag on?” and “Is this node visible in the hierarchy?” The first is a local property; the second accounts for inherited state. When you are inspecting a large structure, keeping those questions separate can make the search results much easier to interpret.
Selection has the same local-versus-inherited distinction
The same pattern applies to selection. node.selectionFlag (short form: n.sf) checks a node’s own selection flag, while node.selected (short form: n.s) matches nodes selected either directly or through a selected ancestor. So n.sf false and not n.s are not interchangeable: the first concerns a node’s flag, while the second concerns its effective selected state.
As a rule of thumb, use the flag attributes—n.vf and n.sf—when investigating settings stored on individual nodes. Use the effective attributes—n.v, n.h, and n.s—when you care about the state that applies after hierarchy is taken into account.
For the complete list of node attributes and examples, see the SAMSON node attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
