When a molecular scene gets busy, it can be surprisingly easy to lose track of its cameras. You may want to check a camera by name, or identify whether a camera node is marked selected, without accidentally applying a query to other kinds of nodes. SAMSON’s Node Specification Language (NSL) provides a small, focused set of camera attributes for exactly this kind of filtering.
Start with the camera attribute space
Camera attributes belong to the camera attribute space, whose short name is ca. This space matches camera nodes only. That makes the prefix useful: it states explicitly that the query concerns cameras, rather than nodes in general.
For example, use ca.n "A" to query a camera by its name attribute. The full attribute name is name; n is its short form. The documentation also gives ca.n "L*" as an example of a name expression. Put the name value in quotation marks, as in these examples.
Check selected state carefully
Camera nodes inherit the selected attribute from the node attribute space. You can query it with ca.selected, or negate that condition with not ca.selected. This camera-specific form has no short name: although other inherited attributes may have abbreviations, ca.s is not the documented way to query camera selection.
That small detail can save a frustrating round of trial and error. If a query is meant to find cameras marked selected, use ca.selected. If it is meant to find cameras not marked selected, use not ca.selected. Keeping the ca prefix in both cases makes the target type clear.
Use selectionFlag as its own attribute
There is also an inherited attribute called selectionFlag, with the short name sf. The documented examples are ca.sf and ca.sf false. In other words, you can query the flag directly or specify the false value explicitly.
selected and selectionFlag are listed as separate attributes. The camera reference does not explain how their meanings relate, so it is safer not to assume they are interchangeable. If you are choosing between them, use the attribute that matches the state you intend to inspect, and consult the corresponding node-attribute reference if you need its precise semantics.
A quick camera-query checklist
- Use
cawhen you want the query to match camera nodes. - Use
ca.norca.nameto refer to the camera’s name attribute; provide the value in quotes. - Use
ca.selectedornot ca.selectedto test the selected attribute. - Use
ca.sforca.sf falsefor the selectionFlag attribute. - Do not substitute
ca.sforca.selected; the camera reference specifies no short name for selected.
These distinctions are modest, but they make camera queries easier to read and help avoid applying the wrong attribute or abbreviation when troubleshooting a scene. For the complete reference and related NSL material, see the SAMSON camera attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
