Working with complex molecular scenes often means toggling various types of nodes on and off to simplify visualization, focus on relevant components, or prepare publication-ready images. While atoms and molecules get most of the attention, lighting nodes play a crucial but often overlooked role in how scenes are rendered and perceived in SAMSON, the integrative molecular design platform.
If you’ve ever struggled to manage the lighting in your molecular models, especially when juggling multiple light sources, this short guide will help you gain more control using SAMSON’s Node Specification Language (NSL). We’ll focus on visibility-related attributes of light nodes, which belong to the light (short name: li) attribute space.
Why Controlling Light Node Visibility Matters
Sometimes, the effect of a light node isn’t immediately obvious — it might wash out your molecule, cast unwanted shadows, or be completely redundant. Turning lights off one by one through the graphical interface is slow and can interrupt your workflow. NSL lets you standardize and automate how you show or hide light elements.
The Essentials: Visibility-Related Attributes
Below are the relevant attributes used to control visibility of light nodes in SAMSON, and how to use them with the NSL:
| Attribute | Short Name | Example Query |
|---|---|---|
| visible | v |
li.vnot li.v |
| visibilityFlag | vf |
li.vfli.vf false |
| hidden | h |
li.hnot li.h |
How They Differ
li.v— Indicates whether the light node is currently visible. Usenot li.vto select hidden light nodes.li.vf— Controls whether a node can be visible, depending on other display conditions like scene settings or hierarchy constraints.li.h— A generic hidden attribute, inherited from parent node class. It’s good for general hiding but may overlap in meaning withli.v.
Quick Use Cases
Let’s say you want to turn off all visible light nodes in your current document:
|
1 |
not li.v |
Or maybe you’d like to identify all lighting elements that have been manually hidden:
|
1 |
li.h |
And if you’re preparing a presentation and only want a specific light source, you could use:
|
1 |
li.n "Key Light" and li.v |
… to make sure only that light source is active and visible.
Tips
- Use these queries in combination with selection tools to rapidly adjust which light nodes appear or disappear.
- Combining with attributes like
name(li.n) gives you even more precise control when working with multiple light types like ambient, directional, or spot lights.
As your scenes get more intricate, fine-tuning the visibility of light elements can help you debug lighting setups or create better-quality renderings without needing to sift through panels or folders manually.
Explore the full light attribute documentation here.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
