Working on complex molecular scenes often means dealing with many different visualization styles. Whether you’re organizing a biomolecular assembly or preparing figures for publication, managing and filtering render presets in SAMSON can get a bit tricky — unless you know how to use the Node Specification Language (NSL) effectively.
If you’ve ever struggled to identify only the render presets that follow a specific naming convention, or you just wanted to isolate the ones currently selected in your document, then learning how NSL handles renderPreset attributes can save you a lot of time.
What are render preset attributes in NSL?
In SAMSON, renderPreset refers to nodes that define how molecular structures are visualized (e.g., cartoon, van der Waals, wireframe), including color schemes and other graphical parameters. These presets can be accessed and filtered using the rp attribute space in NSL.
Here’s a breakdown of the key attributes you can use with rp in your expressions:
| Attribute | Short Name | Example Usage |
|---|---|---|
| name | n |
rp.n "Surface*" |
| selected | (none) | rp.selected |
| selectionFlag | sf |
rp.sf false |
Use Cases That Matter
Let’s say you have dozens of render presets applied across a sprawling model. You want to find all render presets whose names begin with “Ligand”, either to hide them or modify them. The query:
|
1 |
rp.n "Ligand*" |
returns only those nodes.
Need to find which render presets are currently selected in the document? This query does the job:
|
1 |
rp.selected |
On the other hand, if you want to isolate presets that are not flagged for selection, perhaps to avoid applying batch changes to them:
|
1 |
rp.sf false |
These expressions allow you to pipe the result into further operations — like hiding, modifying, or deleting presets — without manually locating them in a complex hierarchy.
Notes on Inheritance
The renderPreset attribute space inherits several attributes from the general node space. One subtle point to keep in mind: while the selected attribute is available, it does not include a short name alias (like s in regular nodes), so be sure to always spell it out as selected.
Why It Matters
For molecular modelers and structural biologists working in SAMSON, managing visualization is a central task. Learning and using these NSL expressions can dramatically reduce the time spent hunting through nodes and increase your efficiency when managing complex scenes.
To learn more about renderPreset attribute space and explore additional examples, visit the official documentation page: https://documentation.samson-connect.net/users/latest/nsl/renderPreset/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can get SAMSON at https://www.samson-connect.net.
