When working on a complex molecular model, fine-tuning lighting is essential for both clarity and presentation. However, with multiple light nodes in your model, it can become frustrating to identify the lights you want to adjust — especially if they were added automatically and named generically. Even more challenging is trying to manage visibility settings efficiently without combing through the entire node hierarchy manually.
This is where the Node Specification Language (NSL) in SAMSON can help. If you’re not yet using NSL to search and filter nodes — especially light nodes — you might be spending more time than needed adjusting lighting setups. Let’s take a look at how the light attribute space in NSL can simplify this part of your workflow.
Efficient Filtering of Light Nodes
In NSL, light attributes are represented within the li attribute space. For example, all light-related nodes are accessible using selectors that start with li.. This lets you quickly isolate lights in your document using simple expressions.
Example: Show All Visible Lights
To find all visible light nodes in your project, you can use:
|
1 |
li.v |
This query matches every light node that is currently visible. If you’re trying to see only the lights that are affecting your scene, this gets the job done instantly.
Example: Hide All Visible Lights
Need to quickly hide all light sources? Combine the previous query with a visibility toggle:
|
1 |
not li.v |
Example: Select Lights by Name
Lights are often named using default patterns like Light1, Light2, etc. With NSL, you can use wildcards to match based on name:
|
1 |
li.n "Light*" |
If you want to find a specific named light, use:
|
1 |
li.n "OverheadLight" |
This becomes especially useful as your scene grows and managing lights by position or intensity becomes less practical than using names.
Controlling Selection and Visibility Flags
In addition to visibility, SAMSON NSL lets you query and filter by specific flags:
li.sf— selection flagli.vf— visibility flag
For example, to find all light nodes that are currently in the scene but not selected, you can write:
|
1 |
li.v and not li.sf |
This lets you quickly analyze which lights are affecting the model but haven’t been selected yet — useful for when you’re trying to track down that one light that’s still changing shadows or highlights.
Why It Matters
Lights are vital for rendering structure, mood, and visibility in molecular models. Misplaced or redundant light sources can dramatically alter perception and introduce confusion when reviewing results. NSL’s fine-grain control over visibility and selection simplifies debugging your lighting setup.
Learning to use expressions like li.v, li.n "L*", and not li.h makes it easier to audit your light system and focus on meaningful adjustments — without needing to manually search through every node in the document.
To explore more light node attributes and learn how they inherit from general node attributes, visit the original documentation page: https://documentation.samson-connect.net/users/latest/nsl/light/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
