Quickly Filter Visible and Hidden Elements in Molecular Models

When working with complex molecular systems in SAMSON, clarity is often the first casualty. Visual clutter created by overlapping atoms, surfaces, and annotations can make it difficult to focus on the relevant parts of your simulation or analysis. Navigating through these intricacies involves more than just toggling display settings manually — which can quickly become tedious.

This is where the visible and hidden presentation attributes in SAMSON’s Node Specification Language (NSL) can help streamline your workflow. These attributes allow molecular modelers to define precise, reproducible queries that immediately target what’s visible or not, simplifying presentations, debugging, and scene preparation.

Why visibility control matters

Whether you’re preparing figures for a publication, making a high-quality rendering, or inspecting simulation results, being able to programmatically filter which nodes are shown saves time and avoids error. Let’s say you want to identify all visible molecular surfaces but exclude labels and molecular dynamics traces. Manually clicking dozens (or hundreds) of checkboxes is not scalable. With NSL, you can create expressions to identify and act on exactly what you need.

Meet pr.v and pr.h

In NSL, the presentation attribute space (short name: pr) is used for specifying presentation-type nodes. The pr.v attribute allows you to select nodes that are currently visible, while pr.h selects those that are hidden.

Here are practical examples:

  • pr.v — targets all nodes that are visible.
  • not pr.v — matches all nodes that are not visible.
  • pr.h — selects hidden nodes.

Boost productivity with NSL selection filters

Want to hide all visible nodes quickly? Combine these expressions with SAMSON’s selection and node manipulation tools:

Set up quick filters for different contexts:

  • Before exporting a render, use pr.v to verify that only relevant nodes are shown.
  • When you lose track of an object in the viewport, use not pr.v or pr.h to locate hidden nodes and reveal them.

The attributes visible and hidden are inherited from the more general node.visible and node.hidden attributes, but here you target only presentation nodes.

What’s the difference between visible and the visibilityFlag?

It’s easy to confuse pr.v (visible) with pr.vf (visibilityFlag). The distinction is subtle but important: visible refers to whether the node is actually being drawn, potentially considering various parent node states. On the other hand, visibilityFlag more directly reflects the user-controlled toggle specific to the node.

This means a node’s visible = true if and only if it and all its relevant parent containers are meant to be visible. But if a parent node is hidden, then even if pr.vf = true, the node may still not be drawn.

Conclusion

Being able to target visible and hidden nodes through NSL gives you a programmable, reliable way to declutter scenes and focus on relevant data. Instead of relying on manual clicks, you can automate and reproduce selection criteria quickly — which is especially useful in projects involving many components or collaborators.

To explore more presentation attributes in NSL, visit the official documentation page.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.

Comments are closed.