Find the Mesh, Not the Guesswork: A Practical Guide to SAMSON’s Mesh Filters

A molecular scene can contain many kinds of nodes, and when you need to inspect or isolate a mesh, a broad search can return more than you intended. SAMSON’s Node Specification Language (NSL) provides a mesh-specific attribute space so you can describe the mesh nodes you want to find using attributes such as name, visibility, selection, and material status.

The mesh attribute space uses me as its short name. That prefix is useful: it tells your query to look at mesh attributes, rather than leaving the node type implicit. For example, me.h checks the mesh’s hidden attribute, and me.v checks visible.

Start with the question you are trying to answer

If you are trying to locate a mesh by name, use me.n, the short name for name. The documented examples are me.n "A" and me.n "L*". Names must be written in quotes. If you are unsure which mesh a query will match, begin with a name expression and check it before adding other conditions.

For a visibility check, the documented expressions are me.v and not me.v. The corresponding long attribute name is visible. The mesh space also inherits hidden, with examples me.h and not me.h. These are separate attributes in the reference. Choose the one that matches the question you mean to ask instead of treating the labels as interchangeable.

Keep selection-related attributes distinct

Mesh queries also expose selected and selectionFlag. You can express the former as me.selected or not me.selected; the latter has the short form me.sf, with examples me.sf false and me.sf. The documentation notes an important exception: selected is inherited from the node attribute space, but its short name s is not available for meshes. Use me.selected rather than assuming that the node-level abbreviation applies here.

There is a similar long-and-short-name pair for visibilityFlag: its short form is vf, and the examples are me.vf false and me.vf. Keeping the names straight makes a query easier to read later: visible is written v, while visibilityFlag is written vf.

Check material status without guessing

Two material-related attributes are listed: hasMaterial (hm) and ownsMaterial (om). The reference gives me.hm and not me.hm for the first, and me.om for the second. They are distinct attributes, so use the one that corresponds to the condition you need to inspect rather than using “has” and “owns” as if they meant the same thing.

A reliable way to build a useful mesh query is to begin with one documented condition, verify that it describes the intended property, and then consult the NSL reference before combining conditions. The mesh page lists each attribute, its available abbreviation, possible values, and example expressions. It also identifies these properties as inherited from the broader node attribute space, while noting the mesh-specific abbreviation exception for selected.

For the complete attribute list and its exact examples, see the SAMSON mesh attributes reference.

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

Comments are closed.