A Strategy for Tracking TouchDesigner Code with Git
I've been a long time user and fan of version control systems, from the early days of SVN to being a daily user of Git for all my code based work, my website and also even my TouchDesigner projects.
TouchDesigner is of course a binary format, not a format Git can parse and make sense of, so you can't see code changes over time. Yet much of my work like many others using TouchDesigner makes use of Python inside various DAT ops, so surely there must be a way to expose the Python externally so it can all be tracked in Git?
A few months ago I chanced upon Embody — a series of tools for TouchDesigner which amongst other things allows you to externalise the code in a Touch project, saved in a format they call .tdn I tried it out and all worked fine but to be honest it felt a but too heavy for my needs. All I wanted was to expose the code so Git could see the differences when I pushed a changed. I didn't want to have Touch load these external files, that was beyond the cope of my needs.
So I made a small .tox file which, when saving a .toe project, writes all the DAT file code contents to operator named files, to a a folder structure that mimic the paths of the operators. Now when I push a commit those changes can be visibly seen and diffed in Git.
Custom Parameters
I also added the ability to save custom parameters on any Comp if it's tagged with git
In the .tox you can set the root operator to find the DATs, plus you can set the folder to store these files. I put them in .code so they can't been seen in the folder, but still get tracked with Git.
Download
You can download the .tox here. Just drop it into the root of your project and then set the parameters to suit. Each time you save the .toe the files will be written.
git_tracker.zip