When working on complex molecular models in SAMSON, even the smallest detail can affect your workflow. One of those details — often overlooked but incredibly helpful — is the fine control over light node visibility. Whether you’re rendering scenes for publication or adjusting lighting to better visualize a molecular structure, knowing how to manage visibility efficiently can save time and reduce frustration.
In SAMSON’s Node Specification Language (NSL), light nodes have their own attribute space — called light, or li for short. Within this namespace, several visibility-related attributes help users select and manage light nodes programmatically. These include:
li.hiddenli.visibleli.visibilityFlag
What’s the Difference?
At first glance, one might think that hidden, visible, and visibilityFlag all mean the same thing. But they differ in use and behavior:
- hidden: This attribute, inherited from
node.hidden, takes a boolean value. Ifli.histrue, the light node is hidden from the scene. You can use it like this:li.hornot li.h. - visible: Also a boolean attribute, but this one is the inverse of
hidden. Usingli.vis equivalent to checking if the node is visible. Sonot li.vis a quick way to find hidden light nodes. - visibilityFlag: Represented by
li.vf, this flag determines whether the light node’s visibility is allowed to be toggled. For instance,li.vf falseindicates that the node’s visibility cannot be changed from the UI and may only be modified programmatically.
Why It Matters in Practice
Suppose you’re creating an animation with intricate lighting effects. You may want certain lights to appear only in specific frames. Rather than clicking through the interface to toggle lights manually — which isn’t practical if you’re managing 10+ light nodes — a simple NSL query like li.v can immediately show all currently visible light nodes. You can then selectively adjust those either through scripting or using SAMSON’s selection tools.
Another scenario: Let’s say you’re sharing your model with a colleague and want to ensure specific lights are locked in place. By turning the visibility flag off — li.vf false — you prevent accidental changes to those nodes.
Tips for More Control
- Combine filters: Find visible lights with specific names using a query like
li.v and li.n "Spot*". - Invert selection: Want to quickly hide all active lights? Use
not li.hto find visible nodes, then toggle them. - Double-check flags: If visibility toggling isn’t working as expected, inspect
li.vfto make sure the flag isn’t blocking changes.
By learning to navigate these visibility attributes effectively, you gain fine-grained control over one of the most essential components of molecular visualization: lighting.
To learn more about light node attributes, visit the original documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
