A script to import TVPaint's CSV file format
Moderators: Víctor Paredes, Belgarath, slowtiger
A script to import TVPaint's CSV file format
I've just made this menu item script. CSV is an export format of TVPaint. I already made similar import scrips for Blender and TVPaint itself. You can find these on the same forum too. Also you can use the CSV format in newer versions of Krita.
You can find the script here:
(27.08.2016: a new experimental export plugin is also available here)
http://forum.tvpaint.com/viewtopic.php?f=26&t=10050
To select CSV format export in TVPaint, click on the Clip: layers structure tab in your Export footage window. TVPaint creates a simple text file with .csv extension for the exposure sheet - actually it is a spreadsheet format, so you can load it to Excel for example - and also creates .png files for the drawings into a folder.
In Moho, if you installed the script into a directory in your scripts/menu, you can use the new "Import CSV animation..." menu item to import this format. It creates Switch Layers with the images and puts everything inside a base Group layer. It loads the blending mode of the layers as well.
IMPORTANT! There are differences in character set encodings between parts of the lua system so use only ASCII-7 (English alphabet) for the filenames. If you cannot open or save a file, first ensure that its path is not containing any special (accented) characters.
If you have older versions of Anime Studio, I'm curious how it's working in them.
You can find the script here:
(27.08.2016: a new experimental export plugin is also available here)
http://forum.tvpaint.com/viewtopic.php?f=26&t=10050
To select CSV format export in TVPaint, click on the Clip: layers structure tab in your Export footage window. TVPaint creates a simple text file with .csv extension for the exposure sheet - actually it is a spreadsheet format, so you can load it to Excel for example - and also creates .png files for the drawings into a folder.
In Moho, if you installed the script into a directory in your scripts/menu, you can use the new "Import CSV animation..." menu item to import this format. It creates Switch Layers with the images and puts everything inside a base Group layer. It loads the blending mode of the layers as well.
IMPORTANT! There are differences in character set encodings between parts of the lua system so use only ASCII-7 (English alphabet) for the filenames. If you cannot open or save a file, first ensure that its path is not containing any special (accented) characters.
If you have older versions of Anime Studio, I'm curious how it's working in them.
Last edited by Fazek on Thu Sep 01, 2016 12:53 pm, edited 2 times in total.
- - - Fazek
- hayasidist
- Posts: 3840
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: A script to import TVPaint's CSV file format
(win 7/64bit) I'm getting an error trying to open the file after download - The compressed (zipped) folder ... is invalid.
Re: A script to import TVPaint's CSV file format
You're right, the forum motor somehow modified the zip file. The zipping needed because the forum not accepted the .lua extension in the file name. I uploaded again, I hope it's good now.
- - - Fazek
- hayasidist
- Posts: 3840
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: A script to import TVPaint's CSV file format
yes - all good - downloaded ok. Thanks. (I'm interested in the import concept in general rather than TVP in particular)
Re: A script to import TVPaint's CSV file format
Welcome Back! And thanks for your scripts, that's very generous of you!
"and then Man created god!"
Re: A script to import TVPaint's CSV file format
One important thing: on my machine with Windows 10, LUA can't open the files if their path contains characters outside of ASCII-7. So if you cannot open a file with this plugin, check the characters in the path name (ASCII-7 characters: basically the lower/upper case English alphabet + numbers + some special characters, like: space, dot, underscore, minus...). For me it's a problem because Hungarian alphabet has some accented characters too.
- - - Fazek
Re: A script to import TVPaint's CSV file format
Wow! Thank you very much!
Re: A script to import TVPaint's CSV file format
I just uploaded a new version of this script into the original place. This new version can optionally set the document parameters, like field size, framerate and play duration from the CSV file. However, it still cannot open the files if there are international characters in the path name.
- - - Fazek
- cartoonmonkey
- Posts: 91
- Joined: Thu Feb 12, 2009 2:06 pm
- Location: Portland, Oregon
- Contact:
Re: A script to import TVPaint's CSV file format
Is this script useful mainly for importing a multi-layered character into Moho? Or a whole film?
Re: A script to import TVPaint's CSV file format
TVPaint is a pixel based program. it has layers like Photoshop, but each layer works on a timeline. The keys on the timeline are standalone, full-frame pictures. You cannot make motion tweens, rigged characters etc. with them. You must draw each motion steps manually. This program is best for traditional, cel-style animation, pencil drawings, paintings etc. There is a free alternative to TVPaint, named Krita, with a very similar working style.
So, you can import a complete scene into Moho with this plugin. You can import, for example a sketch animation or layout. But you can also use it to import a finished scene, to add some compositing effects, additional characters, motion blur, 3d camera movement...
So, you can import a complete scene into Moho with this plugin. You can import, for example a sketch animation or layout. But you can also use it to import a finished scene, to add some compositing effects, additional characters, motion blur, 3d camera movement...
- - - Fazek
- cartoonmonkey
- Posts: 91
- Joined: Thu Feb 12, 2009 2:06 pm
- Location: Portland, Oregon
- Contact:
Re: A script to import TVPaint's CSV file format
Hey Fazek,
I can't get this to work with the latest version of TVPaint 11 Pro, and MOHO.
Here's my error.
I even tried to put the path to the csv file in a directory on c:/a - and made sure I had no _ in any layers etc in TVPaint.. still to no avail...
Windows 10 X64, Moho x64, TVPaint 11 Pro X64

I can't get this to work with the latest version of TVPaint 11 Pro, and MOHO.
Here's my error.
I even tried to put the path to the csv file in a directory on c:/a - and made sure I had no _ in any layers etc in TVPaint.. still to no avail...
Windows 10 X64, Moho x64, TVPaint 11 Pro X64

Re: A script to import TVPaint's CSV file format
Thank you! I think this means there are more #something rows in your .csv file before the first #00000 numeric row. I will check it and make a workaround soon.
I assumed the files are starting like this example:
I assumed the files are starting like this example:
Code: Select all
UTF-8, TVPaint, "CSV 1.0"
Project Name, Width, Height, Frame Count, Layer Count, Frame Rate, Pixel Aspect Ratio, Field Mode
"Example", 640, 480, 4, 2, 24.000000, 1.000000, Progressive
#Layers, "B", "A"
#Density, 1.000000, 1.000000
#Blending, "Color", "Color"
#Visible, 1, 1
#00000, "", "frame001-00000.png"
#00001, "frame000-00001.png", "frame001-00000.png"
- - - Fazek
- cartoonmonkey
- Posts: 91
- Joined: Thu Feb 12, 2009 2:06 pm
- Location: Portland, Oregon
- Contact:
Re: A script to import TVPaint's CSV file format
Well, here's my csv file:
I just named all my layers a, b, c, d, e etc.
UTF-8, TVPaint, "CSV 1.1"
Project Name, Width, Height, Frame Count, Layer Count, Frame Rate, Pixel Aspect Ratio, Field Mode
"aaa", 1280, 720, 1, 10, 24.000000, 1.000000, Progressive
#Layers,"a","b","c","d","e","f","g","h","i","j"
#Folder,"C:\a\test.layers\[001] a","C:\a\test.layers\[002] b","C:\a\test.layers\[003] c","C:\a\test.layers\[004] d","C:\a\test.layers\[005] e","C:\a\test.layers\[006] f","C:\a\test.layers\[007] g","C:\a\test.layers\[008] h","C:\a\test.layers\[009] i","C:\a\test.layers\[010] j"
#Density,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000
#Blending,"Color", "Color", "Color", "Color", "Color", "Color", "Color", "Color", "Color", "Color"
#Visible,1, 1, 1, 1, 1, 1, 1, 1, 1, 1
#00000, "[001][00000] a.png", "[002][00000] b.png", "[003][00000] c.png", "[004][00000] d.png", "[005][00000] e.png", "[006][00000] f.png", "[007][00000] g.png", "[008][00000] h.png", "[009][00000] i.png", "[010][00000] j.png"
I just named all my layers a, b, c, d, e etc.
UTF-8, TVPaint, "CSV 1.1"
Project Name, Width, Height, Frame Count, Layer Count, Frame Rate, Pixel Aspect Ratio, Field Mode
"aaa", 1280, 720, 1, 10, 24.000000, 1.000000, Progressive
#Layers,"a","b","c","d","e","f","g","h","i","j"
#Folder,"C:\a\test.layers\[001] a","C:\a\test.layers\[002] b","C:\a\test.layers\[003] c","C:\a\test.layers\[004] d","C:\a\test.layers\[005] e","C:\a\test.layers\[006] f","C:\a\test.layers\[007] g","C:\a\test.layers\[008] h","C:\a\test.layers\[009] i","C:\a\test.layers\[010] j"
#Density,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000,1.000000
#Blending,"Color", "Color", "Color", "Color", "Color", "Color", "Color", "Color", "Color", "Color"
#Visible,1, 1, 1, 1, 1, 1, 1, 1, 1, 1
#00000, "[001][00000] a.png", "[002][00000] b.png", "[003][00000] c.png", "[004][00000] d.png", "[005][00000] e.png", "[006][00000] f.png", "[007][00000] g.png", "[008][00000] h.png", "[009][00000] i.png", "[010][00000] j.png"
Re: A script to import TVPaint's CSV file format
The #Folder row is a new thing, I'll add support then.
Thanks
Thanks
- - - Fazek
- cartoonmonkey
- Posts: 91
- Joined: Thu Feb 12, 2009 2:06 pm
- Location: Portland, Oregon
- Contact:
Re: A script to import TVPaint's CSV file format
Cheers Fazek,
Can't wait to try it!
Can't wait to try it!