How to Quickly Filter Render Presets in SAMSON with NSL

When working on complex molecular models, the scene can easily become cluttered with visual presets. Whether it’s different representations for various parts of a biomolecule, or custom shaders applied during visualization iterations, keeping track of render presets can slow you down.

This is where the Node Specification Language (NSL) in SAMSON can help. In this post, we’ll explore how to use NSL to filter and select Render Preset nodes efficiently — a small but powerful trick that can make a big difference as your molecular models grow more elaborate.

Why filter render presets?

Render presets in SAMSON define how nodes are visualized — for instance, whether something appears as sticks, spheres, or surfaces, with certain colors or styles. Over time, especially during collaborative or complex projects, you may end up with many presets in your document.

Being able to quickly query and identify which presets are active, selected, or named a certain way can save you time and help avoid errors in visualization or exports.

Getting started with NSL and the renderPreset attribute space

The attribute space for render preset nodes in NSL is renderPreset, or rp for short. Here are a few simple but practical filters you can use directly in the selection filter bar:

Filter by name

To select all render presets whose names start with L:

The wildcard * at the end allows you to match any number of characters, helping you find presets like LigandSurface, LoopRender, etc.

Check for selected render presets

If you want to see which render presets are currently selected:

To find those that are not selected:

This is particularly helpful before applying actions like deletion or export.

Filter based on selection flags

selectionFlag, or rp.sf, can further refine your queries. For example:

This selects render presets with a false selection flag, which could be used for display layers you’d like to exclude in further steps.

Best practices

  • Reuse naming patterns in render preset names for easier filtering (e.g., prefix render presets by region or function).
  • Use NSL queries as part of selection filters to prepare for batch actions (hiding, deleting, exporting).
  • Combine NSL conditions for more targeted selections, such as finding only unselected render presets with a certain name pattern.

The NSL table summarizing these attributes in the documentation is concise and worth bookmarking:

NSL render preset attributes table

While these tools may seem small, they add up when managing a large, multi-state model. Efficient selection leads to better focus and fewer visualization errors — especially when preparing figures or simulations for publication or review.

To learn more, visit the full Render Preset documentation page: https://documentation.samson-connect.net/users/latest/nsl/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.