Find the lights in your scene without catching everything else

A molecular scene can contain many kinds of nodes. When you need to inspect light nodes specifically, a broad search can be frustrating: you may be trying to check visibility or find a named light, not select unrelated parts of the model. SAMSON’s Node Specification Language (NSL) provides a compact way to describe that search.

The key is the light attribute space, with the short name li. It matches only light nodes. That gives you a useful starting point: add a light attribute to narrow the query to the kind of node you mean, then add a property such as its name, visibility, or selection state.

Start with the scope

For example, li identifies the light attribute space. You can then use the documented attributes to express what you want to inspect:

  • li.v matches lights with the visible attribute set to true.
  • not li.v matches lights for which that attribute is false.
  • li.h and not li.h express the corresponding true and false checks for hidden.

These concise forms can make a query easier to scan, especially when you are comparing several conditions. The full attribute names are available too; the short names are alternatives, not different properties.

Use names to narrow the search

When a scene contains multiple lights, a name condition can make the query more specific. The reference lists li.n "A" and li.n "L*" as examples of using the name attribute. The value is written as a quoted string. If you are unsure which name expression fits your intended match, check the NSL examples and name-attribute documentation rather than assuming how a pattern is interpreted.

Keep similar-looking attributes separate

The light reference includes several attributes inherited from the general node attribute space: hidden, name, selected, selectionFlag, visibilityFlag, and visible. They are listed as distinct attributes, so it is safer to query the one that corresponds to the question you are asking instead of treating their names as interchangeable.

For selection-related checks, for example, the page lists li.selected and not li.selected. It also lists li.sf false and li.sf for selectionFlag. Notice that selected has no short name in the light attribute space; the reference specifically notes that it does not use the inherited short name s. By contrast, selectionFlag uses sf.

A practical way to build a query

When a result is too broad, build the expression in stages: first constrain it to lights with li, then add one documented attribute, and finally add a name condition if needed. For example, a visibility check can be written as li.v; a name-based check can be written as li.n "A". This stepwise approach makes it easier to spot which condition is responsible for excluding a light.

NSL is useful here not because every property has a complicated syntax, but because the attribute space makes the target explicit. You can focus a search on light nodes and express a precise condition without confusing it with a search for other node types.

For the complete attribute list and additional details, see the SAMSON light attributes reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.