When a molecular scene contains several render presets, finding the one you mean can be a small but persistent annoyance. A preset’s name, whether it is selected, and its selection flag are separate attributes. Keeping those distinctions clear makes Node Specification Language (NSL) expressions easier to read and helps avoid searching with the wrong kind of condition.
The render-preset attribute space is renderPreset, with the short name rp. It matches render preset nodes. That gives you a useful starting point: use rp when your expression is intended to describe presets, rather than treating these attributes as if they were general molecular-structure properties.
Use names to identify presets
The inherited name attribute has the short name n. Its values are strings in quotes. The documented examples are:
rp.n "A"rp.n "L*"
Quoting the value is important: the expression is specifying a string, not an unquoted identifier. If you are writing or reviewing a query, this is also a quick way to spot a likely typo. The reference gives these example expressions but does not define the matching behavior of characters such as *, so do not assume what that character means based on this page alone.
Keep selection state and selection flag distinct
The reference lists two Boolean attributes: selected and selectionFlag. Both can be tested as true or false, but they are separate names in the attribute space.
For selected, the examples are rp.selected and not rp.selected. Notice that this attribute has no short name in the render-preset reference. In particular, the page explicitly says it is inherited from node.selected without the short name s. Writing the full name makes the intended condition clear and avoids carrying a shorthand over from another context.
selectionFlag does have a short name: sf. The documented forms are rp.sf and rp.sf false. Use the full attribute name when readability matters; the short form is useful when you already know which attribute it represents. Avoid swapping selected and selectionFlag just because both are Boolean—the reference lists them separately and links each to its own inherited node attribute.
A quick check before using an expression
- Confirm that you are targeting render preset nodes: the attribute space is
rp. - If you are identifying a preset by name, put the string in quotes, as in
rp.n "A". - If the condition concerns the node’s selected state, use
rp.selectedornot rp.selected; this page does not giveselecteda short name. - If you mean the selection flag, use
rp.selectionFlagor its documented short form,rp.sf.
These checks are especially handy when revisiting an old expression: they make it easier to tell whether it is testing a name, a selected state, or a selection flag, without guessing from the surrounding scene.
For the complete attribute reference and its inherited-attribute links, see the render preset NSL documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
