Building tools to make programming easier – GOTO Cue

Recently I have been using Touchdesigner to make theatre. Touch is great because it lets you quickly edit content in real time and move along in the tech process, however I was getting really annoyed at searching my network to find components when I had to edit a “Cue”. I was longingly looking over at the lighting designer’s desk where they were speedily bringing up cues, editing them, and continuing, while I was still searching for the correct comp. So I started to think about how I could make this more manageable.

There is a way that Touchdesigner lets us go to parts of our network quickly in the network browser.

NavBar

I could just type in the component address and be taken to it, but it takes a surprising amount of time to parse the text in that long string and then type in where you want to go. I could get around this by just bookmarking the base that holds all of my “cues” but that isn’t a practical method for actually going to a cue, especially when there are 100+ of them.

CueStack

The solution was to make an application in Touchdesigner that makes this quick.

How do you write something that controls the Touchdesigner interface though?

The desk command in T-script allows you to control your ‘desk’. This pertains to how panes are laid out and what they are looking at in the network. A little research in the Touchdesigner wiki yields this page: http://www.derivative.ca/wiki088/index.php?title=TScript:Desk_Command

T-script reads a bit like bash script. You have a command “desk”, followed by arguments that are denoted by a “-“.  So in order to make pane1 go to base1 inside of project1 you would type out this into a text dat:

desk -p /project1/base1 pane1

Change the text DAT to run in T-Script by clicking this button.

T-Script_change

You are able to tell if you are in T-script or Python by the text color. Python is cyan/T-script is pink.

If you right click on the text DAT and run the script, you should be taken right to the project1 base.

 

Now let’s work on making this more usable in a tech scenario! I would really like this to work by typing a number into a field and pressing a button that runs this script with the appropriate cue number inserted.

Interface

This is what I setup to get input into our program.

Shifting gears over to how some of the plumbing behind how this widget works. We are going to use a fun DAT called substitute. In the same level of our network we are going to set up something like this:

Sub

“GOTOPath” is a text DAT that holds the all the “bones” for the T-script. If you look at the path, we can see something peculiar, ‘item##’. ## is a place holder for the cue I want to go to. Then in the substitute parameters we set our “before” to be ## and our “after” to be the null coming out of the field.

SubParm

Cool. Now our script should update to be what ever value you put into your field. Last thing to do is make the button take us there.

Inside out button comp insert a Panel Execute DAT. This DAT allows you to use panel values to drive scripting.

PanelExe_button

This script is just running the T-script text DAT outside our button.

Now if we view this container, and use this interface, we should be able to jump to any cue that our script is pointing at.

Example

 

And there you have it. Your very own “GOTO cue” button!

Making tools for specific tasks allows you to focus more on the design and less on the work. You should spend time developing systems that aid you in your work and make for a faster workflow. Just be sure to balance you investment of time. Here is a relevant XKCD: http://xkcd.com/1205/