Make the UI for the warp tool points a bit cleaner
ClosedPublic

Authored by scottpetrovic on Jun 21 2018, 9:10 PM.

Details

Reviewers
dkazakov
Group Reviewers
Krita
Summary

This is mostly a "painting" change that shows the grid for the warp transform instead of the existing points and connection lines.

This is mostly just to better visualize the result. The existing warp tool has a lot of "original" data and points which get in the way a bit with the end transform result appearance

I also limited the subdivide to 2 - 6. That seems like a reasonable limit. It currently get do 0 and 1 which gave odd results.

Test Plan

Did some warping and change the subdivide points. The appearance appears to be ok.

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
scottpetrovic created this revision.Jun 21 2018, 9:10 PM
Restricted Application added a project: Krita. · View Herald TranscriptJun 21 2018, 9:10 PM
scottpetrovic requested review of this revision.Jun 21 2018, 9:10 PM
dkazakov requested changes to this revision.Jun 22 2018, 8:27 AM
dkazakov added a subscriber: dkazakov.

Hi, @scottpetrovic!

I do really like the idea of using grid for this transformation, it would simplify using the warp tool a lot. The patch gives the idea of it, and I like how it looks in general. Though the implementations has two major problems:

  1. The lines are not visible on light background, they also don't handle zoom correctly. Please use KisHandlePainterHelper to overcome both issues.

  1. The connection lines get crazy when you add points in the order they don't expect. The task of creating such mesh is not very trivial, you should use something like Delaunay algorithm, or something like that (link). It was actually the reason why mesh visualization was not implemented in the first implementation :)

This revision now requires changes to proceed.Jun 22 2018, 8:27 AM

hi @dkazakov Thanks for the review

I made some changes...

  1. Using the helper tool for drawing the line. The dotted line is easier to read. Good idea
  2. I am making it so the grid style is the only style that will draw the lines. If the user clicks the "draw" option, there will be no lines drawn. I think the subdivide is used 95% of the time, so I think having that show the lines is still pretty helpful.

I added an extra enum so the warp transform knows what style is being drawn. It is the warpCalculation enum that keeps track of it.

Hi, @scottpetrovic!

The patch looks and works basically fine. But could you tell me, why you limited the number of subdivisions by 6? I have a feeling that it is a bit too rough for doing any real work... Is it possible to keep the number of subdivisions unlimited as it used to be?

At least with me and one other artist, having any more than 4 the warp tool starts to become less usable. There are so many points it is difficult to do the warping. If a transformation needs to be really smooth with being bent, it is easier to just use the liquefy tool with a large brush size and push it.

Other applications have warp using bezier points on the corner handles to get a similar effect. We would either need that or some type of soft selection to make more points useful. That was my logic for limiting it to 6. I didn't see anyone using 6, but did it on the safe side.

I can ping some other artists to see what they do.

Deevad added a subscriber: Deevad.Jun 25 2018, 8:13 PM

Thank you for the work on Wrap transform.
I understand the limitation to 6 max; I rarely subdivide a lot myself. If I need more thinner grain or smaller deformation: I often prefer the Liquify mode.
But maybe Someone can use it later on a super large canvas with a lot of CPU/GPU, and why not limiting the amount in this case?

I swapped out it so it goes up to 30 subdivisions if someone really wants. I don't know if we need to go up to unlimited. I swapped out the algorithm so it just takes the square root of the points instead of the manual assigning.

30 would be enough I think.

Other applications have warp using bezier points on the corner handles to get a similar effect.

This would be good to have if it is possible

dkazakov accepted this revision.Jun 29 2018, 3:41 PM

Hi, @scottpetrovic!

The patch looks and works fine now! Please push!

There is still one small bug (not a regression, so you can push without it). The grid lines are now painted with the handles painter, so they are rendered correctly on any zoom levels, but the circular handles are not. Please see the attached screenshot of 8k image. The handles are scaled down too drastically.

To overcome this issue, one should use KisHandlePainterHelper::drawHandleCircle. But three special KisHandleStyle objects will have to be created to describe the fill modes used in the transform tool: unselected, active, multiselect (red).

This revision is now accepted and ready to land.Jun 29 2018, 3:41 PM
dkazakov closed this revision.Dec 25 2018, 8:24 AM

As far as I can tell, the patch has been committed in a8ca98974df7c96e2ff564797f2e3aa534d194f0, so let's close it :)