Find the Right Render Preset Without Searching by Eye

When a molecular scene contains several render presets, finding the one you mean can become a small but frustrating task. A preset name may be familiar, but names alone are not always the only useful way to narrow a search. SAMSON’s Node Specification Language (NSL) provides a focused set of attributes for querying render preset nodes, including their names and two inherited Boolean attributes.

The key is to use the renderPreset attribute space, abbreviated rp. This attribute space matches only render preset nodes. That scope is useful when you want to express that your search concerns presets rather than other kinds of nodes in a molecular scene.

Start with the preset name

For a name-based query, use rp.name or its short form, rp.n. The value is written as a quoted string. For example:

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

These are examples of the documented syntax. If you are trying to locate a particular preset, start with its known name and keep the value quoted. The reference page includes "L*" as an example, but does not define wildcard matching rules, so avoid assuming what the asterisk matches without checking the broader NSL documentation.

Know which “selected” attribute you mean

Render presets inherit the node attribute selected, but this attribute does not have the node-space short name s in the render preset attribute space. Use rp.selected to query it, or not rp.selected to express the opposite:

  • rp.selected
  • not rp.selected

This distinction is handy when translating a query from another node context. A short name that exists for a general node attribute is not necessarily available in every specialized attribute space. For render presets, the documented form is rp.selected, not rp.s.

Use selectionFlag explicitly

The other Boolean attribute listed for render presets is selectionFlag, with the short name sf. Its documented examples are:

  • rp.sf
  • rp.sf false

Although both selected and selectionFlag are Boolean attributes, they are separate attributes with separate names. If a query is not returning the presets you expect, check which one you intended to test instead of treating them as interchangeable. The reference establishes their available syntax; it does not say that the two attributes have the same meaning.

A quick way to troubleshoot a query

  1. Confirm that you are querying render presets by using the rp attribute space.
  2. For a name, use rp.n or rp.name, followed by a quoted string.
  3. For selection state, use rp.selected or not rp.selected.
  4. For the selection flag, use rp.sf and specify true or false when needed.
  5. Check that you have not substituted a short name from another attribute space.

Keeping these attributes distinct makes preset queries easier to read and debug, especially when you revisit them later or share them with a collaborator. For the complete attribute reference and related NSL material, see the render preset attributes documentation.

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

Comments are closed.