When a molecular scene has several render presets, finding the one you want can become a small but distracting task. Node Specification Language (NSL) lets you describe render preset nodes by attributes such as their name and selection state. That gives you a compact way to express what to look for, rather than relying on memory or repeatedly scanning a list.
Keep the search focused on presets
The render preset attribute space is written renderPreset, with the short name rp. It matches only render preset nodes. That scope matters: using rp makes your expression about presets, rather than nodes of other kinds in the molecular scene.
For example, these expressions use the preset’s name:
rp.n "A"rp.n "L*"
Here, n is the short name for the inherited name attribute. The documentation lists strings in quotes as possible values. If you have a particular preset name in mind, this is the attribute to use. The second expression is also a documented example; use the naming conventions and matching behavior you rely on in your own NSL searches.
Check selection state explicitly
Render presets also have a selected attribute. You can query for selected presets with rp.selected, or use not rp.selected to express the opposite condition. This is useful when your immediate question is not “Which preset has this name?” but “Which preset nodes are currently selected?”
One detail can prevent a confusing query: although selected is inherited from the node attribute space, it does not have the short name s in the render preset attribute space. Use the full form, rp.selected, rather than assuming that a shorthand available elsewhere applies here.
Use selectionFlag when that is the attribute you mean
selectionFlag is another inherited attribute, and its short name is sf. The documented examples are rp.sf and rp.sf false. These let you write the condition using either the attribute by itself or an explicit Boolean value.
Because selected and selectionFlag are separate attribute names, keep the distinction visible in your expressions. Choose the one that matches the state you intend to query; don’t substitute one for the other just because both refer to selection-related information.
A practical way to build a query
Start with the smallest expression that answers your question. If you are looking for a preset by name, begin with rp.n "A". If you want to narrow your attention to selected presets, use rp.selected; to express unselected status, use not rp.selected. If your condition is specifically about the selection flag, use rp.sf or rp.sf false. Keeping the attribute space, attribute name, and value clear makes expressions easier to read and revisit later.
These examples are small, but they help avoid a common source of friction: searching in the wrong node category or using a shorthand that is not available for the attribute. For the full attribute reference and related examples, see the render preset NSL documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
