When working on complex molecular systems, a common frustration among modelers is staying organized without accidentally altering the visual setup. This is especially true when animating molecular transitions or pathways: visual elements shift between scenes, sub-structures vanish momentarily, and the workspace can become confusing.
If you use SAMSON and work with animations, you may have stumbled upon situations where animation nodes display or hide elements unpredictably. The good news is that you can control this behavior precisely using two important, and often overlooked, attributes: visibilityFlag and visible.
Understanding Visibility Attributes
In SAMSON’s Node Specification Language (NSL), the animation attribute space (an) contains several visibility-related attributes:
an.vf(visibilityFlag): Determines whether the animation node controls visibility.an.v(visible): Indicates whether a node is currently visible or not.
Why does this matter? Because visible is only meaningful if visibilityFlag is set to true. In other words, if an.vf is false, the animation node won’t affect visibility at all—even if an.v is set to false. This small logic detail allows for fine control over which parts of your animation actually alter the viewer’s visual experience.
Use Case: Avoiding Visualization Conflicts
Let’s say you’re preparing an animation that shows a ligand entering a binding site, and you use animation keyframes to show stepwise interaction. But some atoms or residues disappear when they shouldn’t. This could be because an animation node has an.vf set to true and an.v set to false, unintentionally hiding parts of your model. The solution is to either:
- Explicitly set
an.vf falseto prevent the animation node from affecting visibility at all, or - Use
an.vcarefully in tandem withan.vf true.
This invisible toggling issue can lead to dozens of minutes lost as you search through animation nodes wondering why parts of the structure keep disappearing. By consciously using an.vf, you remove ambiguity and ensure your animations reflect only the changes you want.
Quick Tips
- Use
an.vf falsefor nodes that should not affect visibility at all. - Use
an.vf truewithan.v trueoran.v falseas needed for visibility control. - Use the NSL filter
an.vfin the Find window to quickly isolate relevant nodes.
Example Filters
Some practical NSL commands you can run in the Find panel:
an.vf false– Find all animation nodes not controlling visibility.an.v– Find all animation nodes set to be visible.not an.v– Find all nodes currently set to be hidden.
Fine-grained visibility control can help ensure your animations communicate precisely what you intend—without surprise disappearances or missing elements. Understanding how visibilityFlag and visible work together will save time and avoid frustration.
To learn more about animation attributes in SAMSON, including other useful visibility-related options, see the official documentation: https://documentation.samson-connect.net/users/latest/nsl/animation/.
SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON at https://www.samson-connect.net.
