Page 1 of 2

Python scripting

Posted: 19 May 2008, 01:22
by idragosani
I know TVPaint has a scripting language (George, right), but has anyone considered creating a Python scripting interface for TVPaint? This could even be used, ultimately, to create plugins written in Python (don't know if plugins can be created with George or if they require the SDK). If TVpaint is written in C++, a Python interface would be even easier to create.

Re: Python scripting

Posted: 19 May 2008, 07:37
by ematecki
Unfortunately, Python has some shortcomings when embedding it into another app.
Last time we looked at it (python 2.3 I think), it was still not reentrant, and it was not a priority for Python devers to fix it.
This means you can't run two python scripts 'at the same time'.
Even if one script just opens a window and wait for the user doing something with that window,
starting another script will just crash the application.
We wrote a prototype to test it and it crashed as promised !

Once this has been fixed in python we will look closely at it again, 'coz george is getting old.
But there are some other scripting languages in the starting blocks, and at least LUA and Ruby are serious competition.
Maybe Python 3.0 once released ?

Re: Python scripting

Posted: 19 May 2008, 09:33
by slowtiger
I'm not much of a programmer, but LUA is used in Anime Studio, and some users did amazing things with it. There's a forum section for that here: http://www.lostmarble.com/forum/viewforum.php?f=12.

Re: Python scripting

Posted: 19 May 2008, 10:29
by idragosani
ematecki wrote:Once this has been fixed in python we will look closely at it again, 'coz george is getting old.
But there are some other scripting languages in the starting blocks, and at least LUA and Ruby are serious competition.
Maybe Python 3.0 once released ?
I was also going to suggest Ruby! I'm not familiar with Lua but know a lot of apps that use it.

Hmmmm... is the non-reentrant characteristic of Python a Windows thing? I know of several 3D animation applications that use Python for embedded scripting as well as for building plugins, but they are Linux applications.

Re: Python scripting

Posted: 19 May 2008, 16:01
by masterchief
I would like to see Perl used for scripting....

if george script allows for calls to command processor, probably already have capacity to execute perl scripts


regards,
William

Re: Python scripting

Posted: 19 May 2008, 16:12
by idragosani
masterchief wrote:I would like to see Perl used for scripting....

if george script allows for calls to command processor, probably already have capacity to execute perl scripts
I wouldn't mind Perl either... however, depending on what the native language is that TVPaint is developed with, Perl can be more of pain to integrate, especially if Perl needs to "discover" existing data structures in memory (easier with C & Perl, not so easy in C++ & Perl). I tried doing this on an open source 3D animation package with Perl and it was more trouble than it was worth... Python integrated much more smoothly (and I am asking the developers of that package right now if there are extant issues with Python being re-entrant).

However, writing an offline scripting interface with Perl probably wouldn't be difficult with something like SWIG -- offline meaning it doesn't need to use existing data structures in memory but just doing image processing on a frame sequence (similar to using Perl modules for ImageMagick or the Gimp).

Re: Python scripting

Posted: 19 May 2008, 16:24
by ematecki
No way !
Perl code is so ugly looking that any non-computer guy will run away screaming !!!
Perl is the only write-only language I know of. You can't read and understand it anymore a few days after you wrote it.
There are certainly a few functional or declarative languages in this category too, but then who cares :)

Re: Python scripting

Posted: 19 May 2008, 16:36
by idragosani
ematecki wrote:No way !
Perl code is so ugly looking that any non-computer guy will run away screaming !!!
Perl is the only write-only language I know of. You can't read and understand it anymore a few days after you wrote it.
There are certainly a few functional or declarative languages in this category too, but then who cares :)
I love Perl (actually prefer it over Python), but unless you are an experienced Perl developer, I think Python is the way to go -- easier for non-developers to use, much cleaner to read and easier to learn. :-)

FWIW, though, I think Weta Digital still uses a lot of Perl still in their VFX development (and Python, too).

So, my vote is for Python or Ruby -- although leaning more towards Python because it's more well known. Latest Python version is 2.5.2 -- have you looked at that one?

Re: Python scripting

Posted: 20 May 2008, 03:27
by Mads Juul
My Experience In Scripting is Javascript, the Adobe scripting language based on javascript And PHP.

I have no preferred language, But Im interested in the most powerful scripting language where I can take totally control over the software and the computer.
What Im currently missing with George is:
-Better Arrays - search array associated arrays. return arrays from functions.
- some kind of OOP
- Better file System support , create files search folders delete files anf folders, EXECUTE folder for instance a .bat file you have created with the scripting language
- or maybe the possibility to communicate directly with the oparating systems command line or what its called.
- A socket object or a way to communicate over the intranet/internet with other computers.
- better control over the exported item, setting the codec etc

-mads

Re: Python scripting

Posted: 20 May 2008, 06:10
by Mads Juul
One thing I also think is important with Scripting is the ability to easy the transition between 2 jobtypes (Storyboarding to Layout) or (Layout to animation)

for instance we are soon going to make a film animated in maya, but storyboarded in tvpaint. so it could be could

if I was able with a script in Tvpaint and a scrip in maya . to automatically save a avi or quicktime or single files from tvpaint, auto matically open maya and import the storyboard into the right animation file for reference.

-mads

Re: Python scripting

Posted: 20 May 2008, 07:31
by ematecki
madsjuul wrote:My Experience In Scripting is Javascript, the Adobe scripting language based on javascript And PHP.

I have no preferred language, But Im interested in the most powerful scripting language where I can take totally control over the software and the computer.
What Im currently missing with George is:
-Better Arrays - search array associated arrays. return arrays from functions.
- some kind of OOP
- Better file System support , create files search folders delete files anf folders, EXECUTE folder for instance a .bat file you have created with the scripting language
- or maybe the possibility to communicate directly with the oparating systems command line or what its called.
- A socket object or a way to communicate over the intranet/internet with other computers.
- better control over the exported item, setting the codec etc

-mads
Python is your scripting language of choice !
Everything you ask about (except of course TVPA internals access, which you'll get if we choose Python) is in the base python interpreter.
And there are SOOOO many extensions available, you can do just about everything with it.

Re: Python scripting

Posted: 20 May 2008, 07:36
by ematecki
idragosani wrote: So, my vote is for Python or Ruby -- although leaning more towards Python because it's more well known. Latest Python version is 2.5.2 -- have you looked at that one?
We are waiting for a 3.0 beta, it's already in alpha stage so it won't (shouldn't :) be too long a wait.

Pyhton is also our best choice if it works technically.
It has a very clean syntax, lot's of built-ins, easy to extend, OO.
And a lot of books, no need to write a manual :)

Re: Python scripting

Posted: 20 May 2008, 09:59
by idragosani
ematecki wrote:
idragosani wrote: So, my vote is for Python or Ruby -- although leaning more towards Python because it's more well known. Latest Python version is 2.5.2 -- have you looked at that one?
We are waiting for a 3.0 beta, it's already in alpha stage so it won't (shouldn't :) be too long a wait.

Pyhton is also our best choice if it works technically.
It has a very clean syntax, lot's of built-ins, easy to extend, OO.
And a lot of books, no need to write a manual :)
That's great! It'll make TVP that much more powerful!

Re: Python scripting

Posted: 20 May 2008, 10:19
by idragosani
ematecki wrote:Python is your scripting language of choice !
Everything you ask about (except of course TVPA internals access, which you'll get if we choose Python) is in the base python interpreter.
And there are SOOOO many extensions available, you can do just about everything with it.
Hey Eric --

I talked with another developer who has created a scripting engine with Python for use with a 3D animation package called K-3D (http://www.k-3d.org). It's open source, BTW. They have the concept of "scripted nodes", where there is a procedural pipeline of a hierarchy of nodes that can be objects, transformations, Python scripts, etc. Re-entrancy hasn't been a problem; in fact, the scripted nodes wouldn't work at all otherwise.

So maybe the issues have gone away with newer versions of Python?

TVP Paint would really rock with Python

Re: Python scripting

Posted: 20 May 2008, 12:14
by masterchief
I use Modo and it uses Perl as scripting engine.... it also will use Lua I belive...
there are TONS of available Perl scripts out there, all FREE


regards,
William