088, and Why is it a good idea to Learn Python?

I recently saw the release of 088 is based on Python- So I can deduce that learning the Python coding language would be helpful.

But exactly how would it be helpful… ?

I still don’t have touch designer - waiting to purchase a computer capable of running it. I thought that maybe I should start learning Python, so that when I do get Touch I can use it to my advantage.

what do you thinK?

I recently saw the release of 088 is based on Python- So I can deduce that learning the Python coding language would be helpful.

But exactly how would it be helpful… ?

I still don’t have touch designer - waiting to purchase a computer capable of running it. I thought that maybe I should start learning Python, so that when I do get Touch I can use it to my advantage.

what do you thinK?

I started learning Python really slowly in prep for 088 and let me tell you, it’s crazy. There are more often than not more DATs with Python than any other family of operators in my projects. Stuff from data manipulation and routing, to just having things flow more controllable (having Python run certain aspects of my projects exactly when they need to be run), it’s been awesome for me.

It’s as easy as spending 10 minutes a day on codeacademy.com. It’s nice being able to open TouchDesigner and try coding in little blocks connected by wires, makes it easier to wrap your head around Python when you’re learning.

But in the end it really depends what you’re doing. You may never actually need much more than a really basic understanding of Python to use some of the really cool new features.

Thanks for your reply. Very exiting stuff.

What about creating and manipulating visuals> is coding in Python useful for that?

I would like to learn more about the actual uses of Python Coding in TouchDesigner.

Please comment.

thanks

oi elburz!

cheers for the codeacademy hint…that will come in handy.

~ fxamis

There are some things that you can do in Python and not in Tscript.

For a simple example, in Tscript, you can’t get the string parameters of certain operators with the ‘par’ function:

par(“moviein1:file”) outputs 0

whereas in Python,

op(‘moviein1’).par.file outputs the correct string parameter.

there is a lot you can do in python, but not in tscript, especially using external libraries …

getting a string also works in tscript, you just have to use pars(), i.e. pars(“moviein1/file”)

Good to know that, Achim!

Well, if Tscript could capture the output of an external process, there would not be that much one could do with Python and not with Tscript.

Python is also way faster in many cases though. I did one example where I was comparing some positions held in CHOP channels to each other to find closest neighbors. In TScript the script took 2.5ms to run, but n Python the same logic only took 0.17 ms to run.

Python is a replacement of TouchDesigner’s previous scripting language. If you don’t need to script you might never use python in TouchDesigner. TouchDesigner interface is node-based and you can create most things without the need to script, however, as you become more experienced at using TouchDesigner scripting will let you do a lot of tasks more easily and open up new options for customizing your projects.

I just want to stress this because you do not need to know how to script at all to get started in TouchDesigner. But once you are ready to try it, python is now there and offers much more power than our previous scripting language.

Some examples of what you can do with scripting;

  • run a script when a button is pressed (or any trigger happens)
  • parse XML files to extract useful data
  • change the values of parameters to anything at anytime
  • create lists, playlists of videos for example
  • manage files on the computer
  • build a custom queuing system to load and cache videos before they play
  • perform a custom action when drag and dropping a file into a project