SDK PLugin development - painting tool

A forum dedicated to George scripting questions
Post Reply
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

But very promising by the way!
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

-open tvpaint 1 layer 1 instance
- draw a form
- LazyBrush fot TVP >Create Layers
- Select top level
- Add Scribble
- draw inside form
-> TVP Crash
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

thank you, it will be easy to fix.

I chose to use three layers, because if the scribbles will be drawn on the outline layer it will overwrite it, and to prevent it I will need to take specific measures. Also, I do not keep track of all the scribbles in memory,
what I do is to read the scribbles layer in the current frame and create a map of the pixels that belongs to each scribble. It is way simpler this way and I must have the scribbles on a separate layer. I also think it is easier to manage.
Also, you can of course use as many colors as you want. You can also use the bg scribble button to create a transparent color. It is not yet ideal, because you choose a specific color to sacrifice as transparent bg, and of you paint a scribble of that color it will end up transparent. But since I do not keep the scribbles in memory, it is the best solution I found so far.
Try painting more complex drawings, with some shading and more rough lines. I think you will see the potential of it.

Please continue to suggest ideas,
Thanks
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

oferk wrote:thank you, it will be easy to fix.
I think you will see the potential of it.
Yes it got big potetial. I Think the plugin would need A more user friendly interface,(Only 2 layers, You Scribble on the outline layer,Dont need a color to define transparency) if others besides yourself should start to use it. This is my first reaction.
Maybe the TVpaint Team could help out with this?
Keep up the good work
:-) mads

ps.
It could also be nice if the Plugin only needed 1 layer. so it filled behind on the outline layer. Then maybe I would start to use it in my workflow. because I color on the same layer as the outline, so I only need one layer.
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Ok, I will try to figure out a better implementation for the interface. I have little time because Im working on my graduation film, but since I plan to use the plugin, I will do my best. It won't be simple.
Hey, mads, I like your blog. Are you using tvpaint for storyboarding and animatics?

Thanks.
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

Thank you :-)
Yes i'm doing all my storyboard and animatics in TVpaint.
Some of it is edited afterwards in a NLE. for instance the LEGO commercials. But I delivered timed Quicktimes to the Editor.
User avatar
ematecki
Site Admin
Posts: 2258
Joined: 15 Feb 2006, 14:32

Re: SDK PLugin development - painting tool

Post by ematecki »

madsjuul wrote:Some of it is edited afterwards in a NLE. for instance the LEGO commercials. But I delivered timed Quicktimes to the Editor.
Hi Mads,
I *LOVE* Lego !!!
I have a 9m2 Lego city in my attic :)
Quicktime is DEAD. Get over it and move on !
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: SDK PLugin development - painting tool

Post by Fabrice »

I'm going to test the plug-in soon. :)
Thanks for sharing Oferk.
Fabrice Debarge
User avatar
Mike
Posts: 1050
Joined: 16 Feb 2006, 08:58

Re: SDK PLugin development - painting tool

Post by Mike »

oferk wrote:yes! it works better! Great, thanks a lot. But it is not yet perfect. what happens now is the when I draw the first scribble I can undo it (because the plugin hasn't done anything). But after the second one the plugin does all his stuff, and then undoing causes weird things happen. I guess it is all because Im changing the current layer, and maybe writing to iFilter->Current in the end and this is wrong. I will continue to work on it.

What I would like to happen is that after the plugin paints and the user undos, only the last drawn scribble will be deleted, and the plugin will re-paint the image, but undoing the paint process doesn't make much sense.
I guess Im not clear enough but I need to think about this some more.

Here is a windows 32-bit binary:
https://www.dropbox.com/s/8hefp2hlrfpi7 ... ushTVP.dll" onclick="window.open(this.href);return false;
Thanks a lot!
Well, I think I found something about the undo problem.

_ in your function CLazyUtils::colorLayer()
_ AFTER TVWriteLayerData()
_ add TVSendCmd(iFilter, "tv_updateundo", NULL);

_ in your function executeLazyBrush()
_ BEFORE lazyUtils.readOutlinesLayer(iFilter);
_ add TVSendCmd(iFilter, "tv_updateundo", NULL);

_ in the function PI_Msg()
_ AFTER executeLazyBrush(iFilter);
_ I think you can uncomment return 0; to avoid to call again TVWriteLayerData() on the up of the button


I didn't use the second button which set "bgScribbleActive" to true, but if you want to use it, maybe there will be something to do with TVSendCmd(iFilter, "tv_updateundo", NULL); or maybe not, and if there are still problems, maybe try to avoid using iFilter->Current, as the brush.


And about to remove the last scribbles but keeping the paint process, I think it's not possible to do it with the undo, you must certainly do/manage it on your own.
TVPaint Team
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Great, it works now. You need to hit undo several times to skip the layer changes, but it undos the coloring of the layer and then the scribble drawing. Ill try to tweak it a little, and see if I can make it skip the layer changes.

Another question: If I want to change the interface so everything works on the same layer, that means I need to store everything in memory all the time, that is, the outlines, and the sctibbles arrays. Thats OK if there is only one frame, but what if we are painting a sequence? It will take much more memory. And more important, if the user adds, removes, moves a frame or exposures, my whole data will be invalidated. So, is there any frame ID i can get that "travels" along with it, so I can base my indexing on that instead of frame number?
To avoid the memory overhead, Ill need to think of a way to deduce the data from the painted frame, which I don't think is possible, so I might have to force the user to paint the frame at one take, and if he wants to change later, he'll have to start over.
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

Some more thoughts on the user interface.
Instead of 1 tool (add scribble) what about this workflow.
You have a layer with several drawing instances. First you indicate a "global outside the shape" point. So you press a place on the screen that is outside the animation on all the drawing. If no point is indicated the plugin will assume it is point 0,0.
then you would choose your fill tool and fill in side . IF we for instance have a doughnut we would als0 need a tool to indicate the hole. So I think I plugin like this would need 3 tool

- Global Outside Animation (you can set a new fill point at anytime, and if it is not it take the one from last time you used the plugin and if never used it assumes the point is 0,0)
- Fill tool
- Erase Tool

that means if I open the plugin and press fill tool and make my scribble some where inside the shape, the plugin would make a slection from point 0,0(or where the glabal outside animation is set to) and invert the selection so the fill will not go outside the drawing and iiside the global transparency area. And it could do this every time you make a "Fill tool Scribble"

-Mads
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

Would it be good to have 2 different fill tools in the plugin ? (when I talk about fill tolls a talk about you "Add scribble" button, It needs a new name I dont connect "Add Scribble" With making a fill , which is the purpose of the button)

- One that fills the shapes you have scibbled inside and is also not fillin in the global transparency thing
- one that is that fills the shapes you have scribble but one where theres is fill before- like the alpha was locked.
? Mads
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

About the first suggestion, It seems possible. I will implement and test a system like that, or close to it. Don't you think a single bg/transparent fill tool is enough?
About the second post, Im not sure I understand you.
What do you think of the problem I mentioned about painting sequences? When you add/remove frames, if the plugin "meta-data" is lost, you won't be able to recover your outline layer.

Its a technical detail, but the plugin doesn't rely on just points, but on scribbles, which have a size and shape. This size and shape is important, because it affects the scribble's influence. This is why a default little scribble in the corner can work, but only in some cases. Maybe most cases, I actually don't know, this is why I need to test it.
You also have no way to limit a color to a specific shape but adding more scribbles in other shapes, or one big bg scribble that crosses all other shapes. This is the way this algorithm works.

So if I understand and remember everything, this is the interface you suggest:

- everything works on the same layer. (When you start painting a frame, you need to finish painting it, before moving on to the next frame - this is my addition, at least for now)
- There is a global bg scribble that has a default value and can be set freely.
- An eraser tool, that will add a transparent scribble

right?
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18

Re: SDK PLugin development - painting tool

Post by Mads Juul »

oferk wrote: - everything works on the same layer. (When you start painting a frame, you need to finish painting it, before moving on to the next frame - this is my addition, at least for now)
- There is a global bg scribble that has a default value and can be set freely.
- An eraser tool, that will add a transparent scribble

right?
Yes. But I think most people would like a two layer solution. Where you have the outline on one layer and is doing the fill on a layer below. I was only mention the one layer solution because thats what I do when i storyboard. I fill the drawing wth white so the bg doesnt show throught, But if i was too do coloring for animation I would use 2 layers, one for outline , one for coloring, so I think it would be best if you made you plugin work with two layers. I wonder which is the most natural layer to be on when you do you "fill scribble"? the outline or the color layer? Because the other tools in TVP fworks on the selected layer . I would recomment the fill scribble and the fill is made on the current layer so it must be the color layer. So the fill is calculated on the layer above. In a future version maybe the user could choose the source of the fill scribble "layer,above,under,display" just like you can with the flood fill tool.
User avatar
Fabrice
Posts: 10077
Joined: 17 Jul 2007, 15:00
Contact:

Re: SDK PLugin development - painting tool

Post by Fabrice »

Yes. But I think most people would like a two layer solution
I tested the plug-in and I agree with you.

Oferk, maybe can you do something with the "spare page" to remove one of the required layers ?
Just an idea, I have no idea about the way to have done the current code.
Fabrice Debarge
Post Reply