When working on complex molecular scenes in SAMSON, clarity is key. Whether you’re preparing a presentation, setting up multiple viewpoints, or scripting analyses, you often need to isolate and interact with camera nodes specifically. Unlike atoms or molecules, cameras have their own set of attributes in the Node Specification Language (NSL) that make them easier to query, filter, and control. However, many users aren’t aware of the simple syntax tricks that can improve workflow efficiency.
This post introduces a focused approach to querying camera nodes in SAMSON using NSL (Node Specification Language). This is helpful in cases when you’re scripting interactions or need to apply operations (e.g., duplicating, modifying, or deleting) to camera nodes only.
Why filter camera nodes?
In a large document with many types of nodes, filtering for cameras lets you:
- Quickly find and rename cameras
- Switch between defined viewpoints programmatically
- Select only active or inactive cameras
- Clean up unused or default view settings
Using the camera Attribute Space
Camera nodes can be specifically targeted using the camera attribute space, or its short alias ca. This ensures that your filter applies only to camera nodes. For example, running a filter like ca.n "Top" will select all camera nodes whose name contains the text “Top”.
You can combine camera-specific attributes with logical operators to make intelligent selections. Here’s a summary table of currently supported inherited attributes for camera nodes:
| Attribute | Shortcut | Values | Examples |
|---|---|---|---|
name |
n |
Any string in quotes | ca.n "A"ca.n "L*" |
selected |
(no shortcut) | true, false |
ca.selectednot ca.selected |
selectionFlag |
sf |
true, false |
ca.sf falseca.sf |
Tips for Practical Use
- Renaming cameras: Use
ca.n "*">to view all camera nodes and rename them meaningfully for scripts or presentations. - Select active views:
ca.selectedcan help identify cameras currently in use or focus. - Filtering unused views: Use
not ca.sfto find cameras without the selection flag set and clean them out.
Combining filters with script automation can be valuable for batch processing or preparing pre-set views for simulations and animations.
Conclusion
By isolating camera nodes with smart NSL queries, you can streamline visual management in your molecular workspace. This subtle but helpful capability can save time, reduce mistakes, and maintain a cleaner workspace, especially in multi-view or collaborative projects.
To learn more about camera node attributes in NSL, visit the official documentation: https://documentation.samson-connect.net/users/latest/nsl/camera/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
