script for exporting layers

Please use this part to report bugs & errors, ask questions & "How to..."
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

script for exporting layers

Post by malcooning »

hello with another question!

Currently I'm working with files that have footage in them. On top of the footage there are a few other layer with rotoscopes of different parts of the footage, all in the same length as the footage. In order to export the resulty into a compositing program, I need to export each layer seperately into a movie, and name each movie as the corresponding layer.
The way I do it now is manual, going through each layer, making it solely visible, and exporting that to a file. could there be any way of automating the process, by creating a script that will:
1. export each layer seperately into a whole movie file
2. name the exported files as the corresponding layers

I know it's a bit outside the capabilities of the current code, but maybe someone can prove me wrong?

thanks for any suggestion,
a.
User avatar
fabrice_
Posts: 1146
Joined: 08 Feb 2006, 14:57
Location: France

Post by fabrice_ »

I know it's a bit outside the capabilities of the current code, but maybe someone can prove me wrong?
I think it could be done easily with a george script ... (I don't exactly remember but I think I wrote a script which was exporting all my layers last year, I will search it in my HD)

Btw, the george scripts experts will certainly answer soon :wink:

Fabrice Debarge / Beta-Team member / Author of the user-manual.
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Re: script for exporting layers

Post by malcooning »

malcooning wrote: I know it's a bit outside the capabilities of the current code, but maybe someone can prove me wrong?
I actually wrote this line to provoke the capable people. I don't for a second undermine the power of the code... :wink:
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post by Manuel »

I will zip the script and send it to the content sharing forum.
Manuel
User avatar
TVPaint
Site Admin
Posts: 711
Joined: 07 Feb 2006, 13:36

Post by TVPaint »

http://www.tvpaint.com/forum/viewtopic.php?t=537

well done Manuel ! (haven't tried it at the moment however)
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post by Manuel »

I am not sure if malcooning wanted separate pictures or AVIs or something else.
This script will save AVI or DEEP or QT.
I only tested AVIs.
Manuel
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post by malcooning »

Manuel,
this is brilliant. it's exactly what I neede!
You just saved me LOADS of time!
thank you so much.

But I do have one issue:
I changed the extention in the script file to '.mov'. The first time I ran the script, it brought up a session window, in which I could choose the codec to render the quicktime. That was brilliant. But every time I run the script no, it no longer brings up the codec dialogue. Furthermore, how do I set the export to be Millions+ colors, RGB+A, premultimplied Alpha, and 'No Background' options chosen? (I tried to export once normally, setting everything as above, thinking that the script will remember the export setting for next use, but it didn't.)

sorry, one more thing: is there a way to setup a defult directory for the script to export to, instead of punching in the whole path each time?

Cheers,
A.
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post by Manuel »

About the path , open the script and replace

Code: Select all

tv_ReqString "Enter Path (ending by \)"
path = result
by

Code: Select all

path = "d:\mypath\"
Manuel
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post by Manuel »

About the colors, Export a layer by hand and change the setting to what you need.
After that, run the script.

I don't know if there is a way to call the QT panel.
It seems that it pops up automatically the first time it is used in TVPA.
Sorry, I can't help more.
Manuel
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post by malcooning »

I was trying that, and I exported a few times with setting to include an alpha channel, and made sure that no background is rendered. the files I exported were fine. But as soon as I used the script to export, it automatically added the background to the exported files. (just in case, 'none' was selected in the layer panel).
This happenes with AVI and QT alike.

Could this has to do something with the "tv_savemode" line, where 'AVI', or 'QT' should include more parameters?

Any idea? (did you try this yourself, just to make sure?)
User avatar
ZigOtto
Posts: 4102
Joined: 17 Feb 2006, 22:50
Location: south-Petazonia

Post by ZigOtto »

- have you set the codec compression to "none", (or Animation), millions colors+, mode RGBA, PreMultiply ?
- if yes, try to quit (save config) and re-start TVPA
(not sure it will work for the script, but who knows, ... whithout trying?)
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post by Manuel »

I have added :

Code: Select all

tv_AlphaSaveMode PreMultiply
to the script, but still have no alpha with qt.
I'm not a QT expert and don't have the latest drivers.
I can't help more, sorry.
Manuel
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post by malcooning »

ok,
I've checked both QT and AVI exports. it seems that it does export as the last setup that was defined in the export session. Which means that it does export alpha only, or rgb+alpha.
The problem here is that via the script, it always adds the 'background' option. regardless of whether it was ticked off at the export dialogue. It happenes both with AVI and QT here.
do you manage to export AVI with alpha via the script?
is there a way to add a line into the script that slects 'no background'?

Zigotto, I've tried restarting with saved config, but it didn't make a difference, apart from allowing again to choose a codec for QT.

Thanks for your efforts Manuel.
Manuel
Posts: 673
Joined: 09 Feb 2006, 14:09
Location: France-Moselle

Post by Manuel »

I have uploaded a modified script.
It saves the layers in QT with alpha.

I use Custom brushes instead of sequences, it seems to work this way.
I hope it will work for you.
Manuel
User avatar
malcooning
Posts: 2114
Joined: 29 Mar 2006, 12:43
Location: Tel Aviv
Contact:

Post by malcooning »

Manuel,
I kiss you. this script is perfect. works like a charm, and very smooth.
This should be embedded in the next release of tvpaint for certain.
Thank you for taking time to see to this script.

by the way, the changes that you made, do they mean that now, when exporting, each layer is rendered into a custom brush, and then the seperate brushes are exported to movies?

I wish I had the patience to learn the code and write my own scripts.
This will add a whole new dimension of tvpaint experince for me!

thank you millions.
A.
Post Reply