A clearer molecular scene starts with finding the right mesh

When a molecular scene contains several meshes, the challenge is not always creating another view—it is finding the particular mesh you need among the ones already there. A surface may be hard to pick out, hidden behind other geometry, or simply named in a way that is easier to search for than to locate visually. SAMSON’s Node Specification Language (NSL) provides a compact way to describe mesh nodes using attributes such as name, visibility, selection, and material state.

The key starting point is the mesh attribute space, whose short name is me. An expression beginning with me matches mesh nodes, so it gives you a focused vocabulary for asking questions about meshes rather than nodes in general. For example, the reference lists me.v and not me.v as expressions for visible and non-visible meshes.

Use visibility to narrow the scene

If you are trying to reason about which meshes are currently visible, start with the visibility attributes:

  • me.v refers to meshes whose visible attribute is true.
  • not me.v refers to meshes whose visible attribute is false.
  • me.h and not me.h check the hidden attribute.

Visibility and hidden are separate attributes in the reference. It is useful to keep their names distinct when writing an expression: choose the attribute that matches the state you want to inspect rather than assuming the terms are interchangeable. Their short forms, v and h, can make repeated queries more compact.

Search by name when appearance is not enough

A mesh’s name can be a more reliable clue than its appearance, particularly when several surfaces overlap or use similar colors. The name attribute accepts strings in quotes. For example, the reference gives me.n "A" and me.n "L*". If you are building a repeatable workflow, consistent mesh naming makes these expressions easier to understand and reuse. The important practical detail is to put the name string in quotation marks.

Check selection and material attributes

When a mesh is difficult to identify in a busy scene, it can help to check its selection-related attributes. The reference includes me.selected and not me.selected, as well as me.sf and me.sf false for the selectionFlag attribute. Meshes also inherit the node attributes hasMaterial and ownsMaterial, with the short forms hm and om. For example, me.hm checks hasMaterial, while me.om checks ownsMaterial.

These attributes help turn a vague visual task—“find that surface”—into a precise question about a mesh. A simple approach is to begin with one useful property, such as visibility or name, and then consult the attribute reference when you need to distinguish selection state or material state. The page also lists visibilityFlag as me.vf and selectionFlag as me.sf, each with true and false values.

One small syntax detail can prevent a frustrating dead end: selected is available in the mesh space as me.selected, but it does not have the short name s there. When writing a mesh expression, use the full attribute name for this property.

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

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

Comments are closed.