Find the Render Preset You Need Without Guesswork

When a molecular scene contains several render presets, the practical challenge is often not creating another one—it is locating the right preset or narrowing a search to the presets that match a condition. SAMSON’s Node Specification Language (NSL) lets you describe render preset nodes with a small set of attributes, including their names and selection states.

The important starting point is scope. The renderPreset attribute space, abbreviated rp, matches only render preset nodes. Using this scope helps keep a search focused on presets rather than other kinds of nodes in a molecular document.

Search by preset name

The inherited name attribute can be written with its short name, n. Put the name in quotes:

The reference also gives rp.n "L*" as an example. It is useful to recognize this as valid documented syntax, but the attribute table alone does not define how special characters or patterns are interpreted. If you need a particular matching behavior, check the broader NSL documentation rather than assuming that every symbol has wildcard meaning.

Name-based expressions are especially useful when a preset has a recognizable label. Consistent naming makes those expressions easier to read and maintain: for example, a short descriptive name is usually simpler to identify later than a label chosen only for the moment. The NSL expression describes a condition on a node; it does not rename the preset.

Filter by selection state

Render presets also inherit the Boolean selected attribute. The examples show how to express both sides of that condition:

Read the first as a condition for selected render preset nodes, and the second as its negation. In this attribute space, selected has no short name. In particular, do not assume that rp.s is a valid shorthand here just because a short name may exist in another context.

Keep selectionFlag distinct

selectionFlag is another inherited Boolean attribute. Its short name is sf, and the reference provides these forms:

It is worth keeping selected and selectionFlag separate when writing expressions. They are listed as different attributes, with different syntax: selected has no shorthand in the render preset space, while selectionFlag can be written as sf. The reference does not say they are interchangeable, so use the attribute that matches the condition you intend to test.

A small checklist before using an expression

  • Start with rp when you want the expression to apply to render preset nodes.
  • Use rp.n "..." to specify a name condition, with the value in quotes.
  • Use rp.selected or not rp.selected for the selected state.
  • Use rp.sf or rp.sf false for the selectionFlag attribute.
  • Do not infer undocumented matching rules or treat the two Boolean attributes as synonyms.

This makes the render preset attribute space a compact tool for describing what to look for, without needing to memorize a large set of options. For the full 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.