When working with detailed molecular models in SAMSON, it’s easy for your workspace to become difficult to navigate. Notes scattered throughout models often contain crucial information—observations, temporary labels, or structural annotations—but they can quickly become visually overwhelming. Thankfully, with the Node Specification Language (NSL), you can filter, select, and visualize these note nodes efficiently.
This blog post focuses on a specific subset of NSL: managing note node visibility through intuitive attributes like visible, hidden, visibilityFlag, and more. These are part of the nt (note) attribute space within NSL and can significantly ease the management of labeled information in dense molecular scenes.
Why filtering notes visually matters 🧠
In collaborative or personal modeling projects, notes often serve as documentation embedded directly in the model. Over time, however, this can clutter the scene. You may want to hide all notes temporarily, isolate only selected ones, or programmatically control their presence during script execution or animation.
Key note visibility attributes in NSL
NSL provides a set of attributes specifically dedicated to note node visibility and selection. Here’s what you need to know:
nt.v: Check if a note is currently visible. For example:nt.vreturns all visible notes.not nt.vfilters out notes that are hidden.nt.vf(visibilityFlag): A lower-level control flag that determines whether the engine should render the note.nt.vf falsecan hide notes without deselecting them, which is useful when scripting visual display steps.nt.h(hidden): Indicates if the note is explicitly hidden. It’s the inverse of visibility.nt.handnot nt.hhelp when dealing with mixed states.
Practical recipes
Let’s explore a few practical queries using these attributes:
nt.v: Find all visible notes.not nt.v: List notes that are currently hidden.nt.h and nt.selected: Select hidden notes that are marked as selected (for instance, via a script or user input).nt.vf false and not nt.selected: Hide unselected notes only.
With these expressions, you can focus on specific subsets of notes—only the visible ones, those marked as selected, or even dynamically control which notes appear in animations or screenshots.
Tip: combine with names
You can also combine visibility filters with name to find notes based on pattern matching. For instance:
|
1 |
nt.n "Analysis*" and nt.v |
This query finds all visible notes whose name starts with “Analysis”. This is especially helpful when multiple notes are created during different steps of a simulation and you want to isolate a stage quickly.
A focused way to interact with annotations
Using these simple yet powerful filters helps streamline your interaction with molecule annotations. Whether for documentation, analysis, or presentation, controlling note visibility lets you focus on what matters most in a given context.
To learn more about note attributes in SAMSON and explore all available options in the NSL language, visit the official documentation page.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON here.
