A calmer way to find the mesh you need

A crowded molecular scene can make a simple task surprisingly slow: find the mesh you want, work out whether it is hidden or visible, and avoid confusing it with other kinds of nodes. SAMSON’s Node Specification Language (NSL) offers a practical way to narrow that search by querying mesh attributes.

The key is the mesh attribute space. Its short name is me, and it matches mesh nodes only. That gives you a useful starting point when a document contains many different node types: mesh queries keep the search focused on meshes.

Start with the problem you can describe

If you remember part of a mesh’s name, try a name query. For example, me.n "A" searches by the name A, while me.n "L*" is a documented example using a pattern. This can be more dependable than scanning a long scene tree by eye, especially when several meshes are present.

If the name is not helpful, use a state you can recognize. These expressions query visibility and selection-related attributes:

  • me.v and not me.v query meshes by their visible attribute.
  • me.h and not me.h query meshes by their hidden attribute.
  • me.selected and not me.selected query whether meshes are selected.
  • me.sf false and me.sf query the selectionFlag attribute.
  • me.vf false and me.vf query the visibilityFlag attribute.

These attributes have similar-sounding names, but the reference lists them separately. In particular, visible and visibilityFlag are distinct attributes, as are selected and selectionFlag. If you are unsure which one describes the state you need, query them separately rather than treating them as interchangeable.

Check material-related attributes separately

Meshes also inherit hasMaterial and ownsMaterial from the node attribute space. Their short forms are hm and om, so you can query them with me.hm and me.om. The reference lists both as true-or-false attributes. Since they are separate fields, it is useful to check the one that matches the question you are asking instead of assuming that one stands in for the other.

A small, repeatable troubleshooting routine

  1. Restrict the search to meshes: use the me prefix.
  2. Try an identifier: search by name with me.n and a quoted string.
  3. Check the relevant state: use me.v for visibility, me.selected for selection, or the corresponding flag attribute when that is what you need to inspect.
  4. Verify material properties independently: test me.hm or me.om rather than inferring one from the other.

This approach turns “Where did that mesh go?” into a more specific question you can test. It is especially handy when you are inspecting a complex scene and want to narrow your attention without accidentally broadening the search to other node types.

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.