Clarify your scenes: Filtering presentation nodes by visibility in SAMSON

Working with complex molecular models often means dealing with countless nodes representing atoms, residues, structures, and their various visual representations. When presentation gets overwhelming, focusing only on visible content can dramatically enhance your workflow.

That’s where SAMSON’s Node Specification Language (NSL) offers a practical solution. NSL allows users to filter and query nodes systematically. And one particularly helpful feature is filtering presentation nodes using their visible status.

Why visibility matters for molecular modelers

When visualizing large biomolecules or multi-scale models, you’re likely toggling representations on and off constantly: hiding water molecules, highlighting binding pockets, inspecting ligands, etc. But as your document grows, how do you rapidly find and focus only on visible presentation nodes?

If you’ve ever found yourself lost in a thicket of visual elements, you’re not alone.

Introducing the pr.v filter

In the NSL, the pr prefix indicates the query targets presentation nodes. To filter only the ones currently visible in your workspace, you can use the visible attribute:

This simple query returns all presentation nodes that are currently visible. Conversely, to find ones that are hidden:

This is useful when you want to audit hidden elements to clean up or adjust your scene.

Tip: Visibility vs. Visibility Flag

If you’re wondering what the difference is between visible and visibilityFlag — the former considers both the node and its ancestor visibility. This is a more “real-world” filter: just because a node has its visibility flag turned on doesn’t mean it’s truly visible (if its parent group is hidden, for example).

So, use pr.v when you’re trying to capture what’s actually visible on screen.

Use cases for filtering by visibility

  • 👍 Export scenes: Want to export only the visible nodes to share for presentations? Quickly select all pr.v nodes and export.
  • 👁️ Focus editing: Working on parts you see? Prevent accidental changes to hidden objects by limiting actions to pr.v filtered nodes.
  • 📊 Tune performance: For large systems, querying what’s actually visible can help reduce computational load in selection or processing steps.

Combine filters for precision

You can combine visible with other attributes. For example, to select only visible presentation nodes whose name starts with “Ligand”:

One-liners like this give you power and precision to manage your projects without hunting through the document manually.

Want more?

This is part of the broader presentation attribute space in SAMSON’s NSL. You can also filter by hidden, selectionFlag, name, and more. Mastering these lets you navigate complex documents more intuitively.

Learn more from the full presentation attribute documentation here.

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

Comments are closed.