Finding the Meshes You Mean: A Practical NSL Checklist

In a crowded molecular scene, a mesh can be easy to overlook—or easy to mistake for another object. Before changing a scene or inspecting a model, it helps to narrow your search to the mesh nodes you actually care about. SAMSON’s Node Specification Language (NSL) provides a compact way to query mesh attributes such as name, visibility, selection, and material-related state.

Start with the mesh attribute space

The mesh attribute space is written mesh, with the short name me. It matches only mesh nodes. That makes me a useful starting point when you want a query to stay focused on meshes rather than other kinds of nodes.

For example, these expressions test a mesh’s visibility:

  • me.v checks the visible attribute.
  • not me.v checks for meshes whose visible attribute is false.

The full attribute name is also available: me.visible. Using the short name can make a query more compact; using the full name can make it easier for a colleague—or your future self—to read.

Use names to narrow the search

If visibility alone leaves too many results, add the mesh name attribute to your investigation. The name attribute accepts strings in quotes, and the reference provides these examples:

  • me.n "A"
  • me.n "L*"

Here, n is the short name for name. The examples show the required quoted-string form; consult the NSL examples if you need to confirm how a particular name expression is interpreted. A useful habit is to test a name-based query separately before relying on it as part of a more complex search.

Don’t conflate visibility and its flag

The mesh reference lists both visible and visibilityFlag. Their examples include me.v, not me.v, me.vf, and me.vf false. Because these are listed as separate attributes, treat them as separate things to inspect rather than assuming one is simply another spelling of the other. The same practical caution applies to selected and selectionFlag.

For example, the documented selection expressions are me.selected and not me.selected; the selection-flag examples are me.sf and me.sf false. One detail worth remembering: selected has no short name in the mesh attribute space. Use me.selected, not an assumed abbreviated form.

Check material-related attributes

Meshes also expose hasMaterial (hm) and ownsMaterial (om). Their documented examples include me.hm, not me.hm, and me.om. These can help you distinguish mesh nodes by the material-related attribute you need to examine. The reference marks these attributes as inherited from the node attribute space, as it does for name, visibility, and selection attributes.

A small, reliable workflow

  1. Begin with the mesh scope: use me so the query concerns mesh nodes.
  2. Choose one attribute that reflects your immediate question, such as me.v for visibility or me.hm for the material-presence attribute.
  3. Use the documented negative form, such as not me.v, when you want to check the opposite boolean value.
  4. If you need to narrow the result further, inspect the name examples and verify the expression before using it in a larger query.
  5. Keep similarly named attributes distinct: visible is not the same listed attribute as visibilityFlag, and selected is not the same listed attribute as selectionFlag.

This approach keeps the query process understandable: scope first, then check one meaningful property at a time. For the complete attribute list and additional context, see the SAMSON mesh attributes reference.

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

Comments are closed.