Find the right render preset without searching the whole scene

When a molecular scene contains many kinds of nodes, a search that is too broad can make it hard to focus on the item you actually want to inspect. Render presets have their own Node Specification Language (NSL) attribute space, which gives you a way to write queries specifically for render preset nodes.

The attribute space is renderPreset, and its short name is rp. That distinction is useful: starting a query with rp makes its scope explicit, so you can describe render presets rather than relying on a general node query. The render preset attribute space matches only render preset nodes.

Start with a name

If you know a preset’s name, use the inherited name attribute. Its short name is n, and values are written in quotation marks:

The reference also gives rp.n "L*" as an example. This is a useful pattern to keep in mind when you are expressing a name-based query. If a name query does not identify what you expect, first check that you have included the rp scope and that the value is quoted as a string.

Check selection state deliberately

Render presets also inherit the boolean attribute selected. It can be queried directly or negated:

In this attribute space, selected does not have the short name s. Writing the full attribute name avoids assuming that a shorthand from another context is available here.

A separate inherited boolean attribute is selectionFlag, abbreviated sf. The documented forms include:

Although both attributes are boolean, keep their names distinct in your query. Use selected when your expression is about the node’s selected state, and selectionFlag when you specifically want to query that attribute. The reference lists them separately; it does not describe them as interchangeable.

A small query checklist

  • Scope: Begin with rp when the target is a render preset.
  • Names: Use rp.n followed by a quoted string.
  • Booleans: Use rp.selected or rp.sf, and add not or false where appropriate.
  • Shorthand: Remember that n and sf are documented short names, while selected has no short name in this attribute space.

These checks help make expressions easier to read and reduce ambiguity when you are constructing a query. The key is to be precise about both the node type you are targeting and the particular attribute you want to test.

For the complete attribute reference and its examples, see the render preset NSL documentation.

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

Comments are closed.