Skip to content

Stack Studio ​

A drag and drop interface for creating Plugin Menus

Stack Studio is a GUI for creating plugin user interfaces that appear before users in Nanome. A Nanome plugin usually contains 2 major components: plugin scripts and plugin UI. While the scripts contain the behavior and computation of the plugin, the plugin UI is what the user sees and accesses in Nanome software. To create a sophisticated Nanome plugin, it's very likely that you would need to both write the script and create the UI.

Get Started ​

You can send feedback to bugs@nanome.ai or chat with us in our Slack user group (https://nanome.ai/slack).

Download Stack Studio ​

Windows DownloadMac Download

  1. Download Stack Studio and extract the zip file. If you can't extract it, an archiver such as 7-Zip can.

  2. Once you extract the file, open Stack Studio from the extracted folder (StackStudio.exe on Windows). Once it's running, you'll see the interface below.

Stack Studio on first launch, with an empty menu view, the Outline, and the Editor reading Create a Menu
  1. Create a JSON file at your preferred location. Copy the RMSD plugin menu JSON into the JSON file.

  2. Open the File menu in Stack Studio and choose Import, then pick the JSON file that you just created.

The File menu with Import highlighted
  1. Once the JSON file is loaded, you'll see the interface below.
Stack Studio with the RMSD plugin's menu in the menu view and its nodes in the Outline
  1. This is the menu of Nanome's first-party plugin, RMSD. Try changing it to get a rough idea of how Stack Studio works.

Workspace ​

The Stack Studio workspace with a new menu titled Header, the Root node in the Outline, and the Editor on the Layout tab
The menu view with an empty menu titled Header

Menu view renders a 2D interactable preview of the menu that you are creating. Any changes you make to the menu show up here right away. For interactable menu contents such as buttons and sliders, you can use your mouse to interact with them in the preview to check their visual behavior such as highlight color. However, since this is only a preview, interacting with the menu will not trigger any function.

Outline View ​

The Outline view with the Root node, and the Add Node and Delete Node buttons

Nanome plugin UI is managed in a hierarchical fashion, and Outline view shows this hierarchy. Each component in the menu is called a node. A node can't be larger than its parent node. You can collapse or expand a node that contains multiple children nodes. The eye icon on a node toggles its visibility, and dragging a node moves it to a new parent.

Editor View ​

The Editor view on the Content tab, with an Add Content button

The Editor has options for a node's layout and content, and for the menu size. These options are organized into 3 tabs. Clicking a tab switches the view, and clicking a node in the Outline picks the node to edit.

Layout Tab ​

The Layout tab for the Root node, with Name, Orientation, Sizing Type, Padding and other settings

In the Layout tab, you can change the way children nodes are laid out under the node that you are editing.

Content Tab ​

The Content tab for a node with no content, showing only Add Content

In the Content tab, you can change the properties of a node's content. The properties that get displayed here depend on the type of the content. By default, a new node does not have any content. The Add Content button gives it content.

The Content tab for a button named newButton, with its Text, Icon, Mesh, Outline and Tooltip settings

When a node is assigned a content type, you can view and edit its properties, such as name and padding. The picture above shows the properties of a button. UI Components describes each content type.

Window Tab ​

The Window tab with the title Header, width 0.7 and height 0.6

In the Window tab, you can change the menu window title and size. This tab changes the menu window properties, so it is independent from the node you selected to edit.

UI Components ​

The Add Content menu: Button, Mesh, Slider, List, Image, Label, Text Input and Loading Bar

When you add content to a new node, these are the contents currently available.

Button ​

A menu with one button that reads Button

Button is the fundamental interactable component of a plugin menu. When clicked on, a button sends an event to the plugin script with its name as payload. A button can include 5 sub-components, all of them optional: Text, Icon, Mesh, Outline, Tooltip. A button contains 5 states: Idle, Selected, Highlighted, Both, Unusable. You can customize the properties, such as color and visibility, of all 5 sub-components under all 5 states.

Mesh ​

A menu filled with a solid blue mesh

Mesh is a solid chunk that serves as a background. You can customize its color.

Slider ​

A menu with a slider set partway

Slider is an interactable component that sends the current slider position to the plugin script. It is useful in allowing the plugin user to change a value.

List ​

A menu with a list of numbered tiles in 2 columns and a scroll bar

List is a two-dimensional grid of children nodes that have to be assigned and managed during runtime in the plugin script. It allows the plugin to dynamically generate a menu of contents.

Image ​

A menu showing an image of a worker in a hard hat

Image is a 2D image. You can change the image's color.

Label ​

A menu with a label that reads Label

Label is static text that users can't interact with.

Text Input ​

A menu with a text input that reads Type your text here

Text input is a text input field. The field's content is sent to the plugin script when the text is submitted.

Loading Bar ​

A menu with a loading bar about a quarter full

Loading bar is a horizontal bar that can be empty or filled by a solid color that represents progress. It is mainly used to indicate progress for plugins that can take a longer time to run.

Integrate a Plugin Menu ​

To integrate a menu made with Stack Studio into a plugin:

1. Export the plugin menu as a JSON file ​

The File menu with Export highlighted

Open the File menu and choose Export.

2. Place the exported JSON file in the folder where you are creating your plugin ​

File Explorer showing a plugin folder with __init__.py, My_Plugin.py and the exported plugin_menu.json

Be sure to check that this is the same folder as the plugin script that you are writing.

Hotkeys ​

ctrl-n: spawn a new menu

n: add a node

c: add a content

1,2,3: switch tabs in the Editor

up, down: change selected node to the one above, below

left, right: change selected node to parent, child

ctrl-up, ctrl-down: move selected node up/down

ctrl-left, ctrl-right: deparent, parent selected node

ctrl-c, ctrl-x, ctrl-v: copy, cut, paste selected node

ctrl-shift-c, ctrl-shift-v: copy node to clipboard, paste node from clipboard

ctrl-s, ctrl-o: export, import

F2: rename selected node

delete, backspace: delete selected node