When working with complex molecular systems in SAMSON, it’s not uncommon to run into the issue of nodes—atoms, molecules, bonds—seemingly vanishing from view. But are they really gone? Often, the problem isn’t in the data itself, but how that data is displayed. If you’ve ever found yourself wondering why part of your model is no longer visible, you’re not alone.
This blog post unpacks a fundamental but sometimes misunderstood feature of SAMSON’s Node Specification Language (NSL): node visibility. Knowing how visibility attributes work can help you troubleshoot, clean up your workspace, and control exactly what’s shown in your workspace—and what isn’t.
Why Things Vanish
Nodes in SAMSON can disappear from the view for two main reasons:
- They are not visible (i.e., the node or one of its parents has a
visibilityFlagset tofalse). - They are hidden (highlighting a more user-friendly concept that combines the
visibilityFlaglogic throughout the hierarchy).
Let’s explore the key NSL attributes to help you diagnose what’s going on:
🔍 node.visibilityFlag (short: n.vf)
This flag indicates whether a particular node is marked visible. It doesn’t take into account its ancestors.
Example:
|
1 |
node.visibilityFlag true |
This will select all nodes that have their visibility flag turned on, regardless of whether their parent or grandparent nodes are visible themselves.
🫥 node.visible (short: n.v)
This is the most useful attribute when you want to query what is actually visible in your scene. It checks not only the node’s own flag, but also that of all its ancestors.
Example:
|
1 |
node.visible |
This will match only those nodes that are fully visible in the workspace.
🙈 node.hidden (short: n.h)
The opposite of visibility: this identifier helps you find all nodes that are hidden due to their own flag or the flags of their ancestors.
Example:
|
1 |
node.hidden |
Use this to quickly uncover which parts of your model are currently not being displayed.
Common Use Cases
Here are some quick NSL queries to deal with visibility-related frustrations:
not node.visible— Find all non-visible nodes.node.hidden and node.category ligand— Show all hidden ligands.node.visible and node.type atom— Highlight all visible atoms.
Restoring Visibility
If you find nodes that are hidden or not visible, there are a few steps you can take to make them reappear:
- Use the NSL query
node.hiddenand deselect that filter to toggle visibility flags back on. - Ensure that parent nodes (like folders or molecules) also have their visibility flags set to
true.
When to Use Which Attribute?
Here’s a simplified decision framework:
- Use
node.visibleto answer: “Is this node actually shown?” - Use
node.visibilityFlagto check a node’s individual setting. - Use
node.hiddento find what’s not visible due to any reason.
Understanding these visibility attributes can help you work more efficiently, especially when rendering or exporting models—and avoid unnecessary frustration over apparently missing atoms. 🧬
To learn more about node visibility and other useful concepts in NSL, visit the official NSL node documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
