When a molecular scene contains several render presets, the practical problem is often not creating another one—it is identifying the right preset without confusing its name with its selection state. SAMSON’s Node Specification Language (NSL) provides a compact way to describe render preset nodes using their names and two inherited boolean attributes: selected and selectionFlag.
The render-preset attribute space is renderPreset, abbreviated rp. It matches only render preset nodes. That makes the prefix useful as a reminder of what kind of node an expression is describing. For example, the documented name expressions are rp.n "A" and rp.n "L*". The attribute’s full name is name, and its short name is n; values are written as strings in quotes.
Start with the name
If you know a preset’s name, naming it in the expression is a straightforward starting point. Keep the quotation marks around the string, as in rp.n "A". The reference also lists rp.n "L*" as an example. It is a reminder that the documented examples include more than one kind of name expression, but this page does not specify the matching rules for special characters. If an exact match matters, use the preset’s precise name and check the broader NSL documentation for expression behavior.
Names are useful for communicating intent, too. A query that names a preset is easier for a colleague—or your future self—to interpret than one that relies only on a transient state.
Keep selection state separate from identity
A preset’s name answers “which one?” The inherited selected attribute describes a different property. The documented forms are rp.selected and not rp.selected. Unlike some inherited node attributes, selected has no short name in the render-preset attribute space. In particular, the page says not to use the node-level short name s for this attribute here.
This distinction helps prevent a common source of confusion: a selection expression is not a substitute for identifying a preset by name. If you are expressing a condition about selection, use the documented boolean form. If you are expressing a condition about identity, use name or n.
Use selectionFlag explicitly
selectionFlag is also inherited from the node attribute space, and its short name is sf. The reference gives both rp.sf false and rp.sf as examples. Its possible values are true and false. When writing or reviewing an expression, the explicit form rp.sf false makes the intended boolean value visible at a glance; the shorter rp.sf form is also documented.
A useful habit is to read an expression in two passes: first check the rp prefix to confirm the target node type, then check whether the condition is about n, selected, or sf. This simple separation makes expressions easier to inspect and reduces the chance of mixing up a preset’s name with its selection-related attributes.
For the complete attribute list and links to related NSL references, see the render preset attributes documentation.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
