Stop Wasting Time on Invisible Molecular Data: Use visibility flags the smart way

When working with large and complex molecular systems, it’s common to hide parts of the model to reduce visual clutter or focus on a specific region. But if you’ve ever found it confusing to manage visibility in SAMSON, especially when scripting with the Node Specification Language (NSL), you’re not alone.

In NSL, understanding the difference between what appears hidden and what is truly invisible can save hours of confusion when filtering, selecting, or editing nodes in complex models. This post will clarify two important attributes—visible and visibilityFlag—from the visualModel attribute space in SAMSON’s NSL, so you can make better decisions about visual filtering in your molecular designs.

What’s the Difference?

visible (vm.v) and visibilityFlag (vm.vf) may seem similar but they serve slightly different purposes in SAMSON.

  • visible: Indicates whether the node is currently visible or not. This is the end result after evaluating all visibility conditions.
  • visibilityFlag: A user-defined flag that can be used to set or unset visibility, but the final visibility (visible) might also depend on other factors like parent visibility.

This subtle difference can be powerful when you’re filtering molecular structures for rendering, selection, or export operations.

Example Use Cases

1. Filter Only Visible Visual Models

If you want to select or process only elements that are currently visible, use:

This will give you only those nodes that are actually rendered on screen, taking into account all inherited and composite visibility properties.

2. Identify Nodes Explicitly Marked Hidden by User

To find nodes with the visibility flag turned off, regardless of inherited visibility, use:

This is useful when you want to toggle visibility back on for only those items that a user explicitly hid, not those hidden because their parent is hidden.

3. Filter Overridden Child Nodes

Suppose you want to find visual models that users explicitly made visible—even when their parent node is hidden. You can combine flags:

This helps discover inconsistencies or intentional user overrides in complex hierarchies.

Use it in Automation and Search

These attributes are especially useful in scripts and automations. Say you want to ensure that only visible atoms are exported to a file—you can define a search with vm.v to make sure hidden parts aren’t saved unnecessarily.

You can also tag unhidden visual elements for inspection later. For example:

This will tag all currently visible visual models with a label, enabling you to revisit them quickly.

Conclusion

By clearly differentiating between vm.v and vm.vf, you can step up your workflow, manage visual complexity more efficiently, and reduce errors caused by unintentional node hiding. Whether you’re cleaning up a messy scene or preparing your model for presentation, mastering visibility filtering can bring clarity to your system, both figuratively and literally.

To learn more, visit the official SAMSON documentation on visual model attributes.

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

Comments are closed.