Find the Right Camera Without Catching Other Nodes

When a molecular scene contains several cameras, a broad search can make it easy to target the wrong one. The useful detail in SAMSON’s Node Specification Language (NSL) is that camera attributes live in a dedicated camera attribute space, abbreviated ca. That space matches only camera nodes, so you can make the kind of node you want to find explicit before checking its attributes.

Start by narrowing the target

Use ca as the prefix for camera-specific searches. For example, ca.n "A" uses the short name n for the inherited name attribute. The documentation also gives ca.n "L*" as an example. These expressions help you describe a camera by name while keeping the search in the camera attribute space.

This is a practical habit when you are writing or revising an expression: include the node type in the query rather than relying on a name alone. A name may be meaningful to you, but the ca prefix makes the intended node category clear in the expression itself.

Use the full attribute names when clarity matters

The camera attribute list includes three inherited attributes: name, selected, and selectionFlag. Their short forms are not identical in availability:

  • name can be written as n.
  • selectionFlag can be written as sf.
  • selected has no short name in the camera attribute space.

So, to test the selected state, use ca.selected, or negate it with not ca.selected. Do not substitute a short form such as ca.s for this camera attribute: the documentation specifically notes that selected is inherited without the short name s.

Make boolean checks readable

For selected and selectionFlag, the possible values are true and false. The documented examples include ca.sf and ca.sf false, as well as ca.selected and not ca.selected. These give you both a direct check and an explicit false-value form for the selection flag.

When an expression is shared with a colleague—or revisited later—prefer the spelling that makes your intention easiest to recognize. For example, ca.selected communicates a selected-state check directly, while ca.sf false names the selection-flag attribute and its requested value. The page lists both attributes, but does not define them as interchangeable, so keep their names distinct rather than assuming one means the other.

A small checklist for camera expressions

  1. Begin with ca when you want to match camera nodes.
  2. Use ca.n or ca.name to refer to the camera’s name.
  3. Use ca.selected for the selected attribute; it has no camera short name.
  4. Use ca.sf or ca.selectionFlag for the selection flag.
  5. Check that quoted name strings and boolean values match the expression you intend to write.

The benefit is less guesswork: the expression tells you both which node category you mean and which inherited attribute you are checking. For the complete reference and related NSL material, see the camera attributes documentation.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.