Quickly Find Hidden or Visible Models Using NSL in SAMSON

If you are working with large molecular systems in SAMSON, you’ve probably faced the challenge of visual clutter. Hundreds of model nodes – some visible, some hidden, and many buried under layers of data. When you’re trying to focus on specific structures or need to debug what’s being rendered, this clutter can become frustrating. Fortunately, SAMSON’s Node Specification Language (NSL) offers a simple and powerful way to filter visual models based on their visibility directly.

In this post, we introduce how to use visual model attributes – specifically hidden, visible, and visibilityFlag – to find exactly what you’re looking for in your scene.

What is a visual model node?

In SAMSON, a visual model node represents a graphical representation of a molecule or part of a structure. These can be atoms, bonds, surfaces, or any visual depiction built on top of data nodes. Each visual model is configurable and can be shown, hidden, or have related properties adjusted via NSL attributes – and that’s where this gets helpful.

Visibility-related attributes at a glance

NSL allows you to query and manipulate node attributes through simple keyword expressions. For visual models, there are specific attributes that help control and examine render behavior:

  • vm.v: whether the visual model is visible.
  • vm.h: whether it is hidden.
  • vm.vf: the visibility flag set on the node.

All three return boolean values and can be used in simple query expressions. For example:

Finds all visible visual models.

Finds all visual models that are currently not being rendered.

You can also use the hidden attribute:

To select visual models that are explicitly marked as hidden.

Why use these filters?

Imagine you are building a molecular animation and want to track why some components aren’t showing up. Instead of manually toggling through the node inspector, you could use:

To quickly list all invisible models, then pinpoint which ones need material, lighting, or flag adjustment. Similarly, to prepare a clean rendering with only specific molecules:

This will display only visible models whose names start with “MyTarget”.

Digging slightly deeper: visibilityFlag

The visibilityFlag (short name: vf) gives another layer of control. While visible and hidden refer to the final render status, vf allows a node to be marked for visibility toggling through logic or parent node conditions without being permanently defined as visible or invisible. This can be useful for group toggling.

Selects all nodes where the visibility flag is true.

Save time when debugging visual output

Rather than hunting through complex model structures, use NSL queries in search panels to highlight exactly what’s visible, hidden, or conditionally rendered.

This is especially helpful when sharing scenes with collaborators or preparing figures for publication, as it keeps your visualization layers well-defined and under control.

To learn more and see the complete list of visual model attributes for NSL, visit the official 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.