SDK PLugin development - painting tool

A forum dedicated to George scripting questions
Post Reply
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: SDK PLugin development - painting tool

Post by Fabrice »

oferk wrote:Well, it is not my website, and I'm not the author of the paper and algorithm. Im just an animation student who somehow found it, and since I'm also a programmer, I decided to try and implement it.
Now, I am in contact with the author, and he is very pleased that people find interest in this technique. He and his student are working on a commercial plugin for photoshop cs6, but as an animator I really don't think photoshop is the right place for it. I'm not sure what we will do with the plugin if we manage to get it working, but I think it will be open-source.
Oferk, I'm going to answer you by email, since we received yours.
Fabrice Debarge
User avatar
Paul Fierlinger
Posts: 8100
Joined: 03 May 2008, 12:05
Location: Pennsylvania USA
Contact:

Re: SDK PLugin development - painting tool

Post by Paul Fierlinger »

This is still good to hear. Tell him if he wants to discuss this with an animator who speaks his native language to get in touch with me. :mrgreen:
Paul
http://www.slocumfilm.com
Desktop PC Win10-Pro -64 bit OS; 32.0 GB RAM
Processor: i7-2600 CPU@3.40GHz
AMD FirePro V7900; Intuos4 Wacom tablet
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: SDK PLugin development - painting tool

Post by idragosani »

oferk wrote:Well, it is not my website, and I'm not the author of the paper and algorithm. Im just an animation student who somehow found it, and since I'm also a programmer, I decided to try and implement it.
Now, I am in contact with the author, and he is very pleased that people find interest in this technique. He and his student are working on a commercial plugin for photoshop cs6, but as an animator I really don't think photoshop is the right place for it. I'm not sure what we will do with the plugin if we manage to get it working, but I think it will be open-source.
I hope you make the plugin for all three platforms, too!
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
ematecki
Site Admin
Posts: 2259
Joined: 15 Feb 2006, 14:32

Re: SDK PLugin development - painting tool

Post by ematecki »

idragosani wrote:I hope you make the plugin for all three platforms, too!
You mean four, aren't you :)
Quicktime is DEAD. Get over it and move on !
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: SDK PLugin development - painting tool

Post by idragosani »

Yes, 4 now :-)
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: SDK PLugin development - painting tool

Post by Fabrice »

I just sent the SDK. ;)

nb : the best source of answers regarding the SDK and plug-ins is this place.
We are going to help as best as we can.
Fabrice Debarge
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Hi everyone,
At last I began working on the plugin. I don't think it will take too long, but there will be some problems with the interface, if I understand the SDK correctly. I cannot actually write a new tool, but only a non-interactive filter, Right? But these are troubles to be dealt with later. Right now I'm working on a simple implementation.

Problem NO. 1:
Im trying to read the bg layers, but the function fails, I can only read the current layer.
Of course I created both bg and fg layers.
What am I doing wrong?

Thanks!

Here is my code:

Code: Select all

Data.mParams.scribbles = (PIPixel*) malloc(iFilter->ImageWidth * iFilter->ImageHeight * sizeof(PIPixel));

res = TVReadLayerData(iFilter,
                          Data.mParams.scribbles,
                          0, 0,
                          iFilter->ImageWidth, iFilter->ImageHeight,
                          0, CB_READ_BACK);
    if (0 == res) {
        TVWarning(iFilter, "Cannot read scribbles layer");
        //return 0;
    }
User avatar
Hervé
Site Admin
Posts: 3490
Joined: 08 Feb 2006, 17:00
Location: Metz France
Contact:

Re: SDK PLugin development - painting tool

Post by Hervé »

Hi oferk,
The background and background are no longer available since the V9 ( with the new layer engine ), you can read only the current layer and the full display.
Hervé ADAM, TVPaint Team
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Oh, Ok... Thats quite a problem. And I can also only write to that layer?
Is there anyway around it?
User avatar
Mike
Posts: 1050
Joined: 16 Feb 2006, 08:58

Re: SDK PLugin development - painting tool

Post by Mike »

Hello oferk,

First, here is how you can use the sdk to make a tool.

You can use the PIDRAW_DRAW/PIDRAW_LINE/... messages to catch all the mouse positions.
Do your stuff (the current image you can modify is directly PIFilter.Current).
Once finish, just call TVWriteLayerData( PIFilter, src, x, y, w, h, mod ) with the src set to 0, so TVPaint can know something change in the image.
(Or do you stuff on your own image and call TVWriteLayerData() with your image.)

You can see an example of meta in the SDK in the file "TVPaint SDK\macosx\SDK Demo\metawindow.c"

//---

If you really need to have all the layer below the current one, you will do it by your own.
That mean you must do a loop on each layer, get the image, blend the image over the previous one.
Sometimes you have the TV*() functions available, and sometimes you must call a george command to get some information on layer.
(To call a george a command, you can see TVSendCmd())

And yes, the TVWriteLayerData() function can (and must) only write on the current layer.
TVPaint Team
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

OK, thanks.
Do I loop over the layers with george script commands? You mean I can change the current layer and read its data in a loop? I actually prefer to have each layer on its own, this will more or less make it doable. This loop can allow me to write the resulting colors to multiple layers, because most will probably want them on separate layers.

Thanks,
User avatar
Mike
Posts: 1050
Joined: 16 Feb 2006, 08:58

Re: SDK PLugin development - painting tool

Post by Mike »

You can use george commands to navigate/select layer and use the function TVReadLayerData() or even maybe TVReadProjectImage() to get the content.
And it should be possible to select a layer and write the result with the function TVWriteLayerData().

Just an important thing (but it doesn't apply to you if you want to use the plugin as a tool), you must never change the current layer during the processing of a frame sequence.
(With the function TVExecute(), PI_SequenceStart(), PI_SequenceFinish(), PI_Start(), PI_Work(), PI_Finish()).
TVPaint Team
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

OK, I found it in the documentation. I guess I need to iterate over the layers, and create an array of IDs so I can select a layer using it's position. The sequence issue will deny the option to paint a sequence with with a set of animated scribbles. That's too bad, but for now we will make do with something simpler.
Thanks, Ill begin working on it tonight.

PS. I haven't tried it yet, but there shouldn't be a major problem compiling the plugin from C++ code, right?
User avatar
idragosani
Posts: 987
Joined: 06 May 2008, 00:39
Location: Germantown MD
Contact:

Re: SDK PLugin development - painting tool

Post by idragosani »

Out of curiosity, are you developing this on Windows? I have tried to get the SDK to work under Linux but the API seems to be Windows-centric and would require a Linux specific one to work. I don't remember what version of the API I have, 9.5 maybe?
Brett W. McCoy -- http://www.brettwmccoy.com
TVP Pro 10 : Intel i7 2600 3.4 GHz : 8GB RAM : Ubuntu Studio 14.04 : Cintiq 21UX
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

No, Im working on OSX, and I started by taking the FLIP example plugin for osx, and adding to that, changing what I need. Compiling on OSX was simple once I found my way around this XCode behemoth :) I'm used to visual studio.
Post Reply