When the View Gets Crowded: Find Meshes by Name and State

A molecular scene can become difficult to work with when it contains many mesh nodes. The challenge is not always creating or changing a mesh; sometimes it is simply identifying the right one. Is the mesh named “A”? Is it currently visible or selected? A small, targeted Node Specification Language (NSL) query can help narrow the search without relying only on what is easy to spot in the view.

This guide focuses on mesh attributes in SAMSON. The examples are deliberately small: try one attribute at a time, check which nodes match, and then refine your search as needed. That approach is especially useful when several meshes look similar or when you want to check a node’s state without guessing from its appearance.

Start with the mesh attribute space

Mesh attributes use the mesh attribute space, abbreviated me. This space matches mesh nodes. For example, me.n "A" uses the mesh name attribute, while me.v uses the visible attribute.

The documented mesh attributes are inherited from the more general node attribute space. In practice, this means the mesh reference provides the mesh-specific way to use those node attributes. The available attributes include names, material-related properties, selection state, and visibility-related state.

Find a mesh by its name

If you know the name you are looking for, use name, or its short name n. The documentation gives me.n "A" as an example. It also shows me.n "L*". The quotes matter: the attribute’s possible values are strings in quotes.

This is a useful first step when a scene has several meshes with similar appearances. Rather than selecting by visual guesswork, search by a name you recognize. If you do not know the name, you can still use the state attributes below to investigate which meshes are selected or visible.

Check visibility and selection separately

For visibility, the reference lists visible (short name v) and hidden (short name h). Its examples include me.v, not me.v, and me.h. These provide direct ways to query the respective attributes. The page also lists visibilityFlag, abbreviated vf, with examples me.vf and me.vf false.

For selection, the reference lists selected and selectionFlag, abbreviated sf. Example expressions are me.selected, not me.selected, me.sf, and me.sf false. One small detail worth remembering: selected has no short name in the mesh attribute space. Use me.selected, rather than assuming it has the node-space short name.

Visibility, hidden state, and visibility flags are listed as separate attributes, as are selected state and selection flags. If you need to know exactly how those inherited properties are defined, consult the node attribute reference rather than assuming that similarly named attributes are interchangeable. Keeping the query focused on the attribute you actually want to inspect makes results easier to interpret.

Material checks are available too

If your search concerns mesh materials, the attribute list includes hasMaterial (hm) and ownsMaterial (om). Examples include me.hm and me.om, with true or false values available. These can help you investigate whether a mesh has a material or owns one, without confusing those checks with visibility or selection.

A practical way to work

  1. Choose the property that describes the problem: name, visibility, selection, or material.

  2. Use the full attribute name or its documented short name, such as me.visible or me.v.

  3. For a negative boolean check, use a documented form such as not me.v or not me.selected.

  4. For names, put the string in quotes, as in me.n "A".

These examples make mesh queries more deliberate: identify the property first, then express it explicitly. For the complete attribute reference and additional NSL context, see the SAMSON mesh attributes documentation.

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

Comments are closed.