When working on complex molecular systems, it’s common to have many nodes in your document—molecules, visual representations, graphs, and of course, cameras. As scenes grow, so does the need for clarity and structure. But how do you find the right camera, especially when there are dozens or even hundreds of other nodes?
This is where camera attributes in the NSL (Node Specification Language) in SAMSON can help. Whether you’re preparing figures, setting up animations, or managing custom views, being able to target precisely the camera node(s) you want can save time and reduce complexity.
Why camera filtering matters
Say you’ve created several cameras to capture different perspectives of a molecular reaction sequence. Later, you want to find all cameras whose names start with “L” (e.g., “Lateral View”, “LysineFocus”) to generate exports—but these cameras are buried among dozens of other nodes. With NSL, you can filter them quickly using:
|
1 |
ca.n "L*" |
This simple line selects camera nodes (ca) whose name (n) starts with “L”. The wildcard * lets you filter by prefix.
Using selection flags to isolate cameras
Sometimes, certain cameras are only used as bookmarks or intermediary views and should be excluded from export or animation. You can mark these cameras by toggling their selectionFlag and later isolate them:
|
1 |
ca.sf false |
This means: filter all camera nodes whose selectionFlag is false. If you’re selecting for rendering, combine conditions:
|
1 |
ca.n "Snapshot*" and ca.sf |
This targets all cameras whose names start with Snapshot and are marked with a true selection flag.
Selecting currently selected camera nodes
During editing, you can select camera nodes manually and then apply NSL commands to only those selected cameras:
|
1 |
ca.selected |
This way, you can manually prepare a working set of cameras and compose queries on the fly—like applying changes only to selected views.
Combining filters for advanced workflows
Let’s say you want all selected cameras whose name does not start with “L” and are flagged:
|
1 |
ca.selected and not ca.n "L*" and ca.sf |
If you’re exporting camera frames or preparing an automated visualization workflow, this level of filtering can help you avoid mistakes and process batches efficiently.
Understanding inherited attributes
Camera attributes come from the generic node attribute space but get their own namespace: ca. While basic fields like name and selectionFlag are directly inherited, the selected attribute exists without the short alias (s) in this context. This distinction is helpful when scripting or integrating with larger NSL queries.
By using these tools, molecular modelers can streamline their scene organization, reduce clutter during presentations, and ensure reproducibility for exported visuals or automated analysis pipelines.
To learn more about how to use these filters and attributes in your own workflows, explore 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.
