A molecular scene can become hard to work with long before the model itself becomes complicated. Several visual models may overlap, some may be hidden, and selection state can be difficult to inspect at a glance. When you need to find or filter visual model nodes in SAMSON, the Node Specification Language (NSL) provides a focused set of attributes for describing them.
The key starting point is the visualModel attribute space, with the short name vm. It matches visual model nodes only. That scope matters: using vm makes the intent of a query clear and helps keep a visual-model search separate from searches for other kinds of nodes.
Check visibility without guessing
Two useful attributes are visible and hidden. Their short names are v and h, respectively. The documented examples are:
vm.v— match visual models whosevisibleattribute is true.not vm.v— match visual models whosevisibleattribute is false.vm.h— match visual models whosehiddenattribute is true.not vm.h— match visual models whosehiddenattribute is false.
These are separate attributes, so choose the one that expresses what you want to check. If your question is whether a model is marked visible, use vm.v. If you specifically want to inspect its hidden attribute, use vm.h. Keeping that distinction explicit makes a query easier to understand later, especially when you return to a project after time away.
Inspect selection state precisely
Visual models also expose selected and selectionFlag. For selection state, the documented expressions include vm.selected and not vm.selected. One small but useful detail: although the inherited node attribute has a short name, selected has no short name in the visual-model attribute space. Use the full expression vm.selected.
selectionFlag does have the short name sf. The documentation shows both vm.sf and vm.sf false. These names are easy to mix up when scanning a long list of attributes. A good habit is to write the full name while building or reviewing a query, then use a short name only when it makes the expression more convenient.
Use names and material attributes to narrow the search
When a scene contains multiple visual models, the name attribute can help identify the ones you mean. It accepts strings in quotes; examples include vm.n "A" and vm.n "L*". The short name is n. These examples give you a starting point for writing name-based expressions using the syntax shown in the NSL reference.
Material-related attributes can also help describe a visual model. Use vm.hm for hasMaterial and vm.om for ownsMaterial. Both attributes accept true or false values. The distinction is useful at the query level: these are two different attributes, so select the one that matches the property you need to inspect rather than treating them as interchangeable.
A small checklist for readable queries
- Start with
vmwhen your target is a visual model node. - Choose the specific property you mean: for example,
vfor visible orhfor hidden. - Use
selectedin full; it has no short name in this attribute space. - Use quoted strings with
name, and refer to the documented examples when composing a name expression. - Prefer expressions that state the intent clearly. A readable query is easier to check when the scene is busy.
These attributes are inherited from the general node attribute space, but are available here in the visual-model context. For the full attribute list and the corresponding examples, see the visual model attributes reference.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
