If you’ve ever opened a complex molecular scene in SAMSON and struggled to figure out which elements are currently invisible or hidden, you’re not alone. Whether it’s a section of your model vanishing because of a visibility flag or a group of property models unintentionally hidden, identifying and correcting display states can be time-consuming—especially when working with heavily annotated molecular systems or advanced property models. Fortunately, SAMSON’s Node Specification Language (NSL) provides a precise and fast way to query node visibility attributes—and it’s more flexible than you might think.
Visibility vs. Visibility Flag: What’s the Difference?
In NSL, two different yet related attributes control what you see in your viewport:
visible (v): Indicates whether a node is currently visible on the screen.visibilityFlag (vf): Indicates whether the node should be visible according to its local state (even if parent visibility settings override it).
Many molecular modelers don’t distinguish between these two. Yet, understanding this difference is crucial when debugging complex visualizations involving group nodes or nested structures. For instance, a node might not be currently visible (pm.v is false), because it is inside another node that is hidden—but its own visibility flag (pm.vf) is still true.
Querying for Hidden or Invisible Property Models
Suppose you’re trying to locate all property model nodes that cannot currently be seen. You can use the following NSL expressions:
not pm.v: Targets property models that are not currently visible.not pm.vf: Targets property models whose own visibility flag is false.
This distinction is particularly useful when you’re building automated workflows or visualization scripts. For example:
|
1 2 3 4 5 |
// Find all property models that are currently hidden: not pm.v // Highlight all nodes that should not be visible per user settings: not pm.vf |
If you want a comprehensive list of hidden property models whose visibility flags are off, simply combine these conditions:
|
1 |
not pm.v and not pm.vf |
Use Cases: Why It Matters
- ✔ Visual debugging: Determine which nodes are hidden and why.
- ✔ Workflow automation: Automatically toggle visibility for specific nodes.
- ✔ Reporting and previews: Generate images that don’t omit key annotations or results by mistake.
Additional Tip: Interacting with Visibility Flags
Once you’ve selected hidden nodes with filtered visibility flags, you can use SAMSON’s command editor or selection tools to toggle them back on. This is much faster than manually hunting for each item in the Document View.
To learn more and explore additional available attributes for property models, visit the original documentation page: https://documentation.samson-connect.net/users/latest/nsl/propertyModel/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
