Control What You See: Filtering Molecular Models by Visibility in SAMSON

In complex molecular design projects, efficient navigation and structure analysis often come down to one simple question: What am I looking at? When working with dense molecular systems, being able to filter and select only the parts of the model that are truly visible can significantly reduce visual fatigue and improve focus.

In SAMSON, the integrative platform for molecular design, the visualModel attribute space gives users powerful tools to manage and query their molecular models based on what’s displayed. This post dives into how you can use the visible and visibilityFlag attributes to make your work smoother when dealing with visual model nodes.

Why Visual Filters Matter

Let’s imagine you’re designing a large biomolecular assembly. Perhaps you’ve hidden some chains, applied transparency to a membrane, or toggled off display for specific molecules. But later, when you want to apply an action only to what’s actually visible — for example, highlighting, exporting, or animating — how do you find those visible parts programmatically?

That’s where filtering by visibility in the visualModel attribute space (
short name: vm) comes into play. You can target nodes by using attributes like:

  • vm.v — Targets nodes that are currently visible
  • not vm.v — Targets nodes that are currently not visible
  • vm.vf — Checks whether visibility is affected by parent nodes

Visibility vs. Visibility Flag: What’s the Difference?

It’s important to distinguish between:

  • vm.v (visible): Whether the visual model is visible in the scene.
  • vm.vf (visibilityFlag): Whether the model’s visibility is explicitly set to be visible or hidden, regardless of its parent hierarchy.

Why is this distinction important? Because visual models inherit visibility from their parents. So even if visibilityFlag is true, a parent node’s settings may still hide the model from view. Use vm.v to reflect effective visibility, and vm.vf to control or evaluate manual visibility settings.

Examples in Practice

Here are a few concrete ways you could use these attributes in a Node Specification Language (NSL) query:

  • vm.v – Get all visible models.
  • not vm.v – Find models that aren’t visible.
  • vm.vf false – Find models for which visibility has been turned off manually.

This becomes especially useful when managing scenes with many visual elements. Want to hide everything except what you’re working on? Use not vm.v to list and selectively show/hide parts. Need to prepare a clean snapshot? Make sure only what’s vm.v is shown. No more guessing.

Interplay with Other Attributes

You can combine visibility filters with other attributes like name (n) or hasMaterial (hm) for more specific queries. For instance:

This would select only visible visual models whose names start with “Ligand”.

Learn More About Visual Model Queries

Taking advantage of visibility attributes can help reduce clutter, make selection operations more accurate, and overall give you greater control when navigating 3D molecular environments.

For more on visual model attributes in SAMSON’s NSL, visit the full documentation: https://documentation.samson-connect.net/users/latest/nsl/visualModel/

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

Comments are closed.