What is the Difference Between ‘visible’ and ‘visibilityFlag’ in SAMSON?

When working with large molecular systems in SAMSON, staying organized is essential. One common challenge for molecular modelers—especially those refining complex visualizations for publications, teaching, or simulations—is making sense of what is currently displayed and what is not. This is where SAMSON’s visible and visibilityFlag attributes come into play.

While they sound similar, these two visualModel attributes serve different purposes, and understanding how they work can help you manage your visual model nodes more effectively.

Two Flags, Two Roles

In SAMSON’s Node Specification Language (NSL), visible and visibilityFlag are both boolean values that apply to visual model nodes (short name prefix: vm). However, here’s what sets them apart:

  • vm.v (visible): This controls whether the visual model node is currently being rendered (or not). You can think of this as the actual visibility of the node from the user’s perspective.
  • vm.vf (visibilityFlag): This acts more as a persistent toggle associated with the node’s visibility state. It’s typically used for scripting or conditionally managing visibility in more complex workflows.

Why It Matters

Imagine you’ve created a customized visualization of a large biomolecule, and you want to quickly swap between different representation states—such as hiding solvent molecules or turning off cartoon representations of proteins temporarily. You could rely on vm.v to control this “on/off” state directly. However, using vm.vf can help you retain the visibility preference in more dynamic scenarios, such as toggling representations through scripts or user-defined logic.

How to Use Them

Here are a few example NSL expressions using these attributes:

You’re not limited to using just one; in fact, combining them can reveal deeper insights. For instance:

This expression selects all visual model nodes that are currently visible but have their visibilityFlag set to false. This could indicate a mismatch, possibly due to interaction with other scripts or manual toggling.

Best Practices

While you might often get by using vm.v alone when adjusting the appearance of your model, it’s a good idea to check vm.vf in workflows that involve state saving, multi-step toggle scripts, or collaborative model construction. Keeping both attributes in mind gives you greater control and clarity over what’s being seen—and why.

Understanding this distinction can reduce frustration, especially when nodes mysteriously stay hidden or visible. You’ll also find it easier to manage scene states between different uses—such as exploration, annotation, and presentation.

To learn more about visibility-related attributes and their usage in SAMSON, check out the full documentation here:
https://documentation.samson-connect.net/users/latest/nsl/visualModel/

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

Comments are closed.