Last active
July 12, 2018 17:50
-
-
Save raganmd/400660b79a5fa39e77a0a001b088989a to your computer and use it in GitHub Desktop.
A TouchDesigner snippet for looking at how to start another touch process.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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