Quickly Find and Manage Light Sources in Your Molecular Scene

When working on molecular visualizations or simulations that require precise lighting – such as preparing materials for publication, generating videos, or highlighting structural details – lighting can make or break the viewer’s experience.

In complex scenes with many elements, selectively hiding, showing, naming, or isolating individual light sources can become a tedious process. Fortunately, SAMSON provides a powerful, domain-specific query system to streamline this task: the Node Specification Language (NSL).

Why light nodes matter in molecular modeling

Lighting nodes in SAMSON are used to illuminate models and highlight their spatial structures. A well-placed light helps visualize folds in proteins, cavities in molecular assemblies, or relative positions in 3D space—especially when rendered with shading or transparency.

As projects grow, users often add multiple directional lights, point lights, or even shadows. Without effective filtering or toggling tools, they must visually inspect the node hierarchy, guessing which light is doing what. Frustrating? Definitely.

Use NSL to regain control

SAMSON’s NSL lets you target specific node types. For lights, the attribute space is light, with short name li. You can combine this with logical filters to query, edit, or toggle light nodes without slowing down your flow.

Here are some real-world tricks using the NSL light attribute space:

✅ Hide all lights

This disables visibility for all light nodes. Useful when comparing light-on and light-off scenes or exporting clean models.

✅ Show only lights starting with ‘L’

Target light nodes whose names begin with ‘L’ — e.g., ‘Light1’, ‘LampTop’. Naming your lights pays off here.

✅ Select only visible lights

Filters your selection to only those lights currently visible, so you’re not editing invisible sources by mistake.

✅ Check which lights are currently hidden

Returns lights that are turned off. This is a fast way to troubleshoot a dark or overlit rendering.

Inherited attributes simplify light filtering

Lights also share generic node attributes (like hidden, selectionFlag or visible). As a result, the same field operators you apply to atoms or groups also work with lights.

Here’s a summary of useful filters with short names you can use:

Attribute Short Name Example
hidden h li.h
name (string) n li.n "Spot*"
selected li.selected
selectionFlag sf li.sf false
visibilityFlag vf li.vf
visible v li.v

This combinatorial querying approach saves time and avoids misclicks. You can interactively manage dozens of light nodes in sleek queries rather than hunting through node trees one by one.

To learn more and find complete examples, 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. Download it at https://www.samson-connect.net.

Comments are closed.