Animations can be extremely helpful tools in molecular modeling. They allow researchers to visualize conformational changes, dynamic processes, and transitions that are difficult to capture in static images. However, as your SAMSON workspace grows and you find yourself dealing with tens or even hundreds of animation nodes, things can quickly get complex.
This article shows how to manage and query animation nodes effectively using Node Specification Language (NSL) in SAMSON. NSL gives you a powerful way to filter and manipulate animation nodes based on attributes like visibility, selection state, and naming patterns—all through simple text-based queries.
Why This Matters
If you are a molecular modeler working with multiple simulations or visual presentations, you’ve probably faced situations like:
- Needing to isolate specific animations in a crowded workspace
- Toggling visibility for a subset of animations
- Selecting animations based on a naming convention
Doing this manually is tedious. That’s where NSL becomes your assistant.
Attribute Spaces: Focusing on Animations
In NSL, attributes are grouped by context. To work specifically with animation nodes, we use the animation attribute space, or its short form an. This ensures that your queries only apply to animation nodes and not to others like molecules or geometries.
Query Examples You’ll Use
Each animation node can be queried based on several inherited properties. Here are common use cases and the matching NSL expressions:
1. Toggle Visibility
Want to find hidden animations?
|
1 |
an.h |
Or only show the visible ones?
|
1 |
not an.h |
2. Select Animations Based on Name
If you name your animation nodes after specific stages (e.g., “Stage1”, “Stage2″…), you can use:
|
1 |
an.n "Stage*" |
to match all animations starting with “Stage”.
3. Find Currently Selected Animations
To list only animations that are currently selected in your workspace:
|
1 |
an.selected |
And to hide those:
|
1 |
not an.selected |
4. Work With Visibility and Selection Flags
The flags selectionFlag and visibilityFlag reflect internal states in SAMSON, such as whether nodes are affected by selection operations. For example:
|
1 |
an.sf false |
returns animation nodes not affected by selection operations.
One Query, Many Actions
You can use these queries in SAMSON’s Find panel to locate nodes or trigger batch actions like delete, hide, or isolate. Simply put, you can save hours of browsing and clicking by learning a few simple expressions.
Quick Reference Table
| Attribute | Short Name | Example Expression |
|---|---|---|
| hidden | h | an.h |
| name | n | an.n "Dyn*" |
| selected | – | an.selected |
| selectionFlag | sf | an.sf false |
| visibilityFlag | vf | an.vf |
| visible | v | not an.v |
Learning these small tricks gives you a big return when managing animations, especially in collaborative or complex projects. It’s another example of how SAMSON supports both visual clarity and structural control in molecular modeling.
To learn more and explore the broader set of animation node attributes, visit the full documentation page: https://documentation.samson-connect.net/users/latest/nsl/animation/.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
