Find the Right Render Preset Without Guessing at Its Attributes

When a molecular scene contains several render presets, it can be easy to lose track of which one you are looking for. A preset’s name may be familiar, but its selection state can also matter when you are narrowing down nodes. SAMSON’s Node Specification Language (NSL) provides a compact way to describe render preset nodes using their attributes.

The key is to use the renderPreset attribute space, abbreviated rp. This space matches only render preset nodes. That qualifier matters: it makes your expression specific to presets rather than describing nodes in general.

Start with the preset name

For a name-based expression, use rp.n followed by a name in quotes. For example:

  • rp.n "A"
  • rp.n "L*"

The short name n is the shorthand for the inherited name attribute. Quotation marks are part of the documented expression syntax for string values. If you are building an expression and a name contains spaces or punctuation, keeping the value quoted makes the string boundary clear.

The documentation lists "L*" as an example value, but does not define the matching behavior of the asterisk on this reference page. Treat it as an example expression rather than assuming a particular wildcard rule from this page alone.

Check selection state separately

Render presets also expose the inherited selected attribute. It accepts true or false, and the documented expressions are rp.selected and not rp.selected. In other words, you can express the selected and not-selected cases directly. This attribute has no short name in the render preset attribute space: unlike some other inherited attributes, you cannot write it as rp.s.

A similar-looking attribute is selectionFlag, with short name sf. Its examples are rp.sf and rp.sf false. The distinction is useful when reading or writing expressions: selected and selectionFlag are separate attributes, and the documented short form sf belongs to selectionFlag, not to selected.

A practical way to compose a query

When you need to describe a particular preset, begin with its identifying attribute, then decide whether selection state is relevant. For example, a name-focused expression can start with rp.n "A". If your task also depends on whether a preset is selected, add the appropriate selection condition using the syntax supported by the NSL expression you are building. Keep the two questions distinct: “Which preset name?” and “What is its selection state?”

This small habit helps prevent a common source of confusion: using an attribute’s short name just because another inherited attribute has one. For render presets, the available names are n for name and sf for selectionFlag; selected is written out in full.

These attributes describe how to specify render preset nodes in NSL; this reference does not describe changing a preset’s rendering settings. For the full attribute list and related examples, see the render preset attributes reference.

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

Comments are closed.