Click and Fill

A forum dedicated to George scripting questions
Post Reply
User avatar
cgmodeler
Posts: 120
Joined: 23 Oct 2012, 23:59
Location: Mexico
Contact:

Click and Fill

Post by cgmodeler »

Well took me a few hours but came up with this solution, it's an old thread but perhaps Mads or Svengali can take a look and improve it. I like the filled stroke with fill inside but a one click solution for me is better, also map the script to a key so it will be faster.

Basically I took the X,Y coordinates from a user click, then after switching the tool to the flood selection did a reapply so this way tvpaint reads the previous click as a tool click.

Do a flood select, invert it, then use the logic from mads Matte Layer to draw a rectangle with the canvas dimensions using the selection as the source and setting a behind color mode.

Also I found a bug not sure if its script related or tvp (Im using TVP11) where you need to run the magic wand at least once per session before using the script, if not the script wont set the magic wand and wont work.

Not too cute but would love to see if someone can made some improvements like CTRL CLICK to Flood all the frames.

This is a probable solution to this: viewtopic.php?p=50290&sid=e5555d4bf58e9 ... c10#p50290
POP_339_cocoaClickFill.gif
POP_339_cocoaClickFill.gif (256 KiB) Viewed 1919 times
POP_339_cocoaClickFill.mp4
(3.51 MiB) Downloaded 47 times
cocoaClickFill_EX.tvpx
(57.5 KiB) Downloaded 48 times
www.cocoalopez.com
Desktop: TVP Pro 11.0.8 - 64bit Win 10 x64 64GB RAM - RTX3070 - Cintiq 27QHD Driver 6.3.29
User avatar
Peter Wassink
Posts: 4467
Joined: 17 Feb 2006, 15:38
Location: Amsterdam
Contact:

Re: Click and Fill

Post by Peter Wassink »

But there is a much simpler method for what you do here,
and it does not require a script, it also uses less clicks because it can do an entire animation in one click.

-create a new layer under your anim.
-fill entire project surface (using either fill tool or filled rectangle.
-erase outside shape on the fill layer using painbucket+RMB with source set to either above or display. (expand 1-3, depending on the line thickness of the anim)
-undo
-select all frames (double click under the layer)
-enter.
Peter Wassink - 2D animator
• PC: Win11/64 Pro - AMD Ryzen 9 5900X 12-Core - 64Gb RAM
• laptop: Win10/64 Pro - i7-4600@2.1 GHz - 16Gb RAM
Svengali
Posts: 1575
Joined: 28 Dec 2006, 10:08

Re: Click and Fill

Post by Svengali »

For a long time I've had a short script that does something similar to Peter's suggestion (but more economically I think) which creates a mask or inverted mask for all frames in the current layer:

The script toggles between three states...
1. Normal stencil: it creates (and hides) a temp copy of the current layer, then turns stencil on for the copy layer so that all frames for the current layer are masked.
2. Inverted stencil: this simply turns the inverted stencil on for the copy layer.
3. Remove stencil: deletes copy of the layer.

The script also turns on a checkerboard for the masked or inverted masked area so you can move to any frame on any layer and see where you can or can't draw.

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
User avatar
cgmodeler
Posts: 120
Joined: 23 Oct 2012, 23:59
Location: Mexico
Contact:

Re: Click and Fill

Post by cgmodeler »

Amazing feedback guys I knew you had to know something about this. It really helped me to clarify the script, I found a bug where the Rectangle Fill with Fill inside enabled does not work and fills everything if the rectangle size is the same size as the canvas so by making it 1 pixel smaller on each side it will work perfectly and it will fill everything inside the canvas.

TLDR
I fixed the script, it should now work like this, Click on the script it will fill the inside and keep everything in the same layer as BEHIND (no new layer created), SHIFT CLICK will use the layer above as the source for the fill useful for keeping color on another layer, like the workflow that Peter suggested (In case somebody needs it). Same logic, it will process either a single or all the selected frames. I needed something like this because im used to storyboarding on azdrawing where there is a tool like that which really speeds up my work by keeping everything in 1 layer

I plan to do one tool that will automatically fill the inside with a default color so as soon as you draw you will have a filled shape when doing quick storyboarding.


CLICK will fill current framw with Behind mode
SHIFT CLICK will fill current with the layer above as the source
POP_339_cocoaClickFill_V1.2.gif
POP_339_cocoaClickFill_V1.2.gif (261.92 KiB) Viewed 1858 times
cocoaClickFill_EX.tvpx
V1.2
(57.5 KiB) Downloaded 28 times
POP_339_cocoaClickFill_V1.2.mp4
(1.78 MiB) Downloaded 29 times
www.cocoalopez.com
Desktop: TVP Pro 11.0.8 - 64bit Win 10 x64 64GB RAM - RTX3070 - Cintiq 27QHD Driver 6.3.29
Post Reply