A clearer way to reason about visual-model queries

When a molecular scene gets busy, it is easy to lose track of what a query is meant to find: a model that is hidden, one that is not visible, or one that is simply selected. These ideas are related in everyday language, but SAMSON’s Node Specification Language (NSL) lists them as separate attributes. Choosing the right attribute makes a query easier to read and helps avoid matching the wrong visual models.

Start with the visual-model prefix

The visual-model attribute space is written visualModel, or abbreviated to vm. It matches visual model nodes. That prefix tells you the kind of node your expression is addressing; the part after the dot identifies the attribute. For example, vm.h refers to the hidden attribute, while vm.v refers to visible.

This small convention is useful when scanning or editing NSL expressions. If an expression is intended to concern visual models, check that it uses vm rather than assuming that a short attribute name alone makes the target clear.

Choose the state you actually mean

The reference lists hidden and visible separately, each with true and false values. Their examples are vm.h, not vm.h, vm.v, and not vm.v. Use the attribute that matches the question you are asking. For instance, if you are looking for visual models whose hidden attribute is false, the documented form is not vm.h. If your criterion is the visible attribute, use vm.v or not vm.v as appropriate.

There are also visibilityFlag (vm.vf) and selectionFlag (vm.sf). The documentation presents these as distinct attributes, with examples such as vm.vf false and vm.sf false. Don’t substitute one for another just because their names sound similar. When building a query, write down the exact property you want to test—visibility, a visibility flag, selection, or a selection flag—and use its corresponding attribute.

Remember the selection-name exception

selected is available as vm.selected, and the reference explicitly notes that it has no short name in this attribute space. Although the inherited node attribute has the short name s, that abbreviation is not listed for visual models. Using the full form makes the intent clear and avoids carrying an alias across attribute spaces where it is not supported.

Names and material checks

Visual models inherit several other attributes from the node space. You can check a name using the documented string forms vm.n "A" and vm.n "L*". The page also lists hasMaterial (vm.hm) and ownsMaterial (vm.om), each with true/false values. These are separate checks: if your task concerns whether a visual model has material or owns material, choose the matching attribute rather than treating the terms as interchangeable.

A practical habit is to expand abbreviated expressions mentally before using them: vm.vf false means a visual-model query on visibilityFlag, while vm.v refers to visible. Likewise, vm.om is ownsMaterial, not hasMaterial. Keeping a short translation beside an expression can make it easier to review later, especially when several visual-model properties are involved.

For a quick reference, the page lists each attribute, its short name, allowed values, and examples. It also identifies which attributes are inherited from the node attribute space. Read the complete visual-model attribute reference to learn more.

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

Comments are closed.