Docs Core

PaneTypeRegistry

Named, persistent pane-type entries for TD's panebar: any COMP can appear in the pane-type dropdown and be recalled with configurable owner, type, window actions and callbacks.

◈ Core

Why use it

The dropdown on every pane bar switches a pane between Network Editor, Geometry Viewer, Panel and the rest. Getting your own control panel or tool UI into a pane takes more steps than that: switch the pane to Panel, point it at the right COMP, maybe maximise it or open its parameters, and repeat the same steps every session.

PaneTypeRegistry lets a COMP join that dropdown as a named, persistent entry. Pick it and the pane becomes that COMP, with the owner, pane type, window behaviour and callback the entry declares. Entries are recalled by name and come back when the project opens, so the UI you reach for every session is one dropdown pick away. The registry also adds an OP Browser row, which TouchDesigner's own list leaves out.

Features

  • Recall a COMP from the pane-type dropdownA COMP joins the pane bar's pane-type dropdown; picking it turns the pane into that COMP with the entry's owner, pane type, window behaviour and callbacks.
  • Register a COMP from the dropdownRight-click a built-in row to register the network the pane shows as a new entry of that type, kept with the project.
  • Run one action on right-clickRight-click a registered row to run one step on its own, such as Set Owner, Tear Away or Open Floating Network Editor, or to unregister it.
  • Open a floating network editorThe Floating network editor quick-launch command opens a floating network editor on the network you are in.
  • Register a tool as a pane typeA tool ships a host copy of the registry and registers on load, declaring its COMP, pane type, and the window actions or callback to run on recall.for tool authors
  • Callback on recallAn optional callback runs after the built-in actions, for what they cannot express: focusing a field, opening a panel, restoring state.for tool authors

How to use it

The registry is part of the toolkit's core and installs with it. Tools that register a pane type simply appear in the dropdown: PreviewPanel and its PopViewer are two. Pick one and the pane turns into it.

To add an entry of your own:

  1. In any pane, go to the COMP you want to recall, so that it is the network the pane shows.
  2. Open the pane-type dropdown and right-click the row of the type you want the entry to use, for example Panel.
  3. Choose Register "name" as Panel..., edit the menu name if you like, and press Register.

The registry puts a small host inside the COMP, so the entry re-registers every time the project opens. A new entry recalls as Owner + Type: it points the pane at the COMP and switches the pane to that type.

Right-click a registered row for one-off actions on the pane you are in: Recall (as registered), or a single step on its own (Owner + Type, Set Owner, Change Type, Maximize, Tear Away, Float, Open Parameters, Run Callback), plus Open Floating Network Editor on the entry's COMP and Unregister. The steps the entry runs on recall are ticked.

The quick-launch command Floating network editor opens a floating network editor on the network you are in.

For tool authors

A tool that wants its UI available as a pane type ships a host copy of this registry and registers on load. The host's Registration page declares the entry: the COMP that owns the pane (the host's parent by default), the Canonical Name shown in the dropdown (the host COMP's name when empty), and the Pane Type applied on recall. A few things to know:

  • The Panel pane type needs a Panel COMP; the other types accept any COMP.
  • To place the entry among the custom rows, set Menu Order: 0 is first, -1 appends. TouchDesigner's own rows are not moved.
  • To choose what recall does, use the toggles under Default Actions: Set Owner, Change Type, Maximize, Tear Away, Float and Open Parameters. Tear Away always sets the owner and type first, so the torn-off pane shows the right COMP.
  • With Auto-register on, the COMP is registered at once and the entry follows these settings as they change. With it off, use Register or Python.

On recall the built-in actions run first, in that order, and then the callback. Press Create Callback for a callbacks DAT with an onPaneRecall(ctx) skeleton, assigned to Callback; it never overwrites a DAT that already has text. The hook is for what the flags cannot express, and one that raises is contained: the recall still completes.

def onPaneRecall(ctx):
	# ctx: pane (reassigned after a type change), pane_comp (the pane bar COMP
	# that triggered it), owner (the registered COMP or None), canonical,
	# info (the raw entry), registry (the extension)
	owner = ctx.get('owner')
	if owner is not None and hasattr(owner, 'Open'):
		owner.Open()

The global lives in /sys as op.FNS_PANETYPEREGISTRY. From Python, guarded:

reg = getattr(op, 'FNS_PANETYPEREGISTRY', None)
if reg is not None:
	reg.RegisterPanel(op('mypanel'), 'My Panel', pane_type='PANEL', maximize=True)

RegisterPanel() also takes set_owner, change_type, tear_away, float_pane, open_parameters, callback and menu_order. UnregisterPanel() removes an entry and RecallPanel(pane, name) recalls one into a pane. /sys is rebuilt on every open, so a script registration has to run again each time; a host does that for you.

Get it

Tick it on the install page and it installs with the rest of your setup and stays up to date.

Download FNS_PaneTypeRegistry.tox Version 3.2.9, the tool on its own. It works in any project, and this copy never updates itself.

Parameters

Registration

ControlType / defaultWhat it does
COMPComp operator.. COMP to register as the pane owner. Defaults to parent (..). PANEL requires a Panel COMP (isPanel); other pane types accept any COMP.
Canonical NameCanonicalname textempty Name shown in the panebar menu. Leave empty to use the host COMP name.
CallbackCallback operatorempty Optional Text DAT with onPaneRecall(ctx). Invoked after built-in recall actions. Use Create Callback for a skeleton.
Create CallbackCreatecallbacks button Create a callbacks Text DAT with a default onPaneRecall(ctx) skeleton and assign it to Callback. Will not overwrite non-empty existing callbacks text.
Auto-registerAutoregister on / offoff When on, register the host COMP immediately and keep recall flags / callback in sync when settings change. When off, use Register or Python RegisterPanel.
RegisterRegister button Register the host COMP now (even if Auto-register is off). Validates COMP type against Pane Type.
UnregisterUnregister button Take this tool's contribution back out of the registry and turn Autoregister off, so it stays out. Register puts it back.
StatusRegstatusread-only textIdle Read-only status of host auto-registration (Idle, Registered, Skipped under /sys or /ui, Error).
Menu OrderMenuorder number-1 Preferred order among registered panebar entries. -1 = no preference (append, default). 0 = first among custom entries, 1 = second, and so on. Built-in rows are not moved.
Pane TypePanetype menuPanel Pane type applied when this entry is selected in the panebar. PANEL is typical for containerCOMP UIs.
Options: Panel, Network Editor, Geometry Viewer, TOP Viewer, CHOP Viewer, Animation Editor, Parameters, Textport and 1 more
Default Actions
Set OwnerSetowner on / offon When on, set the pane owner to the registered COMP when this entry is selected.
Change TypeChangetype on / offon When on, change the pane to the selected Pane Type. changeType returns a new Pane object; Maximize/Float/Callback run after.
MaximizeMaximize on / offoff When on, maximize the pane after recall (pane.maximize = True).
Tear AwayTearaway on / offoff When on, tear the pane into a floating window after recall (pane.tearAway()).
FloatFloat on / offoff Open the registered COMP in a floating window. PANEL/Geometry/TOP/CHOP -> openViewer(); PARAMETERS -> openParameters(); Network Editor and other tool types -> showInPane Floating.
Open ParametersOpenparameters on / offoff When on, open a floating parameter dialog for the registered COMP (op.openParameters()). Available for any pane type.
Promote ParametersPromotepars on / offon When on, the host mirrors its key Registration parameters onto the parent tool as a bound 'Registry' page. Turn off before shipping a tool that should not expose registry controls.
Pre-Save HealPresaveheal on / offon Before each project save, re-check this registry: update entries whose component moved, drop entries whose component is gone, and republish a host that initialised before the global registry existed. Off skips the sweep for this registry only.

About

ControlType / defaultWhat it does
View ReadmeViewreadme button Open the PaneTypeRegistry developer README as a styled markdown annotate in this network (uses the bundled md viewer).

What it adds to a registered tool

Every tool that registers gets these on its own Registry page.

ControlType / defaultWhat it does
Auto-registerAutoregister on / offoff When on, register the host COMP immediately and keep recall flags / callback in sync when settings change. When off, use Register or Python RegisterPanel.
RegisterRegister button Register the host COMP now (even if Auto-register is off). Validates COMP type against Pane Type.
UnregisterUnregister button Take this tool's contribution back out of the registry and turn Autoregister off, so it stays out. Register puts it back.
StatusRegstatusread-only textIdle Read-only status of host auto-registration (Idle, Registered, Skipped under /sys or /ui, Error).
Menu OrderMenuorder number-1 Preferred order among registered panebar entries. -1 = no preference (append, default). 0 = first among custom entries, 1 = second, and so on. Built-in rows are not moved.