Quickly Find the Right Render Presets in SAMSON with NSL

Molecular modelers working with numerous visual representations often face a recurring challenge: how to quickly identify and manage the different render presets used across complex models. When working on tailored scenes—perhaps to highlight secondary structures, interactions, or specific residues—render presets make a big difference. But navigating through them all can feel like finding a needle in a haystack.

This is where the Node Specification Language (NSL) in SAMSON becomes particularly handy. In this post, we’ll introduce how to filter and interact with render preset attributes using NSL, helping you get back in control of your model’s visuals—without getting lost.

What Are Render Preset Attributes?

Render presets in SAMSON determine how nodes (like molecules or molecules parts) are visually represented. The NSL allows you to filter nodes based on various attributes. When filtering render presets, you tap into the renderPreset attribute space, or just rp for short.

The NSL renderPreset attribute space helps answer common questions such as:

  • Which render presets are currently selected?
  • Are there presets named with a certain pattern (e.g., “Backbone*” or “Hydrophobic*”)?
  • Which presets were used but are no longer active (i.e., selectionFlag is false)?

Useful Filters You Can Use

Here’s how you can use NSL selectors to filter render presets more efficiently:

1. Search by Name

Use the rp.n selector to filter by name, which is useful when your team follows a naming convention for visualization styles:

This would select all render presets whose names start with Hydrophobic.

2. Check Selection Status

Check whether a preset is currently selected. This helps when you want to isolate what you’re actively working on:

To find what’s not selected:

3. Examine Selection Flags

Flags are helpful when determining whether a preset was previously interacted with, which can assist in decluttering your visual workspace:

This command gives you render presets that are present but not currently flagged for selection.

Why This Matters

When working on divergent views of the same molecular system (e.g., one emphasizing electrostatics and another focusing on structural motifs), render presets allow styling that aligns with the purpose of each view. But as complexity grows, so does the number of presets, making filtering essential to avoid confusion and duplication.

Being able to programmatically access and clean up your presets based on their name, selection state, or usage allows for faster workflows, more reproducible styling, and more clarity when toggling views. Whether you’re preparing images for publication or trying to locate a specific highlight preset, mastering just a few NSL filters gives control back to your modeling process.

Keep in Mind

Render preset attributes inherit elements from general node attributes but have their own behavior.

  • rp.n supports wildcards, offering strong search flexibility.
  • rp.selected operates without a short name (unlike general node selection, which may use s).
  • rp.sf allows testing for flag states to detect previously manipulated nodes.

These capabilities open the door to simple yet powerful queries, all within a quick text input.

To explore more about render preset filtering and the full list of node and attribute-space details, visit the original documentation here: https://documentation.samson-connect.net/users/latest/nsl/renderPreset/.

SAMSON and all SAMSON Extensions are free for non-commercial use. You can download SAMSON at https://www.samson-connect.net.

Comments are closed.