A script to import TVPaint's CSV file format

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Re: A script to import TVPaint's CSV file format

Post by Fazek »

You can find a new version on the download page, I hope it's working now.
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: A script to import TVPaint's CSV file format

Post by ulrik »

Thanks for the script, it's working here with TVP 10 and Moho 12 on OS X :D
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Re: A script to import TVPaint's CSV file format

Post by Fazek »

ulrik, please download and try the new version I just uploaded. The problem is the new directory structure of the CSV 1.1 format (I think TVPaint implemented this recently in version 11). cartoonmonkey, please, if you want to help me with testing, please try the new version with your files, and also move (ie. copy the files and delete the originals) your test.csv file and your test.layers folder to a different location on your harddisk, then try to load them from there.

Thanks
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: A script to import TVPaint's CSV file format

Post by ulrik »

Fazek, the latest version works just fine here, even if I move the csv file and the layers to another location. TVP Pro v.10, Moho 12, OS X 10.11.6
Thanks once again for this script!
Regards Ulrik
User avatar
cartoonmonkey
Posts: 90
Joined: Thu Feb 12, 2009 2:06 pm
Location: Portland, Oregon
Contact:

Re: A script to import TVPaint's CSV file format

Post by cartoonmonkey »

Working well with TVP 11 Pro!
Cheers!
C
User avatar
cartoonmonkey
Posts: 90
Joined: Thu Feb 12, 2009 2:06 pm
Location: Portland, Oregon
Contact:

Re: A script to import TVPaint's CSV file format

Post by cartoonmonkey »

Now if only Moho would export CSV as well...
:-D
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Re: A script to import TVPaint's CSV file format

Post by Fazek »

cartoonmonkey wrote:Now if only Moho would export CSV as well...
:-D
Actually it's not a completely impossible wish. But only if Moho is able to render the current frame from lua. I'll check the possibilities, it's a good idea.
- - - Fazek
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: A script to import TVPaint's CSV file format

Post by synthsin75 »

Fazek wrote:
cartoonmonkey wrote:Now if only Moho would export CSV as well...
:-D
Actually it's not a completely impossible wish. But only if Moho is able to render the current frame from lua. I'll check the possibilities, it's a good idea.
moho:FileRender(path) renders the current frame to the image format given in the path file name extension.
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Re: A script to import TVPaint's CSV file format

Post by Fazek »

A new experimental export plugin is avaliable now. I've also fixed the import plugin: importing layers with empty first frames was buggy.

About the export plugin: It exports the top level layers as separate layers. If a top level layer is a group, the plugin renders its contents together. But it expands top level group layers if the group has no masking and it contains switch layers only. Basically this is the "inverse" of the import plugin. If a layer is a still picture (vector or image), it tries to render only the changes. If the layer or the camera has ANY animated keys, it renders all frames of the layer separately.

The the render window shows up for each exported image with an annoying beep sound (at least for me). So it's flashing and beeping like crazy during exporting. Sorry for that, I don't know yet how to avoid it.
- - - Fazek
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: A script to import TVPaint's CSV file format

Post by synthsin75 »

Fazek wrote:The the render window shows up for each exported image with an annoying beep sound (at least for me). So it's flashing and beeping like crazy during exporting. Sorry for that, I don't know yet how to avoid it.
I don't think there's a way to avoid that. The user can disable audio feedback in the preferences if the beeping is really annoying.
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: A script to import TVPaint's CSV file format

Post by ulrik »

When exporting csv from Moho on OS X, is there a way to stop the rendering?
I ask because I started a csv export from a big project and while rendering I noticed that I had forgotten to fix a layer and wanted it to stop,
I tried with esc and command+. but I had to use force quit

Regards Ulrik
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Re: A script to import TVPaint's CSV file format

Post by Fazek »

Hello Ulrik,

To do such things like capturing keystrokes, processing dialog messages etc. the script should return the control back to the main program and gain it again during the rendering. This is a simple menu script with a linear workflow. The user control you want is perhaps possible, but these things are making the code very complicated. Perhaps instead of tricks, there supposed to be an official way to abort runaway lua scripts nicely, without quitting the program.
- - - Fazek
User avatar
ulrik
Posts: 1087
Joined: Thu Aug 11, 2005 10:32 pm
Location: Stockholm Sweden
Contact:

Re: A script to import TVPaint's CSV file format

Post by ulrik »

Ok, I understand, thanks!

Regards Ulrik
User avatar
synthsin75
Posts: 9934
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: A script to import TVPaint's CSV file format

Post by synthsin75 »

I noticed in the code that you were looking to get the Moho version:
const char *AppVersion()

Yeah, I can't think of anyway to allow the user to interrupt the rendering without also making them babysit the rendering by periodically telling the script it's okay to continue.
User avatar
Fazek
Posts: 246
Joined: Thu Apr 13, 2006 1:37 pm
Location: Hungary
Contact:

Re: A script to import TVPaint's CSV file format

Post by Fazek »

Hello synthsin75,
Yes, I noticed it too and probably I will change the current (.moho vs. .anme) solution to that.

About the abort functionality: perhaps if i exit the script after each rendered frame and force the system somehow to call it back again for the next frame... but it seems difficult.
- - - Fazek
Post Reply