A common pain for molecular modelers and visualizers is efficiently managing complex scenes with many render presets. When dealing with multiple visual styles—cartoon, licorice, surface, and more—it’s easy to lose track of your custom presets, especially in large systems. You might simply want to select or isolate only a few relevant render presets without manually searching for them. Fortunately, the Node Specification Language (NSL) in SAMSON offers an efficient solution: intuitive attribute filtering for renderPreset nodes.
Why renderPreset Filtering Matters
Imagine having dozens of render presets in your project—some for showing secondary structure in proteins, others for visualizing hydrophobic pockets or electron density maps. If you’ve named them descriptively, you should be able to call them up quickly. SAMSON’s NSL makes this possible by letting you search based on attributes directly tied to those render presets.
The renderPreset Attribute Space
The renderPreset attribute space, shortened to rp, includes attributes inherited from the more general node space but is focused specifically on render preset nodes. Key attributes include:
name (n): Find nodes by their assigned name. This is especially useful when you use structured naming like “LigandPocket_Surface” or “Cartoon_AlphaHelix”.selected: Query whether a render preset is currently selected. This makes it simple to build contexts or workflows based on user interaction.selectionFlag (sf): Check if the selection flag is set on a render preset. This can help distinguish between visible and non-visible presets if you’re toggling visibility using selection flags.
Practical Examples
Let’s say you want to isolate all render presets you named starting with “L”. You could use the query:
|
1 |
rp.n "L*" |
This matches all render presets whose name starts with “L”. It’s great for thematic grouping!
To find only render presets that are currently selected in the viewport, you can use:
|
1 |
rp.selected |
Want to find all those that aren’t selected?
|
1 |
not rp.selected |
And to locate render presets where the selection flag is unset:
|
1 |
rp.sf false |
These allow you to rapidly build precise filters and automate part of your visualization workflow—no more tedious selection-click-unselect tedium.
A Clearer Scene with Fewer Clicks
If you’re juggling multiple visualization modes or preparing figures, using rp attribute queries lets you focus only on the layers that matter. Combine these filters with automation for even smoother modeling and analysis experiences. The more structure and naming conventions you apply, the more powerful your NSL interactions become.
To get started using these queries, visit the full documentation page for render preset attributes: 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.
