When a molecular scene contains many kinds of nodes, a search can be confusing if it is not clear what the expression is meant to match. Render presets have their own Node Specification Language (NSL) attribute space: renderPreset, abbreviated rp. That scope is useful when your task is specifically about identifying render preset nodes rather than other scene nodes.
Start by narrowing the target
The key detail is that the rp attribute space matches only render preset nodes. In other words, an expression beginning with rp is scoped to that node type. This makes it easier to express the intent of a query and helps avoid mixing preset-related checks with attributes from unrelated parts of a molecular model.
For example, the documented name expression is:
|
1 |
rp.n "A" |
Here, rp identifies the attribute space, n is the short name for name, and "A" is the quoted string value. The reference also gives rp.n "L*" as an example. Use the documented examples as a starting point when writing a name-based expression, and check the NSL reference for the precise matching behavior you need.
Check selection state deliberately
Render presets inherit the selected attribute from the general node attribute space. For render presets, write it as rp.selected; unlike some inherited attributes, it does not have the short name s in this attribute space. The reference gives both forms:
|
1 2 |
rp.selected not rp.selected |
These examples let you express the positive and negated forms of the selection check. If an expression unexpectedly returns no matches, verify that you have used selected rather than assuming that rp.s is available. The documentation specifically notes that the short name is omitted here.
Keep selectionFlag separate
selectionFlag is another inherited node attribute, with the short name sf. Its examples are:
|
1 2 |
rp.sf false rp.sf |
Although selected and selectionFlag both appear in the render preset attribute list and both accept Boolean values, they are distinct attribute names. Avoid swapping them just because their names sound related. When troubleshooting, check which attribute your expression actually needs, then use its documented spelling and value.
A quick expression checklist
- Target: Use the
rpprefix when you want the expression to match render preset nodes. - Name: Use
rp.nor the full attribute namerp.name, followed by a quoted string. - Selected: Use
rp.selected; do not assume the short namesapplies here. - Selection flag: Use
rp.sforrp.selectionFlag, and specifytrueorfalsewhen needed.
These small checks can make an NSL expression easier to read and easier to debug: first confirm the node type, then confirm the attribute, then check the value and spelling. For the full attribute reference and related examples, learn more about render preset attributes.
Note: SAMSON and all SAMSON Extensions are free for non-commercial use. Get SAMSON.
