Find the Camera Nodes You Mean—Without Guessing at the Query

In a molecular modeling scene, it is easy to lose track of which node a search expression is meant to match. If you are trying to identify camera nodes, a small but important detail in SAMSON’s Node Specification Language (NSL) can make the query clearer: use the camera attribute space, abbreviated ca. This space matches camera nodes only.

That restriction is useful when your scene contains many kinds of nodes and you want a query to stay focused on cameras. Rather than relying on a broad node query and then interpreting the results, start with the camera-specific prefix and add only the conditions you need.

Start with a camera-specific expression

Camera attributes use the ca prefix. To query by name, use ca.n, where n is the short name for name. The documentation gives these examples:

  • ca.n "A"
  • ca.n "L*"

These examples show how a name value can be written in quotes, including a value containing an asterisk. If you are unsure whether a particular name expression matches the cameras you expect, try a simple, specific name first and check the result before making the expression broader.

Check state without confusing the attribute names

Camera nodes also inherit the selected and selectionFlag attributes from the node attribute space. Both accept true or false, but they are written differently in NSL:

  • ca.selected checks the selected attribute. The documentation also shows not ca.selected for its opposite.
  • ca.sf uses the short name for selectionFlag; for example, ca.sf false.

A useful query-writing habit is to keep these names distinct. selected has no short name in the camera attribute space, so do not substitute ca.s. By contrast, selectionFlag does have the short name sf. The documentation lists both attributes, but does not define their behavior in this reference; when choosing between them, use the attribute that matches the state you intend to query rather than treating the names as interchangeable.

Build and check queries one condition at a time

When a query returns an unexpected result, simplify it before changing several parts at once. Begin with a camera-specific condition, such as ca.n "A". Then add a state condition, such as ca.selected or ca.sf false, and check the result again. This stepwise approach makes it easier to spot a typo in the prefix, attribute name, or value.

Also remember that these camera attributes are inherited from the general node attribute space. If you already know the node-level forms of name, selected, or selectionFlag, the camera reference helps you adapt them to a camera-focused query. The camera-specific spelling keeps the intended node type visible in the expression.

For the complete attribute table and additional context, see the SAMSON camera attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at samson-connect.net.

Comments are closed.