In molecular modeling projects, especially when dealing with large biomolecular assemblies or complex simulations, the visual scene can quickly become cluttered. One underappreciated source of visual clutter – or confusion – is light nodes. Sometimes, users unknowingly create or import lighting configurations that interfere with visualization. Other times, lights are disabled, and users struggle to find and modify them.
The Node Specification Language (NSL) in SAMSON provides a powerful environment to filter and control nodes. If you’ve ever needed to quickly find all the hidden lights in your document – or selectively switch visibility states – SAMSON’s NSL makes this surprisingly straightforward.
Working with Light Nodes
In NSL, light nodes have their own attribute space: light, or li for short. You can use this to identify and manipulate light sources using conditions on their attributes.
Let’s say you want to find all hidden lights. You can do that using:
|
1 |
li.h |
This query returns all light nodes where the hidden attribute is true.
Checking Visibility States
Sometimes a light is not technically hidden but just not affecting the scene because its visibilityFlag or visible attribute is off. To explore this, try:
|
1 |
not li.vf |
|
1 |
not li.v |
These queries help separate visual issues due to node flags rather than actual node status, especially helpful when importing external scenes that may have different lighting configurations.
Naming and Filtering with Wildcards
If your lights are named consistently during setup, filtering becomes even easier. To find all lights with names starting with L_ you can write:
|
1 |
li.n "L_*" |
Combining this with visibility filters creates a powerful way to control light configurations with minimal effort:
|
1 |
li.n "L_*" and not li.v |
Common Use Cases
- Debugging scene illumination: Not sure why a model renders dark or inconsistently? Look for
li.hornot li.vf. - Custom render setups: Define views where only specific lights are active by setting
li.vorli.vf. - Scene cleanup: Identify stray or unnecessary lights by their name or selection flag.
With these strategies, you can eliminate a lot of confusion caused by unseen or misconfigured lights and focus more on what matters: your models.
Learn more in the documentation: https://documentation.samson-connect.net/users/latest/nsl/light/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
