Find the Right Render Preset Without Guesswork

When a molecular scene has several render presets, the frustrating part is often not choosing how to display the structure—it is identifying the preset node you meant to work with. Names may be similar, and a broad search can mix presets with other kinds of nodes. SAMSON’s Node Specification Language (NSL) provides a focused way to query render preset nodes by name and by inherited node attributes.

Render preset attributes belong to the renderPreset attribute space, abbreviated rp. That space matches only render preset nodes, which makes it a useful starting point when your task concerns presets rather than the rest of the molecular structure.

Start with a name

To search by name, use rp.name or its short form, rp.n, followed by a string in quotes:

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

The documented examples show both a simple quoted name and a value containing an asterisk. Keep the value in quotes, and use the spelling or pattern you intend to search for. If you are unsure which part of a query is responsible for the result, begin with a simple name condition and add other conditions only after checking it.

Use selection state as a second clue

Render presets also inherit the node attributes selected and selectionFlag. Both are Boolean attributes, so they can be queried as true or false. For example:

  • rp.selected
  • not rp.selected
  • rp.sf
  • rp.sf false

These expressions demonstrate two useful forms: testing an attribute directly and explicitly specifying a Boolean value. The negated form, not rp.selected, is a readable way to express the opposite of the selected condition. The short name for selectionFlag is sf.

A small detail that can save time

The selected attribute is inherited from node.selected, but it does not use the node attribute’s short name s in the render preset attribute space. Write rp.selected, not rp.s. By contrast, the documented short name for selectionFlag is sf, so rp.sf is available.

This distinction matters when adapting a query from another NSL attribute space. A familiar short form may not apply to every inherited attribute in the same way. When a query does not behave as expected, check the attribute table for the specific node type and confirm both the attribute name and its short name.

Build a query in manageable steps

For a practical search, first narrow the target to render presets with the rp attribute space. Then add a name condition, such as rp.n "A", if you know the preset’s name. If selection state is also relevant, inspect or add the appropriate Boolean condition, such as rp.selected or not rp.selected. Keeping each condition visible makes it easier to understand what the expression is asking for and to adjust it when the result is not what you expected.

NSL expressions are especially helpful when you want to describe the target precisely rather than rely on a broad, ambiguous search. Remember the essentials: rp targets render preset nodes, names are written as quoted strings, and the inherited selection attributes have their own documented names and short forms.

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

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

Comments are closed.