When working on intricate molecular models, it’s common to juggle multiple render presets to fine-tune visuals. However, as the number of render presets grows, identifying and managing them becomes increasingly time-consuming. If you’ve ever wished there was a clearer way to isolate the right visual configuration—or to find unused or default ones—this post is for you.
In this article, we explore how the selection-related attributes of renderPreset nodes in SAMSON can help streamline your workflow. Specifically, we’ll look at how to use the Node Specification Language (NSL) to filter render presets with the selected and selectionFlag attributes.
What Are Render Presets?
Render presets in SAMSON define how molecular structures are visually represented. These might include color mappings, transparency, representation types (e.g., van der Waals or cartoon), and more. Managing them manually when switching between various visual analyses can be tedious, particularly when working with large or collaborative models.
Simplify Your View with NSL
SAMSON’s Node Specification Language allows you to query nodes—including render presets—using specific attribute filters. This means you can find exactly what you’re looking for, without manually scanning your workspace.
Using rp.selected to Find Active Nodes
The selected attribute lets you check whether a render preset node is currently selected. To list all selected render presets, simply use:
|
1 |
rp.selected |
This is especially helpful if you want to apply changes only to render presets you’re currently working with, or to clone a selected configuration for reuse across multiple structures.
To find render presets that are not currently selected, the query becomes:
|
1 |
not rp.selected |
This can help you clean up unused presets or troubleshoot inconsistencies within your scene.
Using rp.sf to Query with Selection Flag
The selectionFlag (short name: sf) attribute provides another way to filter render presets. Unlike selected, selectionFlag is often used to mark nodes programmatically. This can be useful in advanced workflows or custom scripts that automate scene changes.
To find presets with the selection flag set to false, enter:
|
1 |
rp.sf false |
To find all presets where the selection flag is set (i.e., true):
|
1 |
rp.sf |
The distinction is subtle but useful—especially in scenes where presets are programmatically flagged based on specific molecular conditions.
Common Use Cases
- Scene Cleanup: Remove or hide unselected or flagged presets to reduce clutter.
- Consistency Checks: Ensure only actively used presets are influencing visuals.
- Batch Editing: Modify rendering options across all flagged nodes at once.
Conclusion
By using NSL queries like rp.selected and rp.sf, selecting and managing render presets can become a much faster and more reliable process—especially when dealing with complex scenes containing many layers of representation.
To learn more about render preset attributes in SAMSON, visit the official documentation.
SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.
