Find the mesh you mean: a practical guide to NSL attributes

A molecular scene can become crowded quickly. When several mesh nodes are present, the challenge is not simply finding a mesh—it is narrowing the view to the right one without accidentally applying a filter intended for another kind of node. SAMSON’s Node Specification Language (NSL) provides a mesh-specific attribute space for making those queries more explicit.

The key starting point is me, the short name for the mesh attribute space. It matches mesh nodes, so a query such as me.h is scoped to meshes rather than being a generic node query. This makes the intent easier to read when revisiting an expression later or sharing it with a collaborator.

Start with the question you need to answer

Mesh attributes are especially useful when your immediate task is about visibility, selection, materials, or names. The following expressions are taken from the NSL reference and can serve as small, focused starting points:

  • me.v — match meshes whose visible attribute is true.
  • not me.v — match meshes whose visible attribute is false.
  • me.h — match meshes whose hidden attribute is true.
  • me.selected — match meshes whose selected attribute is true.
  • me.hm — match meshes whose hasMaterial attribute is true.
  • me.om — match meshes whose ownsMaterial attribute is true.
  • me.n "A" — use a quoted name value.

These examples turn a vague visual task—“show me the meshes that are hidden,” for instance—into a specific attribute check. The inverse form with not is useful when you want to inspect the other side of a true/false property, such as meshes that are not visible.

Don’t confuse similar-sounding attributes

Some attributes look related, but the reference lists them separately. visible (v) and hidden (h) are distinct attributes. Likewise, selected and selectionFlag (sf) are separate entries, as are hasMaterial (hm) and ownsMaterial (om). If you are trying to answer a particular question, choose the attribute with the name that corresponds to it rather than assuming two similar labels are interchangeable.

There is also a small shorthand detail worth remembering: selected has no short name in the mesh attribute table. Write me.selected for that attribute. By contrast, selectionFlag has the short name sf, so its examples include me.sf and me.sf false. The same explicit style is available for visibility: me.visibilityFlag can be abbreviated as me.vf.

Use names when visual appearance is not enough

When a scene contains multiple meshes that look alike, a name-based expression can be a useful way to identify the node you want to inspect. The reference shows quoted values such as me.n "A" and me.n "L*". Keeping the value in quotes makes it clear that you are querying the name attribute, rather than writing a boolean test.

A practical habit is to write the attribute out in full while developing or documenting a query, then use the short form when you are comfortable with it. For example, me.visible and me.v refer to the same listed attribute, while the longer version can be easier for a teammate to scan. The short forms are convenient; clarity is often more valuable when a query becomes part of a repeatable workflow.

Mesh attributes inherit from the general node attribute space, so the mesh reference is also a reminder that these properties are part of a broader NSL vocabulary. For mesh-focused filtering, the me prefix keeps the target type visible and makes your intent easier to check.

For the complete list of mesh attributes and examples, see the SAMSON mesh attributes reference.

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

Comments are closed.