I’m wondering where someone with no programming experience should start as a basis for understanding how to write scripts in touch.
I feel like I’m so close to figuring some of it out but I feel like maybe I should be picking up a book on some of the overall fundamentals of computer programming itself. What would you recommend?
Would be interested in hearing if there are any other people on the board who came to touch with no programming experience and now have a pretty good handle on it. What stuff did you study to learn it? Did you print out all of the different commands on actual paper so you had a list of them sitting next to you all the time, etc, etc. There is just so much stuff
I really want to dive into it some more but I just wanna make sure I have some kind of path/ direction to go in instead of just flipping around through different wiki pages.
as for touch scripts… the commands and expressions dialog in the touch help menu is good. Although it’d be cool if you could copy and paste the example scripts in there.
Unfortunately, T-script is based on the old h-script from Touch’s ancestor, Houdini. Its syntax etc. seems to be drawn from the scripting tools used in Unix, such as Cshell etc - because Houdini originally only ran on Silicon Graphics machines under Irix.
There are some books on scripting with these things but they were never really treated as a proper language with beginner courseware etc.
There has been some discussion of phasing out T-script and using Python instead. viewtopic.php?f=4&t=2932&p=10322&hilit=python#p10322
but it might still be some time before we get to use it. This was done with Houdini a couple of years ago and I think the two scripting methods still co-exist so old scripts don’t break. I guess you’d simply put a marker at the top of your script to let Touch know which was which.
so, of the ‘proper’ languages out there, Python might be a good choice because:
it will probably eventually be part of Touch (Derivative guys and gals can you comment?)
it’s very nice to learn as there are lots of books for beginners and it is not plagued by curly brackets like many languages. I like this as a great introduction to programming: openbookproject.net/thinkcs/ … english2e/
Another cool language is Proce55ing processing.org/
Processing is built on Java but simplified in a way that lets artists quickly get making stuff. There are lots of books for beginners and advanced. Cool things about it: you can make your things run in a web page and there’s a great community extending into arduino and other interesting stuff.
Meanwhile, back in Touchdesigner, here is how I got started with scripting …
set up something like what you want to script but using operators in the GUI,
then use the ‘opscript’ command to find out how you would generate it from a script.
3.even though there’s a great help browser thing, it’s sometimes good to just type ‘help’ followed by the name of the command. then you can copy and paste the examples into your script. remember that expressions need the ‘exhelp’ command to get the right info.
remember that expressions always need to be put inside backticks (usually on the ~key) anywhere a string is expected but you don’t need them where a numerical value is expected in a numerical parameter field for example. Getting expressions confused with script commands is something I still do but you do get used to it.
try to get into the habit of typing stuff in instead of pasting so that you start to learn the patterns through your fingers. later, sure, copy and paste by all means but occasionally make yourself type it to keep that muscle memory.
install Notepad++ derivative.ca/wiki077/index. … =Variables. You need to find where it got installed and put in the full path to the program file of the editor.(See? you are already hacking stuff!)
to edit a dat, you can edit it directly in the viewer or rightclick on the dat and select ‘edit contents’ to open it in you text editor. Notpad++ or similar will give you line numbers, coloring etc. Don’t forget to save and close it before moving on. you can also edit in the textport but I find that a bit confusing personally (I keep typing help etc. into my scripts by accident).
if you have to make a long and complicated expression in one of an operator’s parameter fields, click in the field, then type to open up an editor. Once again, you need to save and close it and also sometimes hit return in the field afterwards before it updates.
search the wiki and the forums for your questions, then it’s easier to ask for further clarification in that thread of the forum. touch folk tend to be helpful with newb questions, we’ve all been there and know it sucks so don’t be shy.
this are great tips Rod, will definitely look in to scripting by this light, thank you!
one of the main reasons i’m studying TD and researching with it is that I tend to run away from text-based programming, but i recognize completely it’s advantages. With TD I find that the two worlds tend to blend together very well, and I hope it will get me more into coding with time
It looks like it might not be hard to integrate that with TouchDesigner, either as the default editor using the touch_editor variable or some more intimate support in the touch code somewhere. Their editor has some nice stuff like pop-up sliders for tweaking variables and values while testing code.
It seems to be based around Python but people are using it with Processing and other things.
I have only taken a little look at it but I might try to install it and see how well it works. If Derivative could find a way to plug this in to Touch in some way, it would make scripting very fun.