Understanding Render Preset Attributes in SAMSON

For molecular modelers, visualizing molecular systems effectively is often a critical part of their work. The appearance of molecules on screen can significantly influence analysis, presentations, and communication of results. SAMSON’s render preset attributes in the Node Specification Language (NSL) provide a powerful way to control and customize render settings effortlessly, but are you making the most of them?

This post focuses on the renderPreset attribute space and its capabilities in SAMSON. By learning how to use these attributes correctly, you can refine your molecular representations, making them clearer and more tailored to your needs.

What is a “Render Preset”?

In SAMSON, a “render preset” governs how specific nodes (such as molecules, atoms, or bonds) are displayed in the software. The renderPreset attribute space allows you to define and query such characteristics using the Node Specification Language (NSL). To make this system more efficient, render attributes have shorter aliases (short names), and can be applied to specific nodes for targeted visualization purposes.

The renderPreset attribute space uses the shorthand rp, and it works exclusively on render preset nodes. Below, we dive into the main attributes of this namespace.

The Core Attributes

Three key attributes for controlling render presets are:

  1. Name (name): This attribute allows you to label or identify a preset. Its short form is n. For example, to name a render preset as “A”, you can use rp.n "A". Wildcards are also supported, such as rp.n "L*".

  2. Selected (selected): This attribute checks if a node is selected in the workspace. For instance, rp.selected returns true if the render preset is currently selected, while not rp.selected ensures the opposite. Unlike other attributes, selected does not have a short alias.

  3. SelectionFlag (selectionFlag): Use this if you need to query or modify whether a flag indicating selection is active on a node. Its short name is sf. For instance, rp.sf or rp.sf false.

Practical Examples

The true strength of the renderPreset attribute space lies in its flexibility. Here are some examples to help you visualize its potential:

  • Querying nodes with a specific preset name: rp.n "Lattice"
  • Identifying preset nodes that are not selected: not rp.selected
  • Highlighting nodes without an active selection flag: not rp.sf

By using such straightforward expressions, you can identify render presets more precisely in your molecular system and adjust settings on the go. This clarity helps with analysis and creates stunning visualizations for your projects.

Why Use Render Presets?

Modelers often struggle with large datasets containing numerous molecules, atoms, or bonds. Mismanagement of visual elements can lead to cluttered screens and difficulty understanding molecular arrangements. With render presets, you can segment and focus on what truly matters, ensuring your visualization remains both aesthetically pleasing and functionally insightful.

Attributes like name, selected, and selectionFlag enable you to work smarter, customizing molecular views to highlight specific details at the right time.

For a complete reference on these attributes and more, visit the official documentation page: Render Preset Attributes in SAMSON.

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

Comments are closed.