When working with complex molecular scenes in SAMSON, it’s common to end up with dozens, even hundreds of visual model nodes representing atoms, bonds, surfaces, isosurfaces, meshes, and more. As the project grows, things can become visually overwhelming — or, on the opposite end, certain models may become invisible or hidden from view without any easy way to track them down. 🔍
If you’ve ever found yourself wondering, “Why can’t I see this model I was just working on?”, or “Do I have any unnecessary hidden elements cluttering the scene?” you’re not alone. Fortunately, there’s a simple and powerful answer within the Node Specification Language (NSL) — a concise, query-based system integrated in SAMSON that lets you search and manipulate nodes using readable code-like expressions.
Finding Hidden Visual Models 🕵️
Each visual model node in SAMSON can have a hidden state, corresponding to whether it’s intentionally hidden from rendering in the viewport. This is different from being deleted — the item still exists, and could still be used in computations or referenced — but it’s not shown visually.
To filter for hidden nodes, use the vm.h attribute in NSL:
|
1 |
vm.h |
This expression will return all visual model nodes that are hidden.
If you want to do the opposite — find all visual models that are currently shown — just negate the expression:
|
1 |
not vm.h |
These two expressions can be incredibly useful in large projects, especially when combined with batch operations (e.g., selecting all hidden nodes and making them visible).
Bonus: Check Visibility vs. Hiddenness
Another nuance in SAMSON is understanding the difference between hidden and visible. While both relate to visibility, they serve different purposes:
vm.h: Indicates whether the node is explicitly marked as hidden (e.g., from the GUI).vm.v: Reflects computed visibility, possibly resulting from parenting, flags, or grouped state.
For example, you may have a node that is not explicitly hidden, but it’s still not shown due to an ancestor group being hidden. To catch such cases, use:
|
1 |
not vm.v |
This query returns visual model nodes that are effectively invisible for any reason.
Use Case: Tidying Up a Crowded Project
Let’s say you imported a large PDB structure and added several modeling elements like surfaces and fields. After working for hours, you suspect some surfaces aren’t visible anymore — maybe you turned them off to run a measurement, and forgot which ones.
Just type:
|
1 |
vm.n "S*" and vm.h |
This expression filters all visual model nodes whose name starts with “S” (e.g., surfaces) and that are currently hidden. You can then select them, unhide them, or inspect their visibility flags in one go.
Want to remove or manage all invisible components? Try:
|
1 |
not vm.v |
This gives you a clear picture of everything in the scene that’s currently not contributing visually.
Visual sanitization and clarity are critical when preparing presentations, exporting images, or just keeping things clean 👌
Learn more about visual model attributes, and see all the filtering options available in SAMSON’s Node Specification Language documentation:
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.
