Making Lights Work for You: How to Control Light Visibility in SAMSON

When building complex molecular scenes in SAMSON, managing visibility can quickly become a challenge. Especially as molecular models grow in complexity, understanding how elements like light sources are displayed—or hidden—can save time and prevent errors during presentations, publications, or simulations. This blog post focuses on a concise but essential topic: controlling visibility of light nodes using the Node Specification Language (NSL).

Why Visibility Matters in Molecular Modeling

In molecular design and simulations, light nodes help illuminate the scene and are vital for rendering. But sometimes, invisible light sources can still influence your scene, or lights in the frame might create distractions. When your lighting setup starts behaving unexpectedly, it’s often because of a visibility mismatch: a node may be technically present in the data but not visible—or vice versa.

Meet the li Attribute Space

SAMSON uses an attribute space called light (short name: li) to define queries on light nodes. This attribute space allows you to interact with and filter light nodes using keywords and logical operators in NSL.

Key Attributes for Controlling Visibility

The following attributes help you determine if a light node is visible, selectable, or hidden. Here’s a quick table to guide you:

Attribute Short Name Description Examples
hidden h Specifies whether the light node is hidden li.h, not li.h
visible v Whether the light node is visible in the scene li.v, not li.v
visibilityFlag vf Controls visibility via flags (used internally or via UI) li.vf, li.vf false

Use Case: Troubleshooting Missing Lighting in Rendered Scenes

Let’s say you’re preparing a visualization with multiple light sources, but some are not affecting the scene as you expect. The simplest way to begin debugging involves querying the visibility attributes of all light nodes:

This query will return all light nodes that are currently not visible in the scene, even though they technically exist. You can then decide which of these to activate again.

To see which lights are hidden (but might still be running internal computations), use:

Or to list nodes that are marked not selectable with visibility flags off:

Best Practices

  • Use li.v to verify whether lights are actually affecting the render.
  • Combine visibility-related attributes using logical operators to gain deeper control during troubleshooting.
  • Name your light nodes with li.n "Light01" and similar labels to make querying easier, for example: li.v and li.n "KeyLight".

Conclusion

Controlling the visibility of light nodes using NSL can save hours of frustration in molecular design/editing workflows. Whether you’re working on a cinematic render, a scientific illustration, or debugging an issue with lighting, simple visibility queries let you stay in control of your scene composition.

To explore more details about these attributes, visit the official documentation page: 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.

Comments are closed.