Docs Core
ToolbarRegistry
The toolbar surface registry and mirror rail. The raw master, promoted to /sys; clone it to put your own tools on the bar.
◈ Core
Why use it
Most FNS tools put a button on TouchDesigner's bookmark bar, the row of icons under the main menu. If each tool copied its own button in, every one of them would need a slot that does not collide with the others, and removing a tool would leave its button behind, dead, or a gap where it was. TouchDesigner's UI is never saved with a project either, so each tool would have to redo the job on every launch.
ToolbarRegistry is the one owner of that bar. Tools publish a widget into it, and the registry decides what sits where, in what order and whether it is shown. It also runs the mirror rail: each button on the bar is a mirror, a live view of the widget inside its tool, so the bar always reflects the registry and nothing is copied into it. Install a tool and its button appears in its slot; remove it and the bar closes up.
Features
- Bookmark bar slots, order and visibilityKeeps which widgets sit on TouchDesigner's bookmark bar, in what order and which are shown, so installing or removing a tool never leaves a hole or a dead button.
- Mirror railEach button on the bar is a live view of the widget inside its tool, so no button COMP is ever copied into the bar.
- Arrange the bar in HubThe Toolbar tab of Hub reorders and groups widgets, sets their width and adds dividers between them.
- Hide buttons you never useHiding a button from its row in Hub takes it off the bar while the tool stays installed.
- Layout follows youYour arrangement is saved with your settings and comes with you to every project.
- Reset the toolbar layoutReset toolbar puts every tool back in the slot it shipped in.
- Drop a panel on the FNS buttonDropping any panel COMP on the FNS button gives it a self-registering host and puts it on the bar, the quickest way to add a tool of your own.
- Register from a host or from PythonA host copy inside a tool registers it on load; RegisterWidget(), SetWidgetDisplay() and WidgetTarget() do the same work from code.
How to use it
The registry is part of the toolkit's core and installs with it. You meet it through the tools that put buttons on the bar, and through Hub, where the bar is arranged.
- Left-click the FNS button at the right end of the main-menu bar to open Hub, and pick the Toolbar tab.
- Drag rows to reorder the bar.
- Hide a button you never use from its row. The tool stays installed; only its button leaves the bar.
- Add dividers between widgets, put related tools in a group, or set a widget's width.
- Right-click a name to open that tool's docs.
Your arrangement is saved with your settings through ConfigRegistry and follows you to every project.
- To change one tool without opening Hub: its Registry page carries Toolbar Order, Displayed and Bar Width for that tool alone, and every edit you make in Hub is written back there. The whole section is listed under What it adds to a registered tool.
- To start over: right-click the Toolbar tab, choose Parameters and press Reset toolbar. Every tool goes back to the slot it shipped in, and TouchDesigner's own icons, the dividers and the groups go back to the shipped layout. Your own arrangement is lost, so it asks first.
For tool authors
There are three ways to put a tool on the bar:
- Drop it on the FNS button. Drop any panel COMP on the FNS button, or anywhere on the Hub window, and pick Toolbar from the menu that opens. The COMP receives a self-registering host, is placed after the bar's last entry and appears at once. It stays where it is in your network.
- Stamp a host from a script:
op.FNS.op('FNS_ToolbarRegistry').StampHost(tool, canonical_name='MyTool'). - Copy the host out of any shipped tool and repoint it.
A host is a small copy of this registry living inside the tool. Widget COMP
names the panel to publish (the host's parent by default), Canonical Name
gives it a unique name, and Auto-register keeps it published for as long
as the tool exists. The host registers when it loads. In a project that has
no registry yet, the first host to load installs one in /sys, reachable as
op.FNS_TOOLBARREGISTRY; when two versions meet, the newer one takes over and
keeps every registration.
Building the widget:
- The bar draws every widget 19 pixels tall, so build it at that height. Its width follows the widget unless Bar Width is set.
- The widget stays in your tool, and the bar shows it through a Select COMP
mirror in
/ui/dialogs/bookmark_bar. Clicks reach the widget through the mirror, and its references to the rest of your tool keep resolving.
From Python, guard the call, since no registry is guaranteed to exist in a given project:
reg = getattr(op, 'FNS_TOOLBARREGISTRY', None)
if reg is not None:
reg.RegisterWidget(op('button_mytool'), 'MyTool', order=20)
The registry lives in /sys, which TouchDesigner does not save with the
project, so a registration made from a script has to run again on every open.
A host does that for you. UnregisterWidget(), SetWidgetOrder(),
SetWidgetDisplay() and the Widgets snapshot are the rest of the manager
API. WidgetTarget('MyTool') returns the live widget behind a canonical name:
use it in a parameter expression and the reference follows the widget when it
moves or is renamed.
Get it
Tick it on the install page and it installs with the rest of your setup and stays up to date.
Download FNS_ToolbarRegistry.tox Version 3.2.9, the tool on its own. It works in any project, and this copy never updates itself.
Parameters
Registration
| Control | Type / default | What it does |
|---|---|---|
Widget COMPComp |
operator.. | Panel COMP published as the toolbar widget. Defaults to the parent component. |
Canonical NameCanonicalname |
textempty | Unique name for this widget in the global toolbar registry. |
Callback DATCallback |
operatorempty | Optional DAT with toolbar callbacks for this widget. |
Auto-registerAutoregister |
on / offoff | When on, keep this widget published into the global toolbar registry while this component exists. |
RegisterRegister |
button | Publish once into the global toolbar registry, even if Auto-register is off. |
UnregisterUnregister |
button | Take this tool's contribution back out of the registry and turn Autoregister off, so it stays out. Register puts it back. |
Registration StatusRegstatusread-only |
textempty | Read-only status of this host registration. |
Toolbar OrderMenuorder |
number-1 | Preferred order among registered widgets, managed by the global registry. -1 = no preference (append at the end). |
DisplayedDisplayed |
on / offon | Default visibility of the widget in the toolbar (managed by the global registry). |
Bar WidthBarwidth |
number0 | Width of this widget in the toolbar. 0 = auto (follow the widget). Persisted here; the registry writes manager edits back. |
Help URLHelpurl |
textempty | The tool's wiki/help page opened from the Configurator (right-click the Name cell). Leave empty to auto-discover from a docsHelper COMP (its Url par) inside the registered panel or its parent. |
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. |
What it adds to a registered tool
Every tool that registers gets these on its own Registry page.
| Control | Type / default | What it does |
|---|---|---|
Auto-registerAutoregister |
on / offoff | When on, keep this widget published into the global toolbar registry while this component exists. |
RegisterRegister |
button | Publish once into the global toolbar registry, even if Auto-register is off. |
UnregisterUnregister |
button | Take this tool's contribution back out of the registry and turn Autoregister off, so it stays out. Register puts it back. |
Registration StatusRegstatusread-only |
textempty | Read-only status of this host registration. |
Toolbar OrderMenuorder |
number-1 | Preferred order among registered widgets, managed by the global registry. -1 = no preference (append at the end). |
DisplayedDisplayed |
on / offon | Default visibility of the widget in the toolbar (managed by the global registry). |
Bar WidthBarwidth |
number0 | Width of this widget in the toolbar. 0 = auto (follow the widget). Persisted here; the registry writes manager edits back. |