When working with complex molecular models, it’s easy for parts of your structure to become hidden—whether intentionally (through hiding layers, atoms, or models) or unintentionally (e.g., due to inherited visibility from parent nodes). If you’ve ever found yourself wondering why something you added to your scene disappeared or can’t be selected, understanding how visibility works in SAMSON can help you solve this quickly.
SAMSON’s Node Specification Language (NSL) includes several attributes that allow you to select and analyze nodes based on their visibility. This can be especially helpful during model cleaning, analysis, or presentation preparation.
Key Concepts
Three visibility-related node attributes in NSL are particularly relevant:
node.visibilityFlag(short:n.vf) – checks whether a node’s visibility flag is set totrueorfalse, regardless of its ancestors.node.visible(short:n.v) – selects only nodes that are visible and whose ancestors are also visible.node.hidden(short:n.h) – selects nodes that are hidden either directly or because of invisible parents.
Why It Matters
Let’s say you loaded a molecule, colored atoms, applied a visual model, and then grouped them. Later, you noticed some atoms or models were not showing up or were unavailable for editing. This often happens because parts of the data graph are hidden or one of the parent nodes (e.g., a folder or visual model) has been toggled off.
Here’s how you can use NSL to detect and manage this.
Finding Hidden Nodes
To identify all hidden nodes:
|
1 |
n.h |
This matches all nodes that are currently hidden. You can do this whenever you’re troubleshooting a scene with missing elements.
Finding Visible Nodes
To select everything that is currently visible in your model (including atoms, visual models, etc.):
|
1 |
n.v |
This allows you to isolate and export only visible components, for example when preparing a final image.
Checking Visibility Flags
If you suspect a node is hidden because its flag was turned off manually or via scripting, use:
|
1 |
n.vf false |
This pinpoints nodes with individual visibility flags set to false. The result may include nodes that are even visible due to inheritance, so use this in combination with n.v or n.h for more clarity.
Strategies to Debug Model Visibility
- First use
n.hto find what’s hidden. - Then use
n.vf falseto check if the problem is a local flag setting. - If the visibility flag is true but the node is still hidden, then one of its parent nodes is likely hidden. Browse up the hierarchy to fix it.
Here’s a use case: You’re fine-tuning a ligand-binding site for rendering but certain parts of the structure are missing. Use n.h in n.c lig to find hidden ligand nodes quickly.
NSL allows you to be precise with these queries, and once learned, it saves debugging time in large molecular systems.
To learn more, visit the full documentation on Node attributes in NSL.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
