opentoonz / opentoonz_docs

OpenToonz User Manual
http://opentoonz.readthedocs.io
28 stars 26 forks source link

ToonBoom Harmony TVG Import #146

Open kallisti5 opened 4 years ago

kallisti5 commented 4 years ago

It would be nice if OpenToonz supported importing ToonBoom Harmony vector elements. (.TVG file)

Describe the solution you'd like OpenToonz is a lot more Linux friendly, it would be nice if OpenToonz could import ToonBoom Harmony vector elements. This would enable graphics created in other projects to be imported and reconnected in OpenToonz

RodneyBaker commented 4 years ago

Hi @kallisti5 By workspaces it seems you are specifically looking for the layouts? More detail in what would be converted/imported will be appreciated. I do see that the workspaces appear to be in xml format.

kallisti5 commented 4 years ago

Hm, Reducing the scope of this one might make it more achievable than the entire workspace. How about importing just the vector elements? (tvg)

This would allow importing vector artwork from Harmony into OpenToonz to be reconstructed within OpenToonz. Harmony doesn't let you export individual vector elements in an open format (like svg), which is kind of problematic getting your data out of Harmony.

I see a certificate packed at the top of the vector element as well which is a bit concerning...

vector

RodneyBaker commented 4 years ago

That 'certificate' could very well just be a base64 (preview) image. Perhaps one even generated by a system call to Certutil.exe (or equivalent).

Also of interest, Toon Boom has a set of command line utilities that might be useful for conversion to and from raster and vector formats.

RodneyBaker commented 4 years ago

This request is in need of Research and Development. Interested parties are encouraged to investigate and provide feedback.

Initial assessment: This feature is non-trivial and will take considerable effort to implement.

R&D Recommendation:

RodneyBaker commented 2 years ago

@kallisti5 Do you know of any programs outside of Toon Boom's products that can open .TVG files?

ScionOfDesign commented 2 years ago

I am interested in having a parser for ToonBoom's .tvg format written eventually, for any sort of 3rd-party integration. There is a way to convert .tvg to XML for 'debugging' purposes, but importing the XML format would require deciphering what exactly the XML means and matching it to similar functionality on OpenToonz or whatever program you'd like to be able to import .tvz.

kallisti5 commented 2 years ago

Since I opened this, https://github.sre.pub/cpsdqs/tvg now exists. Looks like @cpsdqs was able to write some reverse engineered code in rust to handle the tvg format.

cpsdqs commented 2 years ago

Hi, I will note that while I did reverse engineer some of the format, I'd consider that code extremely incomplete. I didn't make much progress in deciphering several very strange quirks and have given up for now*... It can decode simple TVG files, read the color palette, and obtain Bézier paths for some fills, at least.

The tvg2xml output is easier to deal with than the binary format: the odd coordinates like ArB are simply a fixed point value you can read as A + B / 1024. The issue with tvg2xml is that it requires a toon boom harmony license.

And about the certificates: while all(?) TVG files created by toon boom harmony will have one, I believe it can read files that don't have a certificate just fine. If I remember correctly, it's linked to the license and the same in every file.

(*alright, ya got me. i had another look and figured out a bit more)

RodneyBaker commented 1 year ago

Transferring this requst into Opentoonz docs repo for development consideration.