In a molecular modeling scene, it is easy to lose time looking for the right camera node—especially when names are similar or you need to check which cameras are selected. SAMSON’s Node Specification Language (NSL) lets you describe camera nodes with concise expressions, so you can target them by name or inspect selection-related attributes.
The key is to use the camera attribute space. Its short prefix is ca, and it matches only camera nodes. That prefix makes your intent explicit: you are querying cameras, rather than nodes of some other type.
Start with the camera’s name
Camera nodes inherit the name attribute from the general node attribute space. In a camera query, the short form is n, and the value is written in quotation marks:
ca.n "A"ca.n "L*"
These examples are useful starting points when you know a camera’s label, or want to investigate a name expression shown in the documentation. Keep the quotation marks around the name value; they make it clear that the expression is testing a string.
A practical habit is to check the name expression on its own before adding other conditions. If it does not identify the camera you expect, reconsider the spelling or the name pattern rather than immediately adding more query logic. This keeps the question you are asking simple and makes it easier to spot a mismatch.
Check selection state explicitly
Camera nodes also inherit selected and selectionFlag. Both use Boolean values, but their NSL forms are not identical:
ca.selectedchecks the selected attribute.not ca.selectedexpresses the opposite condition.ca.sfuses the short name forselectionFlag.ca.sf falseexplicitly supplies the valuefalse.
One easy detail to miss: selected has no short name in the camera attribute space. Do not substitute a guessed abbreviation such as s; the documented camera form is ca.selected. By contrast, selectionFlag does have the short form sf.
Keep the two attributes distinct
The reference lists selected and selectionFlag as separate inherited attributes. When you are diagnosing a selection-related result, query the attribute you actually mean instead of treating the two names as interchangeable. For example, if your question is “which camera nodes match the selected attribute?”, use ca.selected. If you need to inspect the selection flag, use ca.sf or ca.sf false.
This distinction is especially helpful when you are checking a scene state and the result is not what you expected. Rather than changing the scene or guessing at a selection issue, state the condition precisely in the query. The expression then documents what you intended to check, which also makes it easier to repeat the same check later.
A small, reliable workflow
- Use the
caprefix to limit the query to camera nodes. - Use
ca.nwith a quoted string when checking a camera name. - Use
ca.selectedornot ca.selectedwhen checking the selected attribute. - Use
ca.sfwhen checkingselectionFlag, and includetrueorfalsewhen you want to state its value explicitly.
These expressions give you a precise way to describe camera nodes without relying on visual guesswork. They are also small enough to inspect at a glance: the prefix identifies the node type, and the attribute tells you what property you are checking.
For the complete attribute reference and additional NSL resources, see the SAMSON camera attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
