getavalon / core

The safe post-production pipeline - https://getavalon.github.io/2.0
MIT License
218 stars 49 forks source link

TVPaint integration #526

Open kguyaux opened 4 years ago

kguyaux commented 4 years ago

I have worked on the TVPaint-integration. So far I have the workfiles-tool working. It took me a while to find an approach that was stable and not too difficult :-). The working is based on a python-wrapper around the tvpaint-app that uses the socketserver-module(py). With tvp-plugins that are made with the TVPaint-SDK, it is possible to talk to the pythonwrapper.

The wrapper starts tvpaint in a subprocess and keeps listening for commands(like "open the workfile gui"), until the shutdown command is given from tvpaint when it closes.. The whole module(called "python-tvpaint") that contains the wrapper/launcher, also has functions to talk back to tvpaint. (but for now, only when the given plugin is listening..) It is possible to keep tvpaint accepting commands in a separate thread, but this can crash tvpaint very easily. I have to explore this some more..

Demo of using the workfiles-tool from within TVPaint: avalon_tvpaint_workfiles_demo2

Now proceeding with Load & Creation-functionality, to be continued...

tokejepsen commented 4 years ago

Exciting stuff!

Took me a couple of views to notice the Avalon panel from where you launched the workfiles app.

So to clarify the communication workflow:

What does a command look like?

This interprocess communication sounds a lot like how pyblish-qml works.

kguyaux commented 4 years ago

Hi Toke,

all communication goes via sockets. I started using this method because I wanted the communication to go both ways. Also TVPaint can now receive errormessages from python side.. if necessary.

A command, for now, is just a simple string that gets compared by the pythonside or tvpaint-side, like "OPEN workfiles", or "OPEN creator".. .. after that, for example: Avalons workio-module, can then use the a TVP-wrapper-method like 'execTVPcommand' as follows:

import pytvpaint.functions as tvp tvp.execTVPcommand("tv_saveProject /path/to/savinglocation/test.tvpp")

mkolar commented 4 years ago

@kguyaux have you gotten anywhere further with the TV Paint integration? We'll be interested in implementing TV in avalon very soon probably, though we could put our heads together and pool resources to push it a bit.

kguyaux commented 4 years ago

Hi @mkolar, I did not have enough time to work on it, unfortunately ..and the current crisis is not helping either :-) I have put this on my list and will contact you as soon as when I have put my head back into it..

kguyaux commented 4 years ago

I did not have time to work on the tvpaint-integration, But I did manage to upload the tvpaint-part to github: https://github.com/kguyaux/tvpaint-avalon I'll now work on publishing the avalon-core part.. ..to be continued

kguyaux commented 4 years ago

..and I forked avalon-core, and added the tvpaint-branch https://github.com/kguyaux/core/tree/tvpaint

mkolar commented 4 years ago

@kguyaux great news. We'll have a look at the code with pype.club team to see if we could help somehow.