Find the Animation You Meant: A Practical Guide to NSL Filters

When a molecular scene contains several animations, finding the one you need can be a small but frustrating task. You may want to locate an animation by name, or narrow a search to animations that are visible, hidden, or selected. SAMSON’s Node Specification Language (NSL) provides a compact way to express these filters.

This guide focuses on the animation attribute space. Its short name is an, and it matches animation nodes. That scope matters: an expression beginning with an is for identifying animations, rather than describing atoms or other kinds of nodes.

Start with the animation prefix

Use the full attribute-space name or its short form. For example, an.name refers to the animation’s name, while an.n uses the short name for that attribute. The documentation also shows the compact form an.n "A" as an example of a name-based expression.

Names are written in quotation marks. The reference includes both an.n "A" and an.n "L*". These examples are useful starting points when you are composing a query around a particular animation name. If you need the exact matching behavior of a pattern, consult the NSL examples rather than assuming what a symbol means.

Check visibility and hidden state

For a quick visibility-oriented filter, the short attribute v represents visible. The documented examples are an.v and not an.v. In practical terms, these expressions let you frame a search around whether the visible attribute is true or false.

The hidden attribute has its own short name, h, and accepts true or false. You can see the forms an.h and not an.h in the reference. Because the documentation lists hidden and visible as separate attributes, it is safest to query the specific property you care about instead of treating their names as interchangeable.

Use the right selection attribute

Animation nodes also inherit selected, which can be tested with an.selected or not an.selected. Unlike several other attributes in this space, selected has no short name for animations. In particular, do not substitute an.s: the reference explicitly notes that the inherited selected attribute is available here without the short name s.

There is also selectionFlag, abbreviated sf. Its examples are an.sf and an.sf false. The related visibilityFlag uses vf, with examples an.vf and an.vf false. These are distinct attributes from selected and visible. When building a filter, use the name that matches the property you intend to test; the reference lists their accepted Boolean values as true and false.

A small lookup table

  • Name: an.name or an.n; use a quoted string.
  • Visible: an.visible or an.v.
  • Hidden: an.hidden or an.h.
  • Selected: an.selected; no short name is listed.
  • Selection flag: an.selectionFlag or an.sf.
  • Visibility flag: an.visibilityFlag or an.vf.

A simple way to avoid query mistakes is to identify the node type first, then choose the exact attribute, and finally use its documented short form if one exists. This keeps filters readable while making compact expressions easier to type. The attributes on this page are inherited from the general node attribute space, but their an prefix keeps the query focused on animations.

For the full attribute reference and additional context, see the SAMSON animation attributes documentation.

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

Comments are closed.