Toggling Property Model Node Visibility in Complex Molecular Scenes

Working on intricate molecular systems often means juggling hundreds or even thousands of nodes. When using SAMSON, it’s common to want to quickly hide or show specific elements to reduce visual clutter or focus on active regions of a structure. But how do you manage this efficiently across large assemblies, particularly for property model nodes?

In this blog post, we’ll explore how to harness the visible and visibilityFlag attributes in SAMSON’s Node Specification Language (NSL) to control the visibility of property model nodes—those that often carry physical properties or annotations tied to your structural models.

Why visibility matters

Imagine you’re developing a multiscale simulation and your workspace is filled with structural parts, electrostatic maps, and other scalar fields. When property model nodes like these get in the way visually, being able to turn them off—without deleting them—is key. Just clicking around in the UI might not cut it if you’re dealing with complex hierarchies. That’s where NSL comes in.

Controlling visibility via NSL

In SAMSON, each node has a set of standard attributes. For property model nodes, visibility can be controlled with:

  • pm.v for the visible attribute
  • pm.vf for the visibilityFlag

These boolean attributes make it possible to include or exclude elements from view using simple queries.

Basic examples

To select all visible property model nodes:

To hide them using a rule in your script or workflow:

If you only want to select those with the visibility flag explicitly set to false (i.e., user-hideable):

What’s the difference between visible and visibilityFlag?

The visible attribute reflects the current rendering state—whether or not the node is being displayed. The visibilityFlag, on the other hand, determines whether you can toggle visibility via the viewer. Think of it as enabling or disabling the ability to toggle visibility from the frontend GUI.

Practical tip 🧪

Before running a high-resolution export or a complex animation, use NSL filters like not pm.v to quickly select hidden nodes and inspect what won’t appear in the render. Similarly, you might use pm.vf false to detect and debug objects that stubbornly refuse to hide because their visibility flag isn’t enabled.

Combining with other attributes

Want to find all hidden property model nodes that own materials?

Or target only named property models starting with “Electro*” that are currently shown?

Conclusion

NSL provides streamlined control over visibility in SAMSON, which is especially useful when your scene’s complexity exceeds what your screen—or brain—can handle visually. By understanding pm.v and pm.vf, you regain control over what gets displayed, and keep your projects organized and focused.

To learn more, visit the official documentation page on Property 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.