When working with complex molecular systems in SAMSON, it’s easy for your scene to become cluttered. Multiple light sources might be present, either to enhance visualization or due to previously saved configurations. But what if you only want to focus on the visible ones, remove hidden ones, or troubleshoot unexpected lighting? This is where using light attributes in the Node Specification Language (NSL) becomes handy.
The light attribute space in SAMSON allows you to target only light nodes using the short name li. Among various attributes available, controlling visibility is often one of the most useful—especially when troubleshooting scene lighting, rendering issues, or simply decluttering the workspace.
Common Pain Point: Unexpected Lighting
A frequent problem in molecular modeling is identifying which lights in your scene are affecting the visualization. Perhaps you’ve imported multiple molecules or opened a project with many light sources. Not all light nodes are immediately visible in the scene, and manually digging through the node tree to find them can be tedious.
Let’s look at how NSL helps solve this.
Using li.v to Filter Visible Light Nodes
Each light node comes with an attribute called visible (short name: v), which indicates whether that light is visible. Here’s how you can use it:
li.v→ Selects all visible light nodes.not li.v→ Selects all currently hidden light nodes.
With these queries, you can quickly identify and isolate light nodes that are actively illuminating your scene. For example, if a model looks washed out or overexposed and you suspect some forgotten light sources are responsible, using li.v makes it easy to find them.
Visibility vs. visibilityFlag: What’s the Difference?
In addition to visible, light nodes also have a visibilityFlag attribute (vf), inherited from the broader node attributes. While visible reflects whether a light is currently visible in the scene, visibilityFlag references whether the node’s visibility can be toggled at all. Use them together to ensure that light nodes can be appropriately controlled:
li.vf→ Light nodes that are allowed to be shown or hidden.li.vf false→ Light nodes whose visibility cannot be toggled, possibly due to being system-locked.
This makes it easier to filter lights that may be persistent or inherited from locked data structures, and lets you choose which lights to modify or exclude from rendering workflows.
Putting It All Together
For example, to find all light nodes that are visible and modifiable:
|
1 |
li.v and li.vf |
To find hidden lights that are still modifiable and could be turned on:
|
1 |
not li.v and li.vf |
These queries are powerful for managing complex scenes, especially when you’re trying to reduce rendering clutter or create clean visual outputs.
In short, NSL gives you powerful control to explore and manage scene lighting efficiently, saving time and reducing visual confusion.
To learn more about how to use light node attributes in NSL, visit the full documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
