Find the Light in a Busy Scene: A Practical Guide to Light Queries

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.v matches lights whose visible attribute is true; not li.v expresses the opposite condition.
  • Check selection: li.selected matches selected lights, while not li.selected matches lights that are not selected.
  • Check a name: li.n "A" uses the short name n for the name attribute. The reference also shows li.n "L*" as an example.
  • Check hidden state: li.h and not li.h let you query the boolean hidden attribute.

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.

Comments are closed.