Molecular modelers often spend a significant amount of time tweaking visual parameters to highlight structural features. Whether it’s for presentations, publications, or just better visual inspection, being able to identify and manipulate specific render presets becomes essential.
In SAMSON, render presets define how molecular structures are displayed (e.g., ball-and-stick, ribbons, surface views). However, navigating complex molecular scenes with multiple presets can become tedious if you’re manually clicking through the graphical UI.
Fortunately, SAMSON offers a solution via the Node Specification Language (NSL), which allows you to search and filter render preset nodes using specific attributes. This makes it far easier to locate and adjust just the parts of the scene you need.
Understanding the renderPreset Attribute Space
In NSL, every render preset is part of the renderPreset attribute space, abbreviated as rp. You can query various attributes to select only the relevant nodes.
Here are the key attributes available:
| Attribute | Short Name | Description |
|---|---|---|
name |
n |
Match render presets by name |
selected |
— | Check if a preset is currently selected |
selectionFlag |
sf |
Filter by the selection flag explicitly |
Common Use Cases
Here are some real examples of how you can make use of these attributes:
- Find a specific render preset by name:
rp.n "Ball*"
Returns all render presets whose name starts with “Ball” (e.g., Ball-and-Stick). - Select all active (selected) render presets:
rp.selected - Find all render presets not currently selected:
not rp.selected - Exclude render presets with an active selection flag:
rp.sf false
Why This Matters
One of the more frustrating pains for molecular modelers is the need to repeatedly click through objects to identify a specific visual style or to synchronize the appearance of multiple components. This can be especially time-consuming in complex multi-component molecular assemblies.
Using NSL keywords for render presets, you can quickly target just the elements you need. You can then perform batch actions like toggling visibility, changing styles, or updating coloring schemes without hunting through a nested scene tree.
Pro Tip
If you’re building a custom workflow—for example, preparing a consistent ribbon view across several protein chains—you could use:
|
1 |
rp.n "Ribbon*" and not rp.selected |
This selects all ribbon-style presets that are not currently active, allowing you to enable them in one go.
Learn more about render preset attributes in the SAMSON documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
