SDK PLugin development - painting tool

A forum dedicated to George scripting questions
Post Reply
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Hi,
This spare buffer looks interesting, I didn't know about it. I will look for it in the manuals. I also see there is the push and pull image buttons and commands. They are undocumented, but I get their function. They can be of use also.

Thanks.

Edit: I see the spare image in only for a single image, and also the push/pop image, so while it can help for a single image (as long as the user doesn't mess around with it), it won't solve the image reordering problem.
What is the difference between using the spare image, and using the push/pop image functions?
Svengali
Posts: 1557
Joined: 28 Dec 2006, 10:08

Re: SDK PLugin development - painting tool

Post by Svengali »

oferk wrote:Hi,
This spare buffer looks interesting, I didn't know about it. I will look for it in the manuals. I also see there is the push and pull image buttons and commands. They are undocumented, but I get their function. They can be of use also.

Thanks.

Edit: I see the spare image in only for a single image, and also the push/pop image, so while it can help for a single image (as long as the user doesn't mess around with it), it won't solve the image reordering problem.
What is the difference between using the spare image, and using the push/pop image functions?
ImagePush and ImagePop storage is really a LIFO stack of multiple images so it could easily be used to reorder a sequence.

The spare image uses a number of George commands which let you save to, reload from, and swap current image with the spare. You can also load an image file directly to the spare image which has some good possibilities in sequential animation which uses various merge tools (like fill).

Not sure but I think alpha masking can be stored to spare and retrieved intact. Still need to experiment with that to find out the rules.

Sven
TVP Pro 11.0.10-64bit Win10 - 64GB ram -2TB HHD - 256GB SSD - Wacom Cintiq 16, driver 6.3.41-1
Android Tablet: rel. 11, Samsung Galaxy Note10.1 - 32GB with microSD 32GB
Android Tablet: rel. 11.5, Samsung Galaxy Tab S7plus - 128GB with microSD 64GB
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

OK, thanks.
I did two quick tests, and the results are nice. First I tried to push the scribbles image after a stroke is done, and before painting the layer, and popping it back when a new stroke begins. This way I only need two layers, and it is a quick solution. You can also manually pop the scribbles layer is you want to see it, and maybe erase a scribble or something. It works well, it is a cleaner interface, but the issue with that is when you move on to paint another frame, I need to detect it and not use the pushed image (I guess that is a good reason I better use the spare image, so unused images won't stack up in memory).

The second thing I found that is nice, is when I tried to use the resulting colored layer as the scribbles layer, and add a new scribble to that. You would think it wont work, because the colored areas can be so big that no scribble can overcome them. But no, while this is almost the case, I found that if you paint a scribble that covers almost the entire are of shape, even a small one, it will work. Indeed, its more work then just marking an area with a small scribble, but you still have the advantage that you really don't need to be exact, and the plug-in will still do its work to detect the edges correctly. I mean, it still saves time.

So for now, I think these two methods can actually be combined. When you start working on a frame, you have the advantage of restoring the original scribbles. If you move on the another frame and then go back, you can still add and remove, by just using bigger scribbles. I still need to test it more, but it actually might work well.
Another idea: I can try to use the built-in paint-bucket/erase tool to remove big patches of color. It might work. And I also think I will save in memory only the bg scribbles, so I can identify them uniquely without using a specific color.
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Hi everyone,
I made some progress with the plugin, even though I have very little time to work on it. It now works only with two layers, and it pushes the scribbles to the spare image. There is also a separate bg scribble, which you still cannot see, but you can paint in bg scribbles and clear it if you want.
I solved a few bugs and it should be more stable now. I will probably be working with it soon, so I will find more bugs and fix them.
Let me know what you think!

https://www.dropbox.com/s/8hefp2hlrfpi7 ... ushTVP.dll

PS. How can I tell what is the current image? I want to be able to automatically clear the spare image when changing frames while painting a sequence.

Thanks
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

https://www.dropbox.com/s/8hefp2hlrfpi7 ... ushTVP.dll

Another update. I implemented a way to see the bg scribbles. It will display as ugly checkboard strokes. When you clear the bg scribble buffer, the plugin also clears the patterned strokes from the display. It expects the scribble image to be in the spare image, so it swaps it in, clears the bg strokes and swaps it out.

BTW. If you want to see the scribbles, and maybe erase one of them, you can press j, do what you want, and press j again, before adding another scribble.

There is currently at least one open bug, the details are not very interesting:
Bottom line, because of some workarounds I did, you better start and finish painting a frame without switching projects, changing resolutions and such. Also, when moving on to the next frame, make sure you clear the spare image to start with a clean set of scribbles

When switching projects, or changing the resolution of a project, I need to reinitialize the buffer of the bg scribbles, I do that by catching the PICBREQ_PROJECT_CHANGE message, and checking if the resolution changed. If it did, I re-initialize the bg buffer, and reset the spare image.
The bug is when you switch to a project of the same resolution (after you started painting an image in the first project), and then clear or change the bg scribbles in the new project, when you will switch back to the first project, it won't know that the checkboard pattern is actually a bg scribble, and everything will collapse! I need to check if the project name has changed, and not only the resolution.

goodluck :)
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Re: SDK PLugin development - painting tool

Post by Mads Juul »

I just tried it out. My tvpaint chrashed 2 times in a row. It deleted my active and stamped in the Spare . And then says something like. "Cannot change the layer" It seems a little to buggy for me to test on right now. Maybe I have more time later. Maybe next week.
-MAds
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Ok, I'm sorry. I guess I'm still using it in the same way all the time, and because of that I don't find all those crashes. If it cannot change the layer its because you selected the topmost layer, but it is not supposed to crash.
Can you tell me what exactly you did, so I can track it quicker?

Thanks for testing!

EDIT: I see the problem when you start laying strokes on the outline layer, and it pushes it to the spare and then copies something over it, and you loose your image... Ill think of a way to fix it.
but, I still can't get it to crash.
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Hi,
First, a question:
When clicking the "add scribble" button, I install a function to get messages. Problem is I don't know when to call TVCloseFunction, and then when you click the "stroke" button (D), or some brush preset, it ignores you and my message stays installed. To get rid of it you need to click on another tool, like line tool or transfrom. I can call TVCloseFunction after every scribble stroke, but its not ideal. Can I get a message when the user clicks on a regular button so I can call TVCloseFunction?

Update:
Just so I can stop sharing links to files and writing random usage instructions, I created a dropbox folder with all the files and documentation. Its still not done, but its getting there. I will later replace the folder with a blog page or something like that:
https://www.dropbox.com/sh/zliyb5df36uojy8/xfezEE-fEC" onclick="window.open(this.href);return false;

Second, I shared the plugin with a few friends and they will try to use it and test it for me. I will fix the bugs and update the file in the folder.

Also, from my tests I can say that while the results are good, the interface is not. Its quite messy, and having to explain people around me what is the spare image, is a nightmare. It also very prone to "human errors" and its enough to paint a scribble on the wrong layer to make things complicated to fix. I still not sure how much can I do to fix these issues. Im thinking of limiting the scribbles to layers with the word "scribble" or "color" in them. It will help avoid some mistakes.

I must say that in my opinion, if you are quickly painting a storyboard or masks for an animation, the current "real time" interface is good, but if you are painting an animated sequence of a complex character, the old method of 3 layers is better. Currently, the plugin calculates the result after every stroke, and as you add more and more colors and scribbles, it gets slower and slower. You actually waste a lot of time waiting for the intermediate result you don't really need. So I think with 3 layers I will make it calculate the result only when you click a button. With 3 layer you can also go back and change scribbles more easily.
The use of the spare image is causing many problems, but I will keep both methods for now, and try to improve them more.

Thanks a lot.
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Re: SDK PLugin development - painting tool

Post by Mads Juul »

My thought on the 3 layers vs. Real time.
I will recommend developing the plugin so it fits you own needs best. Not having to fit other people is maybe the most powerful thing about developing own plugin/scripts after my opinion.
So if you like the 3 layer approach better, then focus on this. For instance I probably wont use your Plugin anyways, because I have my own pipeline/script I use. I have been trying out the plugin out of curiosity, and Will probably try it out once in a while if you continue developing, but not with the intention of using it.
But thank you for sharing it is interesting to follow.
-Mads
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

OK, thanks. I guess you are right.
Anyway, I hope other people will try to use it, because it really can save a lot of time. I just painted a short animation in 10 minutes, after my friend did in more then an hour with regular tools.
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Re: SDK PLugin development - painting tool

Post by Mads Juul »

I think you approach to painting animation is good and fast, I'm just pointing out that I am testing your plugin But I am actually not painting animation, so You have to use my feedback in that light, I'm just saying the only person who's work flow you know 100 % is your own, so why not make sure it at least fit this work flow. And if other people can use this work flow or adapt to it and you choose to share your plugin. Then good for them. It takes a lot of time making software/scripts/plugin that is flexible .
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Yes, of course, I didn't see it any other way. Maybe I just miss-phrased myself, but I understood what you meant:)
User avatar
Mads Juul
Posts: 3992
Joined: 02 May 2007, 19:18
Location: Viborg,Denmark
Contact:

Re: SDK PLugin development - painting tool

Post by Mads Juul »

oferk wrote: Maybe I just miss-phrased myself
No no, I just like to repeat my self. That's my way of thinking :-) I'm thinking while I speak and or write.
Mads Juul
Storyboard Artist
blog: http://mjstoryboard.blogspot.dk/
Mail: mjstoryboard@gmail .com

Windows 10, 64 bit i7-4790 CPU 4.00 Hz,32 GB RAM, With TVP Animation 11 Pro (11.0.2-64bits)
2 Monitors 1920X1080 pixels + 1 Wacom Cintiq 21UX 2
oferk
Posts: 94
Joined: 23 Jul 2011, 21:27

Re: SDK PLugin development - painting tool

Post by oferk »

Hi everyone,
I changed the plugin's interface to the original 3-layer method. Its a bit simpler and less prone to errors. There is not scribble brush anymore, only a button that switches to a simple brush with no anti aliasing. Also, the painting is not interactive and you must click the "Paint" button to actually compute the coloring.
In addition, I also fixed a few bugs.

You can find the plugin and the instructions in the Dropbox folder I posted a while ago.

I found that when using thin, not fully opaque outlines, the color from the lazybrush layer causes aliasing, because I do not apply anti aliasing to the result. I searched a bit for solutions, and saw that I can use supersampling, but for that I need to solve the algorithm at a much higher res, and this is not practical.
Another option is the compute averaged alpha values. That blurres the edges, but in some places too much, and they become transparent inside the shape.
I found that implementing the FXAA technique from recent computer games is pretty simple and fast and might give good results.
But I wanted to know how does tvpaint performs anti-aliasing in its built-in tool? Maybe I can use the same technique?

Thanks.
User avatar
D.T. Nethery
Posts: 4147
Joined: 27 Sep 2006, 19:19

Re: SDK PLugin development - painting tool

Post by D.T. Nethery »

oferk wrote:Hi everyone,
I changed the plugin's interface to the original 3-layer method. Its a bit simpler and less prone to errors. There is not scribble brush anymore, only a button that switches to a simple brush with no anti aliasing. Also, the painting is not interactive and you must click the "Paint" button to actually compute the coloring.
In addition, I also fixed a few bugs.

You can find the plugin and the instructions in the Dropbox folder I posted a while ago.

I found that when using thin, not fully opaque outlines, the color from the lazybrush layer causes aliasing, because I do not apply anti aliasing to the result. I searched a bit for solutions, and saw that I can use supersampling, but for that I need to solve the algorithm at a much higher res, and this is not practical.
Another option is the compute averaged alpha values. That blurres the edges, but in some places too much, and they become transparent inside the shape.
I found that implementing the FXAA technique from recent computer games is pretty simple and fast and might give good results.
But I wanted to know how does tvpaint performs anti-aliasing in its built-in tool? Maybe I can use the same technique?

Thanks.


I have tried to install your LazyBrush plug-in , but it does not show up in the Plug Ins list .

I followed this order:

Copy the file LazyBrushTVP.dll to the Plugins folder in your TVPaint folder,
and start TVP (Restart it if it is already running). In TVP,
click on the menu "windows"->Plugins->LazyBrushForTVP, and a window with the tool buttons will open.


In windows > Plugins> there is no LazyBrushforTVP in the list of available plug ins.


TVPaint 10 running on Macbook Pro , OS 10.7
Post Reply