Simple Copy or Cut Button Set

Share your custom panels, brushes, papers... (you need to be registered to read posts in this section)
Post Reply
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Simple Copy or Cut Button Set

Post by Svengali »

CopyOrCut.png
CopyOrCut.png (11 KiB) Viewed 3600 times
Two little buttons that make Copying or Cutting out a brush, simple but sophisticated.

What do they do?

The "Copy it Out" button works in two clicks:
1. first click, it provides a redish, free-hand line to draw around one or more elements on screen.
2. second click, it copies the outlined element(s) into a brush, LEAVING THE ORIGINAL ELEMENTS STILL ON SCREEN.

The "Cut it Out" button also works in two clicks:
1. first click, it provides a red, free-hand line to draw around one or more elements on screen.
2. second click, it cuts the outlined element(s) into a brush, REMOVING THE ORIGINAL ELEMENTS FROM THE SCREEN.

The strange thing about both buttons is that they perform two DIFFERENT operations, on first click, they let you define the area(s) to be cut (outlining areas), then click a second time to grab the area(s) outlined after the first click.

I think this two-stage functionality is a byproduct of the peculiar fact that any and all TVPaint Button commands are first read all the way through and loaded, THEN commands are processed, first to last. As an example, here is the listing for the "Copy it Out" button:

Code: Select all

Command: tv_SetActiveShape SELECTFREEHAND SMOOTH 0 AALIASING 0 KEEP 0 SUBPIXEL 3 OPTIMIZE 1
Key: Shape Select: Copy To CustomBrush
Key: Shape Select: Clear
First time through, the selection Command is activated allowing you to outline one or more screen areas, and since no selected areas exist yet, the following Shape Select:Copy To CustomBrush command has nothing to do, also the Shape Select: Clear has nothing to do.

Second time through, the Command to SelectFreeHand is ignored since areas have already been selected, but the follow-up Shape Select commands can now Copy To CustomBrush AND Clear.

Likewise, the "Cut it Out" button works the same way, first time through lets you SelectFreeHand, and second time through Cut To CustomBrush AND Clear.

How I use these Buttons:
I have assigned these buttons to two adjacent, Shortcut Keys, Q = Cut it Out and W = Copy it Out.
To Cut a Brush, I press Q key once so I can outline what I want to cut out of the image and put into a brush, then I press Q key again to make the cut happen.
To Copy a Brush, I press W key once so I can outline what I want to copy out of the image and put into a brush, then I press W key again to make the copy happen.

An interesting side benefit of this two part operation is that the outline can be edited to be extremely precise, and can select multiple areas to be captured into a brush. I discovered that when I draw around an area(s) to capture, of course the outlined area(s) becomes part of what will be grabbed, BUT if I right click and "edit" the existing outlines, I can SUBTRACT from what has already been selected, so the final outline can be pixel-perfect before I press the shortcut key a second time to capture the outlined area.

Normally, when you cut or copy, drawing the outline and capturing happens in one step, so you have to be very careful in drawing the outlined area, or you won't get what you want and you have to UNDO and re-cut.

Sven
Attachments
Copy or Cut.tvpx
(175 KiB) Downloaded 360 times
Last edited by Svengali on 17 Apr 2020, 21:10, edited 3 times in total.
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
D.T. Nethery
Posts: 4225
Joined: 27 Sep 2006, 19:19

Re: Simple Copy or Cut Button Set

Post by D.T. Nethery »

Thank you for posting this useful tool set.

Animator, TVPaint Beta-Tester, Animation Educator and Consultant.
MacOS 12.7.1 Monterey , Mac Mini (2018) , 3.2 GHz 6-Core Intel Core i7,
16 GB RAM , TVPaint PRO 11.7.1 - 64bit , Wacom Cintiq 21UX 2nd Gen.
,Wacom Intuos Pro 5 , Wacom driver version 6.3.39-1
Svengali
Posts: 1571
Joined: 28 Dec 2006, 10:08

Re: Simple Copy or Cut Button Set

Post by Svengali »

Very welcome David.

Let me add: I meant to include that both buttons will work on MULTIPLE SELECTED FRAMES TO CAPTURE ANIMBRUSHES:
1. select the frames to be copied from.
2. press the appropriate short-cut key, then draw around the area(s) to be captured into the AnimBrush.
3. press YES in the "Cut Out an AnimBrush ?" popup up box.

result is a clean, multiframe AnimBrush from the source.

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
NathanOtano
Posts: 1208
Joined: 01 Apr 2014, 07:07
Location: Biarritz, France
Contact:

Re: Simple Copy or Cut Button Set

Post by NathanOtano »

I did something similar in my Smart Tools panel, if you're curious it's the "Cut B" button : http://forum.tvpaint.com/viewtopic.php? ... 7c3bcfcbea
The button activates cut brush on one click if you're on another tool (so you can copy with it), and if you have a selection instead it cuts a custom brush and deselects (you can undo to get back your cutted image and still have your brush). When you use it with a custom brush active, it pastes it in place and goes back to your drawing brush

There is some troubleshooting to do maybe but i use it all the time it's quite handy

Yours is much cleaner to execute and works really well thanks!
Working on Windows 10
Creator of Disnosc, providing storyboard, animation and design for 2D realistic pictural animation: https://www.disnosc.fr/ - nathanotano@disnosc.fr
Highly interested in animation workflows, I'm open to scripting new TVP functions for individuals and studios.
Post Reply