Quickly Filter and Find Render Presets in SAMSON with NSL

When working with complex molecular models, scientists often face the tedious challenge of navigating and managing large numbers of visual elements—render presets being one of the most common components in scenes involving 3D views, materials, colors, and visual styles. If you’ve ever wished there were a clean and ultra-precise way to search through all your render presets without manually clicking through each node, the Node Specification Language (NSL) in SAMSON can help.

In this post, we’ll focus on a helpful subset of the NSL: the attributes available for the renderPreset attribute space (short name: rp). These allow you to quickly filter render presets by name, selection state, or selection flag to fine-tune your models or streamline your design process. 🧪

What is a Render Preset?

A render preset in SAMSON defines how a node is visually represented. It can include color shading, transparency, or even specific render styles. This makes it a powerful way to change how molecular structures or components are visualized.

Why Searching Render Presets Matters

Imagine you’re refining a large biomolecular model and looking for all presets named “Lipid” or are currently selected. Clicking your way through the Document view gets overwhelming beyond a few dozen elements. Instead, why not use NSL to instantly filter for exactly what you’re looking for?

Using the rp Attribute Space

The rp prefix filters for nodes that are specifically render presets. From there, you can refine your selection using three attributes:

  • rp.n (name): Matches a specific name or pattern
  • rp.selected: Indicates whether a render preset is selected in the interface
  • rp.sf (selectionFlag): A boolean flag used programmatically to mark nodes

Example Queries

Find all render presets named “A”:
rp.n "A"

Find all render presets starting with “L”:
rp.n "L*"

Find all currently selected render presets:
rp.selected

Find all unselected render presets:
not rp.selected

Find all render presets where selection flag is off:
rp.sf false

What’s the Difference Between selected and selectionFlag?

selected tells you what’s actually selected in the user interface, while selectionFlag is a more flexible, scriptable boolean you can toggle in your pipelines or automation scripts. In practice, rp.sf is often used in combination with procedural operations or batch tagging.

Integrating This into Daily Modeling

Let’s say you’re exporting a model but only want to include visible or highlighted components. With NSL, filtering for rp.selected lets you instantly isolate those. Or suppose you want to programmatically apply a change only to unselected components—you can simply work with not rp.selected and proceed.

Whether you’re building publication-ready visuals or debugging the visual logic in your molecular pipeline, using the render preset attribute space with NSL saves clicks and helps maintain clarity.

You can check out the full documentation for all available render preset attributes here.

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

Comments are closed.