A Simple Way to Filter Render Presets in SAMSON Using NSL

In molecular modeling, visual fidelity is often more than aesthetics—it’s a way to focus on what really matters. Whether you’re refining a protein surface or comparing molecular contributions in different environments, render presets help you design visual styles quickly and consistently.

But when you’re juggling dozens—or even hundreds—of presets in complex systems, the question isn’t just “How do I create them?” It’s also: “How do I find and organize them efficiently?”

This is where the Node Specification Language (NSL) in SAMSON becomes especially useful. In this post, we’ll explore how filtering render presets using NSL attributes like name, selected, and selectionFlag can help you manage visual groups quickly, accurately, and without needing to script anything complex.

Why filtering render presets matters

Let’s imagine you’ve built multiple styles for different molecular scenarios: hydrophobic mapping, electrostatics visualization, or schematic representations for publication. Each of these styles is saved as a render preset. Over time, these build up. And suddenly, it’s not so easy to find what you need—especially if you’re reusing presets between projects or collaborating with others.

NSL lets you retrieve and apply logic to presets instantly. It’s like a command line for your molecular scene, but designed for selection.

Filtering by attribute: What’s available?

Render presets in NSL are matched in the renderPreset attribute space (short name: rp). Here are the main attributes you can use to filter them:

  • name (short: n): Matches presets by name using exact strings or patterns.
  • selected: Filters based on whether the render preset is selected in the viewport.
  • selectionFlag (short: sf): Useful when working with subsets of selections.

Each of these can be used in combination to quickly isolate the presets you need. Here’s how.

Practical examples

1. Find presets with a specific name:

This finds all render presets that are explicitly named “Hydrophobic Surface”.

2. Use wildcards to find multiple variants:

This selects presets where the name starts with “Electro”—useful when you have “Electrostatics”, “Electro Field”, and “Electro Neutral” presets.

3. Check for currently selected presets:

This matches all render presets that are currently selected in your hierarchy or viewport.

4. Inverse logic:

Useful to quickly deselect a batch or identify unused presets.

5. Use selection flags in workflows:

Filters presets with an active selection flag—great for stepwise workflows where you flag what’s been reviewed.

Why this helps you

If you’ve ever spent time clicking through a hierarchy of visualization settings or cross-checking render states just to find the right view, you’ll instantly appreciate how NSL can simplify this. Typing a simple query is faster and reduces manual errors.

Better yet, it makes you more confident in your analyses because you’re precise in what visual context you’re operating in—no more accidents where the wrong preset was active.

To learn more and dive deeper into render preset attributes, visit the NSL documentation for renderPreset.

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

Comments are closed.