In molecular modeling, clear visualization is often the difference between insight and information overload. You’ve been there: a jumble of atoms, bonds, colors, and representations, all piling up into an intricate (and unreadable) tangle. This is where Render Presets in SAMSON can really help.
Render Presets are configurable visualization wrappers in SAMSON that determine how structures are rendered in your scene. But when working with complex models or reproducible visualization setups, molecular modelers often hit a wall: how do I filter, identify, and manipulate these presets programmatically?
This is exactly where the Node Specification Language (NSL) comes in—and with it, the very focused renderPreset attribute space (short name rp). Let’s take a closer look at how you can use NSL to regain control of your visual representations.
What Can You Query in Render Presets?
Render Presets come with attributes you can use inside SAMSON’s NSL system. These attributes let you select and filter presets based on name, selection status, and selection flags.
Let’s walk through each one:
rp.n: Filtering by Render Preset Name
Use this when you want to query preset names. You can even use wildcards, making this especially helpful when trying to apply uniform changes or inspections across similarly named presets.
|
1 2 |
rp.n "A" // selects Render Presets named exactly "A" rp.n "L*" // selects Render Presets with names starting with "L" |
rp.selected: Is It Actively Selected?
This attribute lets you isolate presets that are currently selected or deselected, ideal for workflows that depend on what you have clicked in the interface.
|
1 2 |
rp.selected // selects currently selected Render Presets not rp.selected // selects currently unselected Render Presets |
rp.sf: Selection Flags for Advanced Filtering
Selection flags store if something is marked for selection (not necessarily selected now but queued for selection). Very useful to drive scripts when dynamically changing nodes.
|
1 2 |
rp.sf // selects Render Presets whose selectionFlag is true rp.sf false // selects those where it’s false |
Why This Matters in Practice
You can programmatically group, modify, or visually isolate specific visual presets. If you apply NSL in scripting or even inside the search field in the Graph or Document view, you’ll make your visualization workflows faster and more repeatable.
Example: Say you want to change the color of all Render Presets starting with “L” that are not currently selected. You can use NSL to target precisely those:
|
1 |
rp.n "L*" and not rp.selected |
A timesaver during interactive design, especially for large assemblies or multi-representation scenes.
Conclusion
If you frequently manage complex molecular visualizations, Render Presets combined with NSL attributes like rp.n, rp.selected, and rp.sf can help you tame the chaos using more systematic, scriptable operations.
Learn more from the official documentation page here: https://documentation.samson-connect.net/users/latest/nsl/renderPreset/
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download it at https://www.samson-connect.net.
