Quickly Find the Lights You’re Looking For: Making Sense of Visibility Flags

Molecular modeling projects often involve large, complex multiscale documents that contain a variety of node types—atoms, bonds, groups, surfaces, and lights. Among these, light nodes control global or local illumination, dramatically impacting the way a model is visualized.

But when exploring or debugging a SAMSON model, it can be surprisingly time-consuming to figure out which lights are active, hidden, or temporarily disabled by an internal flag. Understanding whether a light is truly visible can get confusing.

To help, the Node Specification Language (NSL) in SAMSON provides attributes that let you precisely filter and locate light nodes based on their visibility status. This blog post explains how three attributes—visible, visibilityFlag, and hidden—can be combined to answer a surprisingly tricky question: Which lights are actually sculpting your scene?

What Are These Attributes?

NSL lets you apply filters to nodes using structured attribute queries. For light nodes specifically (using the li prefix), there are three attributes that influence visibility:

  • li.v (visible) — This is the easiest one: it evaluates to true if the light is currently visible in the scene.
  • li.vf (visibilityFlag) — A flag that indicates whether the node is internally marked for visibility, but doesn’t factor in user actions like hiding a node.
  • li.h (hidden) — A general-purpose attribute inherited from all nodes that evaluates to true if the light has been manually hidden.

So, visibility isn’t just one flag—it’s the result of a combination. In fact, if li.vf is true but li.h is also true, li.v will still be false. Why? Because hidden nodes override the visibility flag.

Common Use Cases

Let’s go through a few scenarios where filtering lights can save time:

✔️ Find all visible lights

This returns all light nodes that are currently contributing to the render.

🕵️‍♀️ Find lights that are set to be visible, but hidden by the user

This helps identify any lights the system thinks should be visible but are hidden manually—great for debugging visual output inconsistencies.

🧹 Hide all inactive lights

Use NSL in combination with automation or selection to clean up a scene:

You can then hide or delete inactive light nodes to reduce clutter.

Summary Table

Attribute Code Meaning
visible li.v Node is visible in the scene
visibilityFlag li.vf Internal flag for visibility
hidden li.h User has hidden the node

Why It Matters

When you’re troubleshooting a model that “looks wrong,” lights are often the culprits. Maybe a key directional light was hidden by accident, or a previously configured light was disabled via scripting. Using NSL to isolate and inspect lights based on their visibility attributes can save time—and sometimes a headache.

Learn more about light node attributes in the official SAMSON documentation.

SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON at https://www.samson-connect.net.

Comments are closed.