When a molecular scene gets busy, it can be surprisingly easy to lose track of its light nodes. A light may be hidden, not visible, or simply hard to identify by name. Instead of searching the scene manually, use SAMSON’s Node Specification Language (NSL) to make your criteria explicit and easier to reuse.
This guide focuses on the light attribute space: a set of attributes that matches only light nodes. Its short name is li. The examples below are useful starting points when you want to narrow your attention to lights by visibility-related state, selection state, or name.
Start with the light prefix
In the expressions shown here, li identifies the light attribute space. For example, li.h uses the short name for the inherited hidden attribute. The corresponding expression not li.h expresses the opposite condition. Keeping the prefix in each expression makes it clear that you are querying lights, rather than nodes in general.
For a quick visibility-oriented check, compare these expressions:
li.handnot li.hfor thehiddenattribute.li.vandnot li.vfor thevisibleattribute.li.vfandli.vf falsefor thevisibilityFlagattribute.
These are separate attributes in the reference, so it is useful to query them separately rather than treating their names as interchangeable. If a result is not what you expected, try one expression at a time and check which condition changes the set of matching lights.
Use names to narrow the search
When a scene contains several lights, a name-based query can make the search more manageable. The name attribute accepts strings in quotes. The reference gives li.n "A" and li.n "L*" as examples, where n is the short name for name.
A practical habit is to begin with the name you know, then add other conditions only if you need a smaller result set. For example, keep li.n "A" as a name-focused query, or inspect the visibility-related attributes separately using the expressions above. This stepwise approach helps you see which part of a query is responsible for narrowing the matches, rather than starting with a long expression that is harder to debug.
Check selection without guessing a shortcut
The light attribute reference includes both selected and selectionFlag. For selection state, use li.selected or not li.selected. The documentation specifically notes that selected does not have the short name s in the light attribute space.
For selectionFlag, the short name is sf; the reference lists li.sf and li.sf false. Using the full attribute name for selected avoids assuming that a familiar shortcut from another attribute space applies to lights.
A small, repeatable workflow
- Start with the light scope: use the
liprefix. - Choose one attribute to investigate, such as
li.h,li.v, orli.selected. - If needed, narrow by name with a quoted string, such as
li.n "A". - Test the opposite condition with the documented negated forms where available, such as
not li.v. - Keep the expression that answers your immediate question, and add conditions one at a time when refining it.
The main benefit is clarity: a short query can turn “Where did that light go?” into a specific check of light nodes and one documented attribute. The same approach is useful when reviewing a scene or writing down a repeatable search for later.
For the complete list of light attributes and examples, see the SAMSON light attribute reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
