When a molecular scene gets crowded, a small but important task can become surprisingly difficult: finding the light nodes among everything else. The SAMSON Node Specification Language (NSL) offers a focused way to describe lights and filter them by attributes such as name, visibility, and selection state.
The key is the li prefix. It identifies the light attribute space, which matches only light nodes. That gives you a clear starting point: instead of thinking about every kind of node in the scene, first ask a narrower question about lights.
Start with a question, not a long query
When troubleshooting a scene, it helps to check one attribute at a time. For example, li.h searches for lights whose hidden attribute is true, while not li.h expresses the opposite condition. Similarly, li.v and not li.v let you search using the visible attribute.
This one-at-a-time approach makes a useful diagnostic habit: if a light is hard to locate, check the relevant state directly rather than guessing which setting is responsible. The reference lists hidden and visible as separate attributes. It also lists visibilityFlag as its own attribute, with the short name vf. For example, li.vf false searches for lights whose visibility flag is false. Keep these names distinct when choosing what to search for; the reference does not present them as interchangeable.
Use names to narrow the search
If your scene contains several lights, name-based expressions can make a search more specific. The full attribute name is name, and its short name is n. The documentation gives li.n "A" and li.n "L*" as examples. Quotation marks are part of the shown expression format for string values.
A practical sequence is to begin with a broad light query, then try a name expression if you are looking for a particular light. This keeps the search readable and helps you see which part of the expression is doing the work. The examples establish the syntax, but do not assume that a particular naming pattern will fit your scene: use names that reflect how your own model is organized.
Selection has two useful names
NSL lists both selected and selectionFlag for lights. The examples include li.selected, not li.selected, li.sf, and li.sf false. One small detail is easy to miss: selected has no short name in the light attribute space, while selectionFlag uses sf.
That distinction can save time when a query does not look the way you expect. Use the explicit name selected when you mean that attribute; use sf when you mean selectionFlag. The reference says these attributes are inherited from the node attribute space, but that selected does not inherit the short name s for lights.
A compact checklist
- Use
lito target light nodes. - Use
li.hornot li.hto search byhidden. - Use
li.vornot li.vto search byvisible. - Use
li.vf falsewhen searching byvisibilityFlag. - Use
li.n "A"orli.n "L*"as name-expression examples. - Remember that
selectedhas no short name in the light attribute space;selectionFlagusessf.
These small, explicit searches are useful when you need to inspect light nodes without conflating their names, visibility-related attributes, or selection-related attributes. For the complete attribute reference and inherited-attribute details, see the SAMSON light attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
