Find the Right Animation: A Practical Guide to NSL Attributes

When a molecular scene contains several animations, locating the one you need can be a small but distracting task. You may want to inspect an animation by name, find animations that are hidden, or check which ones are visible. SAMSON’s Node Specification Language (NSL) provides a compact way to express these searches with animation attributes.

This guide focuses on a useful detail: animation attributes live in their own attribute space, animation, shortened to an. That space matches only animation nodes. Keeping that scope in mind helps make a query easier to read and reduces ambiguity about what it is intended to match.

Start with the animation prefix

In the examples below, an identifies the animation attribute space. For instance, an.h refers to the hidden attribute on animation nodes. The full attribute names are available too: an.hidden, an.name, and an.visible express the same attribute choices as their short-name forms where a short name is provided.

Short names can make repeated expressions more compact, while full names can be easier to scan when you are learning or reviewing a query. Animation attributes with documented short names include hidden (h), name (n), selectionFlag (sf), visibilityFlag (vf), and visible (v). The selected attribute has no short name in this attribute space.

Check visibility without changing your workflow

To search for animations marked visible, use an.v. To look for animations that are not visible, use not an.v. The corresponding full-name form is an.visible. Similarly, an.h and not an.h let you express searches for hidden and non-hidden animations.

These pairs are helpful when the practical question is simply “which animations are in this state?” They also make the intent of a query easy to communicate to a colleague: the positive form asks for the attribute, and not expresses its opposite. The documented possible values for these Boolean attributes are true and false.

Use names to narrow the search

If you know an animation’s name, the name attribute accepts strings in quotes. The documentation gives an.n "A" and an.n "L*" as examples. A name-based expression can be a useful starting point when a scene has several animations and you want to focus on one or a recognizable naming pattern. If you are unsure how a particular string is interpreted, consult the NSL examples rather than assuming matching behavior from the spelling alone.

Keep related attributes distinct

The animation attribute space also inherits selected, selectionFlag, and visibilityFlag from the general node attribute space. Their examples include an.selected, an.sf false, and an.vf false. These names are related to selection or visibility, but they are separate attributes from visible and hidden. When building a query, choose the attribute that matches the condition you actually want to test; don’t substitute one simply because the names sound similar.

A simple way to build a reliable expression is to state the target first: animation nodes only, then the property of interest, then whether you want the positive or negated condition. For example, start with an, add .v for visible, or use not an.v for the opposite condition. If names matter, use an.n followed by the quoted string shown in the documentation.

For the complete attribute table and links to the inherited node attributes, see the animation NSL reference.

Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.

Comments are closed.