When working on molecular animations, molecular modelers often need to selectively visualize or analyze specific animation nodes based on their properties. However, navigating large molecular systems with multiple overlapping animations can get time-consuming and error-prone. This is where the Node Specification Language (NSL) in SAMSON comes in handy.
In particular, SAMSON provides an animation attribute space (short name: an) that allows you to filter animation nodes based on their visibility, selection state, name, and more. This blog post focuses on how to use these animation attributes effectively to improve your workflow when handling molecular animations.
What are Animation Attributes?
Animation attributes are part of the NSL and are meant to be used with animation nodes in SAMSON. You prefix them with an, e.g., an.v to refer to the visible attribute of animation nodes.
Below is a quick reference of common animation attributes supported in SAMSON:
| Attribute | Short Name | Possible Values | Example Usage |
|---|---|---|---|
| hidden | h |
true / false |
an.h, not an.h |
| name | n |
string (with quotes) | an.n "A", an.n "L*" |
| selected | N/A | true / false |
an.selected, not an.selected |
| selectionFlag | sf |
true / false |
an.sf, an.sf false |
| visibilityFlag | vf |
true / false |
an.vf, an.vf false |
| visible | v |
true / false |
an.v, not an.v |
Focus: Working with Visibility
A common challenge is trying to clean up the scene to isolate a specific animation or to understand which animations are currently affecting the system. Three attributes are particularly useful here:
an.v(visible): Whether the animation is currently visible.an.vf(visibilityFlag): If visibility is allowed, independently of the state.an.h(hidden): Whether the node is explicitly hidden.
For example, to quickly find all animations that are visible and not hidden, you can use:
|
1 |
an.v and not an.h |
To find and hide all visible animations starting with the letter ‘L’, you can use:
|
1 |
an.n "L*" and an.v |
This lets you target only relevant nodes, improving both performance and clarity in your scene.
Searching by Name
Animation attributes let you use wildcard search for names. For instance:
|
1 |
an.n "Ligand*" |
selects all animation nodes whose name starts with “Ligand”. This is especially helpful when your animations follow a naming convention.
Filtering by Selection
The an.selected and an.sf attributes are useful when you’re scripting or automating workflows. For example, say you want to find animations that have been selected by the user:
|
1 |
an.selected |
And to access ones marked with selection flags programmatically, use:
|
1 |
an.sf |
Why Use This?
Without a filter, it’s not uncommon to waste minutes toggling the visibility of multiple nodes one by one or trying to locate ones that impact specific parts of your molecule. Using NSL queries based on animation attributes eliminates this friction and keeps your workflow focused.
You can also save these queries, include them in scripts, or use them to build precise selections inside more complex analysis pipelines.
To learn more about available attributes and their usage, visit the full documentation page here: 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.
