Quick ways to filter hidden and visible nodes in SAMSON with NSL

When working on complex molecular systems in SAMSON, we often deal with a multitude of objects: atoms, groups, models, data nodes, and more. Among these, property models define additional data on molecular systems, such as electrostatic potentials, surface properties, or simulation metadata. But things can quickly become visually overwhelming and cluttered.

One recurring challenge is identifying which of these property models are actually visible — or hidden. Whether you’re analyzing results or preparing publication-ready images, knowing what’s currently displayed can save significant time and reduce errors.

Using NSL to work with visibility

The Node Specification Language (NSL) in SAMSON offers a way to programmatically select nodes based on their attributes. For property model nodes, there is a dedicated attribute space: propertyModel, or pm for short.

Let’s focus specifically on visibility-related attributes:

  • pm.v — indicates whether a node is visible.
  • not pm.v — selects nodes that are not visible.
  • pm.vf — the visibility flag controlling whether visibility is inherited or explicitly set.

These attributes allow straightforward queries that filter just the nodes you care about.

Examples you can use

  • To find all visible property models: pm.v
  • To find all hidden property models: not pm.v
  • To check which have visibility flags turned off: pm.vf false

Each of these expressions can be directly entered in the NSL editor in the SAMSON interface. The visual filtering updates live, so you immediately see which elements match your query.

Why visibility filtering helps

Here’s why you might want to start using these filters:

  • Performance boosts: reducing visual clutter may speed up rendering and interaction with large systems.
  • Clarity: helpful when preparing figures or exporting only visible elements.
  • Troubleshooting: quickly detect property models that might be hidden but expected to appear.

You can even combine visibility with other attributes to narrow your search. For instance, list all visible property models whose name begins with “ESP” by using:

Or find those that are hidden and not yet selected:

A note on related attributes

If you are managing large scenes, consider also checking:

  • pm.h (hidden): whether the node is marked hidden (adds redundancy to pm.v).
  • pm.sf: selection flags that may affect interactivity.

The visibility system in SAMSON might seem subtle at first, but mastering these few expressions can greatly simplify your modeling workflow.

To learn more about visibility and other attributes in the property model attribute space, read the full documentation.

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

Comments are closed.