When a molecular scene contains several lights, a small search problem can interrupt a larger modeling task: Which light is hidden? Which one has the name I remember? And how can I describe the lights I want to inspect without confusing them with atoms, bonds, or other nodes?
SAMSON’s Node Specification Language (NSL) provides a focused way to express these searches. The light attribute space matches light nodes, and its short name is li. That prefix is useful because it makes the intended node type clear at the start of an expression.
Start with the kind of light you need
A useful first step is to narrow a query to lights, then add the attribute that describes what you are looking for. For example, the documented expressions li.h and not li.h distinguish lights according to the hidden attribute. If your immediate question is simply whether a light is hidden, these short forms keep the expression readable.
You can also search by name. The full attribute is name, and its short name is n. For instance, the reference gives li.n "A" and li.n "L*" as examples. Use the name you recognize from your scene, or consult the NSL reference if you need to confirm how name expressions are interpreted.
Keep visibility and selection separate
Light nodes inherit several attributes from the general node attribute space. That means you can also describe lights by whether they are selected, whether their selectionFlag is true or false, whether their visibilityFlag is true or false, and whether they are visible.
These are separate attributes in the reference, so it is helpful to use the one that matches the question you are asking. For example, li.v and not li.v refer to the visible attribute. The examples li.vf false and li.sf false refer instead to visibilityFlag and selectionFlag. The page lists these fields separately; it does not define them as interchangeable. When a result seems unexpected, checking the exact attribute name in your expression is a good first diagnostic.
A practical way to build an expression
- Specify the node type: begin with
liso the query concerns lights. - Add one useful condition: use
hforhidden,vforvisible, ornforname. - Check the full attribute when needed:
selectedhas no short name in the light attribute space, whileselectionFlagusessf. - Expand only when necessary: once a simple expression describes the lights you need, add another condition if your task calls for it.
This approach is useful when you are troubleshooting a crowded scene or trying to make a search expression understandable to a collaborator. A compact expression such as li.h is easy to read at a glance, while the full names in the reference help prevent confusion between similarly named attributes.
For the complete attribute list and examples, see the SAMSON light attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
