Docs Commands

ProjectCommands

Turns your project's own scripts into commands: select a Text DAT, a COMP of scripts or a component with an extension and run Make Project Command, and they list in the command palette, ready for a Stream Deck key. Everything stays in your network and saves with the .toe.

⌘ Commands

Why use it

Most projects grow a handful of small scripts: reset every feedback loop, switch the output to the projector, jump the timeline to the start of the show. They sit in a Text DAT somewhere, and running one means finding it and pressing Ctrl+R.

ProjectCommands lists them in the CommandPalette next to every other command. Type a few letters of the label to run one, or bind it to a key of a Stream Deck with StreamDeck. The commands belong to the project: open another project and you see its commands.

Features

  • Mark the selectionMake Project Command turns the selected Text DATs, COMPs of scripts and components with an extension into commands; Remove Project Command undoes it.
  • New script in one stepNew Project Script adds a script and opens it, making a project_commands COMP in the network you are looking at when the project has none.
  • Label and help from commentsThe script's first comment line is its label in the palette and the comment lines after it are its help.
  • Component methods without codeA marked component offers every public method of its extension, with prompts for the method's arguments.
  • Kept with the projectThe marks are tags on your own operators, saved with the .toe, so each project has its own commands.
  • Follows your editsA script added, renamed or deleted, or an extension edited, updates the commands by itself.

How to use it

  1. Select a Text DAT that holds a script, in any network of your project.
  2. Open the palette (Ctrl+Shift+P), type make project command and press Enter. The script is now a command, labelled from its first comment line.
  3. Open the palette again and type the label to run it.

To start a new script, run New Project Script from the palette (or pulse it on the package). It adds script1 to the first COMP of scripts in the project, makes a project_commands COMP in the network you are looking at when there is none, and opens the network with the new script selected.

Remove Project Command stops the selection being commands. Rescan Project Scripts reads everything again; you need it only after tagging an operator by hand or pasting in a COMP of scripts from another project.

What you can mark

Select It becomes
a Text DAT one command, running the DAT
a COMP with an extension every public method of the extension, listed under the COMP's name
any other COMP a COMP of scripts: every Text DAT inside it is a command, including ones you add later

Mark as many as you like, anywhere in the project. Networks of the toolkit and of TouchDesigner itself (/FNSTools, /sys, /ui, /local) are never searched and cannot be marked.

Inside a COMP of scripts only Text DATs count, so a script can keep a table or an Execute DAT beside it without either becoming a command. A Text DAT that is a command because its COMP holds scripts cannot be removed on its own: unmark the COMP or move the DAT out.

Writing a script

# Reset feedback
# Resets every Feedback TOP in the network on screen.

for t in ui.panes.current.owner.findChildren(type=feedbackTOP):
	t.par.resetpulse.pulse()
  • The first comment line is the label. The comment lines after it, up to a blank comment line or the first line of code, are the help shown in the palette. With no comment at the top, the label comes from the DAT name (reset_fx becomes Reset fx). An edited header shows the next time the script runs.
  • The DAT name is the command's identity. Favourites, hidden choices, presets and Stream Deck keys follow the name, so renaming a script unbinds them. Two scripts with the same name: the first one found wins, and the Status parameter names the other.
  • It runs as if you pressed Ctrl+R on the DAT, with me the script and the live ui. A command run from a Stream Deck key takes no focus, so the parameter under your mouse and the selection are still yours to act on.
  • An error is reported. The palette footer shows the last line of the error and a Stream Deck key shows its alert; the full traceback goes to the textport.

Up to 124 scripts per project.

Component methods

Select a component with an extension and run Make Project Command, and every public method of the extension becomes a command of that component, with no change to its code. A rig COMP with

def SetScene(self, scene: int = 1):
	"""Switch the rig to a scene."""

lists Set scene under rig, with the docstring as its help, and asks for scene when you run it (1 if you just press Enter). Type hints decide what kind of value is asked for. Methods whose names start with an underscore are left out, and a component offers up to 24.

A method you add or rename shows up once the extension reloads. A component whose extension has no public methods is refused and left unmarked.

Where it is kept

Nothing about your commands is kept inside the package. Each mark is a tag on your own operator, saved with the .toe:

  • Each project has its own commands. A Stream Deck key bound to a command the project in front does not have shows (off).
  • Updates and reinstalls cannot touch them, since the package holds none of them.
  • The list follows your edits: a script added, renamed or deleted, a marked operator renamed or deleted, or a marked component's extension edited updates it a frame later. Nothing runs while you are not editing.

The Status parameter says where the commands were found, or why there are none; Scripts counts them.

Get it

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

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

Parameters

Project Commands

ControlType / defaultWhat it does
New Project ScriptNewscript button Add a script to this project and select it. Makes the project_commands COMP in the network you are looking at when the project has none.
Rescan Project ScriptsRescan button Read every command source again. Changes are picked up by themselves; use this after tagging something by hand or pasting a scripts COMP in from another project.
StatusStatusread-only textempty Where the commands were found, or why none were. A readout; not saved.
ScriptsScriptsread-only textempty How many scripts are registered as commands. Methods of marked components are listed under their own names.