When working with complex molecular systems in SAMSON, clarity is essential. Whether you’re a molecular modeler fine-tuning a protein’s conformation, or visualizing docking results, chances are your screen might feel cluttered. Being able to control what you see — and what you don’t — can make a huge difference in focus and performance.
The Visual Model (vm) attribute space in SAMSON’s Node Specification Language (NSL) offers a way to filter, control visibility, and refine how models are displayed. With a few well-placed expressions, you can select only what matters.
Why visual model filtering matters 🚀
Rather than manually clicking through a complex hierarchy of structural elements to hide, show, or check their status, visual model attributes allow you to programmatically capture exactly what you need. This is especially useful when working with large biomolecular assemblies, multi-model simulations, or during presentations where clarity is vital.
Useful attributes in the vm space
Here are some of the core visual model attributes you can use, all prefixed with vm. to indicate you’re targeting visual model nodes:
vm.v– Is the node visible?vm.h– Is the node hidden?vm.selected– Has it been selected by the user?vm.vf– Is the visibility flag set?vm.sf– Is the selection flag set?vm.hm– Does the model have an associated material?vm.om– Does the node own its material?vm.n– Filter by name string (e.g.,vm.n "Surface*")
Common usage examples
Let’s say you only want to select visible visual models:
|
1 |
vm.v |
Want to find everything named with a particular prefix?
|
1 |
vm.n "Helix*" |
Perhaps you’d like to hide all visual elements that don’t currently own a material:
|
1 |
not vm.om |
Because these attributes are inherited from more general node attributes, their usage is intuitive — but a few come with caveats. For example, vm.selected doesn’t get a short alias like other attributes. Always refer to the documentation if unsure.
Faster workflows and cleaner scenes
If you’re preparing images for publication or working on video animations using SAMSON, visual model attribute filters make it easier to ensure consistency. You can apply these expressions directly in selection editors or script them in automation workflows.
Maybe you’re debugging a visual glitch — filter only the elements with or without materials. Maybe you’re developing your own Extension — use visual model filters to test model visibility behavior.
This approach is not just about aesthetics; it can have noticeable performance benefits, too. Hiding unnecessary models reduces rendering load and increases system responsiveness on larger projects.
To learn more about the visualModel attribute space and its full list of attributes, head to the official documentation: https://documentation.samson-connect.net/users/latest/nsl/visualModel/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
