Trouble Finding Your Molecular Folders? Filter by Visibility in NSL

When working with complex molecular systems in SAMSON, the scene graph can quickly become crowded with nested structures, models, atoms, surfaces, and folders. It’s easy to lose track of which folders are currently visible, which ones are hidden, and which ones contain relevant content. This can slow down your workflow and make it harder to focus on the data that matters most.

Fortunately, the Node Specification Language (NSL) in SAMSON includes a straightforward way to filter molecular folders by their visibility status. This allows you to immediately identify which folders are contributing to your visual scene—and which are not.

Understanding folder visibility in NSL

In NSL, folder nodes have several attributes inherited from the general node attribute space. Among them, the most relevant for visibility management are:

  • visible (short name: v)
  • hidden (short name: h)
  • visibilityFlag (short name: vf)

They all interact with what is shown to you in the viewport, but in slightly different ways.

visible: What’s effectively shown

The visible attribute tells you whether a folder is currently visible in the viewport. This value results from a combination of folder visibility, ancestral visibility, and global states.

  • f.v matches visible folders.
  • not f.v matches folders not currently visible.

hidden: Has this folder been explicitly hidden?

Unlike visible, which is computed, the hidden attribute reflects whether the visibility has been manually turned off for the node itself.

  • f.h true matches folders you explicitly hid.
  • f.h false brings out those that remain unhidden (but could still be invisible if a parent is hidden).

visibilityFlag: The raw toggle

This flag mirrors the toggle that programmatically sets visibility, affecting whether the node attempts to render its elements.

  • f.vf true means visibility is enabled.
  • f.vf false means visibility is disabled.

Quick recipes

Let’s say you’re editing a large biomolecular model and want to find all folders that have been turned off:

  • not f.v — Folders that are currently not visible
  • f.h — Folders explicitly hidden

If you’re cleaning up a scene, you might want to isolate only active (visible) folders:

  • f.v — Only folders contributing visually

Why this matters

These simple filters can help drastically reduce the search time within hierarchical molecular structures. Instead of clicking through the scene graph manually, NSL lets you focus your attention via tailored queries. You can also combine visibility filters with other attributes, such as number of atoms or selection state, for even more precise work.

For example, to find all visible folders with more than 100 atoms:

  • f.v and f.nat > 100

If you haven’t started using NSL queries with visibility attributes, it’s a small change that can create a more efficient and manageable modeling environment—especially in larger assemblies.

To learn more about the full range of folder attributes and how to combine them, visit the NSL documentation page:
https://documentation.samson-connect.net/users/latest/nsl/folder/

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

Comments are closed.