Find the Mesh You Mean: A Practical Guide to SAMSON’s Mesh Queries

A crowded molecular scene can make a simple task surprisingly frustrating: finding the mesh you want to inspect, hide, or select. When several mesh nodes are present, relying on names or visual inspection alone may not be enough. SAMSON’s Node Specification Language (NSL) provides a compact way to describe mesh nodes by attributes, so you can narrow your search with a clear, reusable query.

The key starting point is the mesh attribute space, abbreviated me. It matches only mesh nodes. That makes it a useful boundary for a mesh-focused query: attributes such as visibility, name, and material-related flags can be considered specifically for meshes rather than for every kind of node in the scene.

Start with the question you need to answer

Before writing an expression, translate the task into one attribute. Are you looking for a mesh by name? Checking whether it is visible? Looking for one with a material? Keeping the question narrow makes the query easier to read and makes it less likely that two different properties will be mistaken for one another.

  • Check visibility: me.v refers to visible; not me.v expresses the opposite condition.
  • Check hidden state: me.h refers to hidden. This is a separate attribute from visible in the reference.
  • Find a name: me.n "A" is an example using the full name name attribute. The reference also shows me.n "L*" as a name expression.
  • Check material-related state: me.hm refers to hasMaterial, while me.om refers to ownsMaterial.

These distinctions are practical safeguards. The page lists visible and hidden separately, just as it lists hasMaterial and ownsMaterial separately. If you need one of those particular attributes, query it directly rather than substituting a similarly named one.

Use short names without losing clarity

The short forms keep expressions compact: me.v for visible, me.h for hidden, me.n for name, and me.hm or me.om for the material attributes. When you are still learning the attribute set—or sharing a query with a colleague—writing out the full attribute name can make the intent easier to recognize. The short name is especially handy once you know what each abbreviation means.

There is one useful exception to remember: selected has no short name in the mesh attribute space. Use me.selected or not me.selected. The reference also lists selectionFlag, whose short name is sf, and gives me.sf false and me.sf as examples. Since these are distinct attributes, choose the one that matches the property you intend to inspect; don’t assume they are interchangeable.

A small, reliable workflow

  1. Begin with the mesh space: use me so your search is about mesh nodes.
  2. Choose one attribute that describes the mesh you need, such as me.n "A" or not me.v.
  3. Check the attribute name and its short form in the reference if the expression is unclear—especially for selection and material-related properties.
  4. Keep the expression readable when you save or share it. A query is most useful when another person can tell which property it is testing.

This approach is helpful when a scene contains meshes with similar appearances or when you need to reason about a particular state without scanning every node manually. It also encourages a good habit: make the target type explicit, then be precise about the property you are checking.

For the complete list of mesh attributes, short names, possible values, and examples, see the SAMSON mesh attributes reference. You can also explore the broader Node Specification Language documentation.

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

Comments are closed.