GPv3: Soft mode for the Eraser tool #110310

Open
Amélie Fondevilla wants to merge 57 commits from amelief/blender:gpv3-erase-operator-soft-mode into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

57 Commits

Author SHA1 Message Date
Amélie Fondevilla 02340eb723 Replace int64 by int for points and curves indices 2023-08-23 14:35:10 +02:00
Amélie Fondevilla 8ddbbcc8ac Add comment 2023-08-23 14:34:56 +02:00
Amélie Fondevilla 4b0c663ebe Small typo 2023-08-23 14:34:42 +02:00
Amélie Fondevilla 94e6621f42 Removed unused variable 2023-08-23 14:29:53 +02:00
Amélie Fondevilla 457c0516fa Remove debug print 2023-08-23 14:28:45 +02:00
Amélie Fondevilla b6a0227c6f Fix issues with cyclic curves 2023-08-23 14:28:45 +02:00
Amélie Fondevilla bde19d0eda Unify intersection functions for soft and hard eraser 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 9d1f9582d3 Edit comment 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 650eabf647 Refactor 2023-08-23 14:28:45 +02:00
Amélie Fondevilla b68e42a863 Fix error in intersection indices 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 1bf8061ea6 Refactor: use contiguous array instead of vectors 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 26c6eaaf8f Update initial factor for intersection to keep the sorting valid. 2023-08-23 14:28:45 +02:00
Amélie Fondevilla f5a5a9ca30 Fix missing update of the ring index in the case of one-point strokes 2023-08-23 14:28:45 +02:00
Amélie Fondevilla b60113c2e1 Keep caps option in UI also for soft eraser 2023-08-23 14:28:45 +02:00
Amélie Fondevilla e353ed0510 Cleanup: renaming functions 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 4b1a297bd9 Fix: remove 1px sample in curve falloff 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 9c92aa627b Cleanup falloff and rings
Cleanup
2023-08-23 14:28:45 +02:00
Amélie Fondevilla 2ebdbd5fc5 Move up intersections functions 2023-08-23 14:28:45 +02:00
Amélie Fondevilla f806001bdf Cleanup: use Span instead of Array ref 2023-08-23 14:28:45 +02:00
Amélie Fondevilla d86286547d Comment format 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 24462cd88b Move recompute topology function 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 3c7476e24b Change the threshold 2023-08-23 14:28:45 +02:00
Amélie Fondevilla bd7b97c268 Cleanup 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 070ee21ee3 Fix point ring for cyclic curve 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 6bd5f848c6 Fix curve ring for one point stroke 2023-08-23 14:28:45 +02:00
Amélie Fondevilla f3134bc3ee Fix : remove succesive cuts 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 18bb575b33 Fix crash when attribute not found 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 9a84334d9e Simplify stroke after erasing 2023-08-23 14:28:45 +02:00
Amélie Fondevilla b47995aa9d Fix bug in the ring selection 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 50ddf0325a Cleanup 2023-08-23 14:28:45 +02:00
Amélie Fondevilla ad61aafc10 Fix inaccurate comment 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 0e0f363128 Piece-wise linear decomposition of the eraser's falloff 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 108ea06637 Set opacity with a naive sampling of the curve falloff 2023-08-23 14:28:45 +02:00
Amélie Fondevilla cd807e0956 Soft eraser with multiple radii 2023-08-23 14:28:45 +02:00
Amélie Fondevilla ce8c4c2117 Use the brush's falloff curve in the soft eraser 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 5640271192 Add the falloff curve UI in the eraser tool 2023-08-23 14:28:45 +02:00
Amélie Fondevilla fe02113e01 Update the paint settings function with the new grease pencil paint mode. 2023-08-23 14:28:45 +02:00
Amélie Fondevilla fcb7b32150 Add brush strength controller in the UI 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 4d4c053558 Fix: wrong map passed to gather attributes 2023-08-23 14:28:45 +02:00
Amélie Fondevilla a7e66779c0 Add descriptive comment for the soft eraser function 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 34237b96f9 Refactor: gather points attributes 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 378f8f1654 Use curve mapping to compute the eraser's strength 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 832f1e36c2 Add linear falloff 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 7de5ef4cc6 Cleanup 2023-08-23 14:28:45 +02:00
Amélie Fondevilla cc608cf792 Adjust grain sizes 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 24b0cd7e82 Renaming variables 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 0cc4694cd9 Refactor opacity copy (early return) 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 027dd5eb56 Refactor opacity copy (early return) 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 6dae3db420 Tag for changes only if changes were made 2023-08-23 14:28:45 +02:00
Amélie Fondevilla d6a90d5f7a Minor change 2023-08-23 14:28:45 +02:00
Amélie Fondevilla c979c498ee Clean up 2023-08-23 14:28:45 +02:00
Amélie Fondevilla c3ab483a9e The soft eraser now erases properly 2023-08-23 14:28:45 +02:00
Amélie Fondevilla 4981da699a Wip: Attempt to refactor 2023-08-23 14:28:44 +02:00
Amélie Fondevilla 67e2bed83c Delete points that are under an opacity threshold 2023-08-23 14:28:44 +02:00
Amélie Fondevilla fb1e300a98 Full copy of the source geometry 2023-08-23 14:28:44 +02:00
Amélie Fondevilla fc7c5da950 Decrease point opacity 2023-08-23 14:28:44 +02:00
Amélie Fondevilla 6bca3ea6b1 Init soft eraser operator 2023-08-23 14:28:44 +02:00