One of the common challenges molecular modelers face is managing complex scenes filled with numerous nodes — atoms, molecules, property models, and materials. A cluttered viewport can slow down analysis, impact rendering performance, and simply make it harder to focus. Wouldn’t it be helpful to quickly control what is visible, and what is hidden, at a granular level?
In SAMSON, property model nodes — which encapsulate materials, visual properties, and more — can be filtered and analyzed using the propertyModel attribute space in the Node Specification Language (NSL). To manage visibility efficiently, it helps to understand four specific attributes related to display and selection:
hidden(pm.h)visible(pm.v)visibilityFlag(pm.vf)selectionFlag(pm.sf)
Let’s break these down and explain how they help you customize your view in SAMSON.
Understanding the Difference Between Visibility Flags and State
visible and hidden may sound like opposites, but in SAMSON’s NSL, they are controlled separately depending on native attributes and hierarchy. For example:
pm.v returns all property models that are currently visible.
not pm.v returns those that are not currently visible.
pm.h tests if an object is explicitly marked as hidden. This flag can act independently of actual visibility: a node might be invisible because its parent is hidden or because it resides in a collapsed part of the hierarchy.
Example Use Cases
Want to find and select only the property model nodes that are currently showing in your scene (i.e., visible and not hidden)? You can use:
|
1 |
pm.v and not pm.h |
Looking to hide all currently visible property model nodes with materials?
|
1 |
pm.v and pm.hm |
Then you could manipulate these nodes via script or hide them using SAMSON’s interface.
What About visibilityFlag?
visibilityFlag (pm.vf) is an explicitly set flag. It labels a property model as intended to be visible, regardless of parent node behavior. For example, a property model might carry vf true but still be technically invisible due to hierarchy settings.
To find all future candidates for display (i.e., those marked visible even if hidden by parent):
|
1 |
pm.vf true |
Selection Visibility
SAMSON also allows checking the selection visibility intention using selectionFlag (pm.sf). If you want to find all property models that are meant to be selectable but perhaps aren’t currently displayed:
|
1 |
pm.sf true and not pm.v |
Conclusion
By combining these attributes, you get much more control over what appears in your workspace. Whether filtering nodes to increase render performance or to focus on specific materials or visual effects, mastering visibility-related node queries saves time and offers powerful customization.
Learn more about working with propertyModel attributes in SAMSON here: documentation.samson-connect.net/users/latest/nsl/propertyModel/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
