When a molecular scene contains several lights, a small selection mistake can make it harder to work: you may be trying to identify a particular light, check which lights are visible, or find lights that are currently hidden. SAMSON’s Node Specification Language (NSL) lets you describe light nodes by their attributes, so you can focus a query on the lights that match the condition you care about.
The useful starting point is the light attribute space. Its short name is li, and it matches only light nodes. That prefix matters: it keeps a light-focused expression from being confused with a query intended for another kind of node.
Start with visibility
For a quick check of visible lights, use li.v. To find lights that are not visible, use not li.v. These compact expressions are handy when the immediate question is simply whether a light is visible, without specifying its name.
The same page also lists hidden, with the short name h. You can test that attribute with li.h, or negate it with not li.h. Because visible and hidden are listed as separate attributes, it is better to query the property you actually mean rather than treating the two names as interchangeable. The reference describes both as inherited node attributes.
Find a light by name
If you know a light’s name, the name attribute gives you another way to narrow your search. For example, li.n "A" is the documented form for a name value, and li.n "L*" shows another quoted example. Keep the value in quotes: NSL lists names as strings in quotes. The examples show the expression form; consult the relevant NSL guidance for details about how name matching is interpreted.
Keep selection concepts distinct
Light nodes also inherit selected and selectionFlag. The documented expressions include li.selected and not li.selected for selection state, and li.sf or li.sf false for the selection flag. These are separate attribute names, so use the one that corresponds to the condition you want to inspect. One useful detail: selected has no short name in the light attribute space. In particular, the page does not define li.s as its shortcut.
There is a similar pair for visibility: visibilityFlag, abbreviated as vf, can be queried with li.vf or li.vf false. This gives you an explicit way to ask about that flag instead of using the separate visible attribute.
A practical way to approach a light query
- Need lights by visibility? Begin with
li.vornot li.v. - Need to check the hidden attribute? Use
li.hornot li.h. - Know the light’s name? Use
li.nfollowed by a quoted string. - Checking selection or flags? Choose the exact attribute:
selected,sf, orvf.
This habit helps avoid a common source of confusion: several attributes may sound related, but their names and shortcuts are not interchangeable. Start with the precise property you want to inspect, then use the matching expression. 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.
