How to Filter and Organize Your Camera Nodes in SAMSON

When working on complex molecular models or reaction simulations, controlling the viewpoint can be as important as the data itself. Molecular modelers often resort to creating multiple camera nodes to represent different perspectives, highlight specific molecular components, or prepare illustrative renders for publications and presentations.

However, once a project involves ten, twenty, or even more camera nodes, it becomes challenging to keep them organized. Which ones are selected? Which are flagged for export or presentation? Which have naming conventions that help you sort them?

If you’ve ever felt frustrated trying to manage dozens of these nodes in a crowded workspace, SAMSON’s Node Specification Language (NSL) can help. This post introduces a few practical tips on using camera attributes in NSL to make your modeling workflow smoother and more efficient.

Use the camera attribute space

In NSL, camera nodes are queried through the attribute space camera (short name: ca). This allows you to target only camera nodes and apply filters based on their properties.

Matching cameras by name

Need to isolate cameras by name? The ca.n attribute lets you query using string patterns:

  • ca.n "TopView" — matches cameras named exactly “TopView”
  • ca.n "Cam*" — matches any camera whose name starts with “Cam”

This can be useful when you have naming conventions such as Cam1, Cam2, or CamFinal.

Selecting selected cameras

The ca.selected attribute helps you determine if a camera node is currently selected. This is helpful when you want to work only with cameras you’ve flagged manually within the viewport or interface:

  • ca.selected — returns all selected camera nodes
  • not ca.selected — returns only those not currently selected

Using the selection flag

The ca.sf (short for selectionFlag) lets you tag camera nodes intentionally as part of a set, for example for exporting, scripting, or rendering. Unlike manual selection (which can change often), flags can be more stable during your workflow:

  • ca.sf true — retrieves all flagged cameras
  • ca.sf false — finds unflagged ones

This is especially useful when you want to script actions only on a subset of saved camera views, without relying on transient viewport selection.

Combine filters for more control

Need a precise filter? Combine conditions. For example:

  • ca.n "Render*" and ca.sf — matches flagged cameras whose names start with “Render”
  • ca.n "Top*" and not ca.selected — all Top view cameras not currently selected

Practical use cases

Here are a few scenarios where this approach can be helpful:

  • Batch-exporting views from only a subset of cameras
  • Identifying which camera nodes are selected during scripting
  • Cleaning up unused or misnamed camera nodes
  • Tagging multiple cameras intended for presentation with selectionFlag

NSL queries make it straightforward to search, filter, and organize your camera nodes with precision. Instead of scrolling through a cluttered node inspector, learn to query your way to a cleaner, more controlled workflow.

To learn more about camera node attributes and NSL syntax, visit the full documentation page: https://documentation.samson-connect.net/users/latest/nsl/camera/.

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

Comments are closed.