Skip to content

Instantly share code, notes, and snippets.

@raganmd
Last active July 12, 2018 17:50
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raganmd/400660b79a5fa39e77a0a001b088989a to your computer and use it in GitHub Desktop.
Save raganmd/400660b79a5fa39e77a0a001b088989a to your computer and use it in GitHub Desktop.
A TouchDesigner snippet for looking at how to start another touch process.
# matthew ragan | matthewragan.com
import os
import subprocess
# we need to know the location of our app
app = "{}/TouchDesigner099.exe".format(app.binFolder)
# we also need to know the location of our file
file = "{}/other-process.toe".format(project.folder)
# we're going to set an environment variable for fun
os.environ['ROLE'] = "render1"
# we can start the process with a Popen() call
app_process = subprocess.Popen([app, file])
# next we can find our process ID
app_id = app_process.pid
# to make this a little easier to quit our process we'll
# put some of these things into storage for later access
other_app = {
"app_process" : app_process,
"app_id" : app_id
}
parent().store('other_app', other_app)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment