Understanding Camera Attributes in SAMSON’s Node Specification Language

For molecular modelers, the ability to effectively manipulate and control camera settings is a crucial aspect of producing clear, insightful visualizations. In SAMSON, the Camera attribute space within the Node Specification Language (NSL) offers powerful ways to manage and query camera nodes.

This blog post will introduce you to the Camera attributes in SAMSON’s NSL, covering common attributes like name, selected, and selectionFlag, along with their usage. Let’s dive in!

What are Camera Attributes?

Camera attributes belong to the dedicated camera attribute space in NSL (short name: ca). These attributes are specifically designed to match and operate on camera nodes in SAMSON. Some camera attributes are inherited from the generic node attribute space, but they are tailored to camera-specific functionalities.

Key Attributes Explained

Below are the key Camera attributes, along with practical examples of how to use them to streamline your molecular modeling tasks:

name

The name attribute helps you identify camera nodes by their names. It’s particularly useful when you’re working with multiple cameras, and you want to isolate or control one of them by name.

  • Short name: n
  • Possible values: Strings enclosed in quotes (e.g., "Camera1").

Examples:

These expressions allow you to target camera nodes named MainCamera or those with names starting with Snapshot-.

selected

The selected attribute indicates whether a camera node is currently selected or not. Unlike the node.selected attribute, it does not have a short name.

  • Possible values: true, false

Examples:

The above examples can be used to filter queries based on whether a camera is selected.

selectionFlag

The selectionFlag attribute aids in more detailed querying of selection states. It is a more advanced attribute for those who want fine-tuned control.

  • Short name: sf
  • Possible values: true, false

Examples:

Here, you can filter for camera nodes where selectionFlag is set to false or query those with the attribute set.

Putting It Together

When combined, the attributes in the Camera attribute space help molecular modelers build flexible queries that enhance control over camera objects in SAMSON. Whether you’re filtering nodes by their names or toggling properties like selections, understanding these attributes can save time and improve workflow efficiency.

To learn more about the Camera attribute space and experiment with additional examples, visit the official documentation page: here.

SAMSON and all SAMSON Extensions are free for non-commercial use. Download SAMSON at SAMSON Connect.

Comments are closed.