When a molecular scene contains many nodes, a small task can become surprisingly fiddly: locating the lights you want to inspect, select, or check without confusing them with other scene elements. SAMSON’s Node Specification Language (NSL) offers a focused way to describe light nodes using the light attribute space, abbreviated li.
The key benefit is specificity. A query beginning with li matches only light nodes. That gives you a clear starting point when you want to reason about lights rather than search among all node types. From there, you can add an attribute to narrow the query.
Start with the question you need to answer
Before writing a query, decide what you are trying to find. Are you checking which lights are visible? Looking for one by name? Separating selected lights from unselected ones? Turning the question into an attribute query makes it easier to inspect the relevant subset instead of scanning the scene manually.
- Check visibility:
li.vmatches lights whosevisibleattribute is true;not li.vexpresses the opposite condition. - Check selection:
li.selectedmatches selected lights, whilenot li.selectedmatches lights that are not selected. - Check a name:
li.n "A"uses the short namenfor thenameattribute. The reference also showsli.n "L*"as an example. - Check hidden state:
li.handnot li.hlet you query the booleanhiddenattribute.
Keep similar attributes distinct
Some light attributes sound related, but they are separate queryable properties. For example, the reference lists both visible (short name v) and visibilityFlag (short name vf). It also lists hidden (short name h). If a query is not answering the question you expected, check which attribute you used rather than assuming these names are interchangeable.
The same care applies to selection. The selected attribute is available for lights, but this attribute space does not give it the short name s. Use li.selected as shown in the reference. By contrast, selectionFlag has the short name sf, so its examples include li.sf and li.sf false.
A simple way to build a query
Begin with the node type, then add the property that expresses your question. For instance, if you want to focus on lights that are not visible, start with not li.v. If you are checking a named light, use the name attribute, as in li.n "A". This small habit—starting with li and choosing the specific attribute—helps keep a query readable and reduces ambiguity about what it is intended to match.
These examples are useful starting points, not a full explanation of every NSL expression or of name matching. For the broader language and inherited node-attribute behavior, consult the relevant NSL references. See the light attribute reference to learn more.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
