As a molecular modeler, you’ve likely experienced the challenge of navigating complex molecular systems filled with overlapping nodes, materials, and annotations. Whether you’re visualizing conformational changes or preparing a figure for publication, being able to quickly control what’s visible in your workspace can make a huge difference in productivity and clarity.
This is where the property model attributes in the Node Specification Language (NSL) within SAMSON come in. They offer a concise yet powerful way to programmatically filter, query, and organize the visibility of property model nodes. If you’ve ever struggled to isolate specific elements or hide clutter in rich molecular scenes, this post is for you 👇
Controlling Visibility with NSL
The NSL’s property model attributes include several specifically tailored for visibility management:
pm.v– short for visible: Is the node currently rendered?pm.vf– short for visibilityFlag: Should visibility be inherited or overridden?pm.h– short for hidden: Is the node explicitly marked as hidden?
Each of these allows granular control over what appears in your scene. Consider a situation where you only want to see nodes that are both visible and not explicitly hidden. You can filter them using:
|
1 |
pm.v and not pm.h |
This query highlights everything that is currently being displayed and not marked as hidden, streamlining your view without manual toggling.
The Subtle Difference: visible vs. visibilityFlag
It’s important to understand that visible and visibilityFlag are not the same.
visible (pm.v) tells you whether the property model is currently shown. It depends on several factors including its place in the hierarchy and other flags. On the other hand, visibilityFlag (pm.vf) allows you to control whether the node’s own visibility should be respected or if it should inherit visibility from its parent.
To find all nodes that have opted out of visibility inheritance, you can use:
|
1 |
pm.vf false |
This is especially useful in collaborative projects where you want your annotations or custom properties to behave independently, regardless of the visibility status of parent groups or structures.
Why Does This Matter?
Features like these can save time when preparing datasets, analyzing results, or creating illustrations. By using NSL to filter based on visibility attributes, you reduce screen clutter and focus only on what’s essential. These attribute filters also make it easier to script customized workflows, automate selections, or debug scenes where objects are inexplicably missing or shown.
If you’re managing a complex molecular system with hundreds of overlapping annotations or simulating environments with different visibility scopes, these NSL filters are essential tools in your toolkit.
Want to Explore More?
You can read the full documentation about all property model attributes, including additional examples and edge cases, at the official SAMSON documentation page: https://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.
