When a molecular scene contains several lights, small housekeeping tasks can take longer than expected: finding one by name, checking which lights are visible, or narrowing attention to lights that are selected. Node Specification Language (NSL) offers a text-based way to query light nodes instead of relying only on visual inspection.
This guide focuses on a useful, self-contained subset of the light attributes in SAMSON: names, visibility, hidden state, and selection state. The examples are filters to try when you need to locate or inspect lights; they do not change a light’s settings by themselves.
Start by targeting light nodes
Light attributes live in the light attribute space, whose short name is li. That prefix matters: it makes the query specifically about light nodes. The examples below use the short prefix for brevity.
Find a light by its name
If you know a light’s name, search using the name attribute, n, followed by a quoted string:
|
1 |
li.n "A" |
The documentation also gives this example:
|
1 |
li.n "L*" |
These examples show how to write a name-based expression, but do not specify the detailed matching rules for characters such as *. If you are relying on a pattern rather than a literal name, check the results in your SAMSON version instead of assuming how that character is interpreted.
A practical habit is to use recognizable names for lights when you create or organize a scene. Then a short name query can help you return to the relevant node without needing to remember where it appears in the scene.
Check visibility and hidden state separately
To query lights by visibility, use v or the full attribute name visible:
|
1 2 |
li.v not li.v |
Likewise, the hidden attribute has the short name h:
|
1 2 |
li.h not li.h |
These are separate attributes in the reference. That distinction is useful when troubleshooting a light you cannot see: rather than treating “hidden” and “not visible” as interchangeable terms, query the property you actually want to inspect. The documentation lists the possible values for each as true and false.
Inspect selection state
You can also filter for selected lights with li.selected, or for lights that are not selected with not li.selected. The light-specific reference notes that this inherited attribute does not have the short name s, so use the full word selected here.
Two related attributes are selectionFlag and visibilityFlag, abbreviated sf and vf. The reference provides examples for testing them with and without an explicit false value:
|
1 2 3 4 |
li.sf false li.sf li.vf false li.vf |
They are distinct from selected and visible in the attribute list. When you need one of these flags, query it by its own name rather than substituting a similarly named state.
A simple, reliable workflow
- Begin with a light-specific prefix such as
li. - Add one attribute that matches the question you are asking: name, hidden, visible, selected, or a flag.
- Use
notwhen you want the opposite of a Boolean condition, as shown in the documented examples. - Keep the query focused while diagnosing a scene. Testing one condition at a time makes it easier to understand which attribute is responsible for the result.
This approach is especially handy when a scene has enough lights that visual scanning becomes unreliable. A few short expressions can help you locate candidates and check their documented attributes without confusing a name match with a visibility or selection condition.
For the complete list of light attributes and their examples, see the SAMSON light attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
