Python scripting

This section is dedicated to the feature & improvement requests (be sure what you are asking does not exist yet in TVPaint Animation ;) )
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Python scripting

Post 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.
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Python scripting

Post 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 ?
Quicktime is DEAD. Get over it and move on !
User avatar
slowtiger
Posts: 2949
Joined: 08 May 2008, 21:10
Location: berlin, germany
Contact:

Re: Python scripting

Post 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.
TVP 10.0.18 and 11.0 MacPro Quadcore 3GHz 16GB OS 10.6.8 Quicktime 7.6.6
TVP 11.0 and 11.7 MacPro 12core 3GHz 32GB OS 10.11 Quicktime 10.7.3
TVP 11.7 Mac Mini M2pro 32GB OS 13.5
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: Python scripting

Post 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.
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
masterchief
Posts: 237
Joined: 07 May 2008, 12:23
Location: Chicago, IL
Contact:

Re: Python scripting

Post 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
TVPaint Animation Pro v11
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: Python scripting

Post 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).
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Python scripting

Post 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 :)
Quicktime is DEAD. Get over it and move on !
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: Python scripting

Post 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?
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: Python scripting

Post 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
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: Python scripting

Post 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
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Python scripting

Post 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.
Quicktime is DEAD. Get over it and move on !
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: Python scripting

Post 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 :)
Quicktime is DEAD. Get over it and move on !
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: Python scripting

Post 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!
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: Python scripting

Post 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
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
masterchief
Posts: 237
Joined: 07 May 2008, 12:23
Location: Chicago, IL
Contact:

Re: Python scripting

Post 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
TVPaint Animation Pro v11
Post Reply