Find the Lights in Your Scene Without Losing Your Place

In a molecular scene with many nodes, a small task—finding the light nodes, checking which are hidden, or locating one by name—can turn into a distracting search. SAMSON’s Node Specification Language (NSL) lets you describe light nodes using the light attribute space, abbreviated li. This gives you a focused way to express what you are looking for instead of relying on a visual scan of the scene.

The key detail is that li matches only light nodes. The attributes listed for lights are inherited from the general node attribute space, so familiar node properties such as name, visibility, and selection state are available here too.

Start with the light prefix

In the documented expressions, li identifies the type of node being described. A short name can make an expression compact: for example, the hidden attribute has the short name h, and visible has the short name v. The reference lists these examples:

  • li.h — light nodes matching the hidden attribute.
  • not li.h — the negated hidden expression.
  • li.v — light nodes matching the visible attribute.
  • not li.v — the negated visible expression.

These expressions are useful when you want to focus a search on lights rather than on every node in the document. The attribute table specifies boolean values for both hidden and visible. Because both properties are available, you can choose the one that best describes the question you are asking; the reference treats them as separate attributes, so it is better not to assume they are interchangeable.

Use names to narrow your search

Lights also inherit the name attribute, abbreviated n. Its values are strings in quotes. The reference gives these example expressions:

  • li.n "A"
  • li.n "L*"

These examples show how a name can be included in a light query. If you are working with a scene where lights have meaningful names, name-based expressions give you a way to refer to them directly. The documentation does not define the matching rules for the asterisk in "L*", so treat that as a documented example rather than assuming a particular wildcard behavior.

Watch for the selection-name exception

Most of the listed attributes have a short name: hidden is h, name is n, selectionFlag is sf, visibilityFlag is vf, and visible is v. The selected attribute is the exception for lights: it is inherited from node.selected, but it does not have the short name s in the light attribute space. Use the full form, such as li.selected or not li.selected.

The selection and visibility flags are also distinct listed attributes. The reference provides li.sf false and li.sf for selectionFlag, and li.vf false and li.vf for visibilityFlag. If a query is not behaving as expected, checking the attribute name and whether it has a light-specific short name is a useful first step.

In short: begin with li to limit the attribute space to lights, then use a documented property such as h, v, or n. For selection state, remember to spell out selected. For the complete attribute reference, see the SAMSON light attributes documentation.

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

Comments are closed.