Clearing up confusion: visibility vs. visibilityFlag in SAMSON

When building and analyzing molecular systems in SAMSON, molecular modelers often need to streamline visual elements to keep the workspace clean and insightful. However, confusion sometimes arises between attributes like visible and visibilityFlag in property models. These attributes function differently—and understanding this difference can save you a lot of clicking and second-guessing.✨

This post explains what pm.vf (visibilityFlag) and pm.v (visible) actually mean and when to use each in your NSL (Node Specification Language) filters.

When visible doesn’t mean displayed

In a modeling session, you may want to check whether specific property models—such as density or field representations—are currently visible. Naturally, you might try pm.v for visible, expecting that this would correspond to what’s on your screen. Instead, you might notice inconsistencies 🤔. That’s because pm.v is derived from multiple flags, including pm.vf.

The visibilityFlag (pm.vf) is actually a primary internal flag directly tied to whether SAMSON intends to show the node. Meanwhile, pm.v reflects the overall visibility after evaluating several internal criteria.

How property model visibility is controlled

Here’s how you can filter or modify visibility for property models using the NSL:

  • To find nodes declared as explicitly visible:
    pm.vf (equivalent to pm.vf true)
  • To find nodes that are definitely rendered visible:
    pm.v
  • To exclude hidden models marked internally:
    not pm.vf

For example, if you want to temporarily remove all visible property models from the view, you can use:

to select them, then act using visibility toggling tools. This works better than relying on pm.v because pm.v may be false even though a node is just indirectly hidden by parent state.

Why this distinction matters

Imagine you’re working with 50+ property visualizations in a complex system. You may want to change visibility states in bulk—but if you only check pm.v, some models will be skipped. Using pm.vf instead lets you directly access their visibility settings without relying on inherited flags, which can vary depending on the node hierarchy 🧬.

Better control, faster workflows

Knowing when to use visible vs. visibilityFlag can make your searches more precise and give you deeper control when scripting or filtering models. Consider scripting batch processes or automating view changes: they’ll behave more reliably with explicit flags like pm.vf.

For a full breakdown of the available attributes and short names for property model nodes in NSL, visit the official documentation: https://documentation.samson-connect.net/users/latest/nsl/propertyModel/

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

Comments are closed.