Fix #119055: GPv3: Eraser changes cap type in unrelated strokes #119079

Closed
Pratik Borhade wants to merge 1 commits from PratikPB2123:119055-erase-start-point into main

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

End cap of stroke changes to flat when first point of next stroke is
removed. Avoid changing the end_cap when source and destination curve
count is same.

End cap of stroke changes to `flat` when first point of next stroke is removed. Avoid changing the `end_cap` when source and destination curve count is same.
Pratik Borhade added 1 commit 2024-03-05 11:17:40 +01:00
837507d6ba Fix #119055: GPv3: Eraser changes cap type in unrelated strokes
End cap of stroke changes to `flat` when first point of next stroke is
removed. Avoid changing the `end_cap` when source and destination curve
count is same.
Pratik Borhade requested review from Lukas Tönne 2024-03-05 11:17:56 +01:00
Pratik Borhade requested review from Falk David 2024-03-05 11:17:56 +01:00
Pratik Borhade added the
Module
Grease Pencil
label 2024-03-05 11:28:01 +01:00
Member

I don't think this works as-is: It prevents changes to any end cap when the curves count doesn't change. This includes erasing the end of a stroke which should make it flat.

I'm pretty sure i've also still seen some unrelated strokes getting affected by cap changes after applying the patch, but i can't repro this reliably yet.

I don't think this works as-is: It prevents changes to _any_ end cap when the curves count doesn't change. This includes erasing the end of a stroke which should make it flat. I'm pretty sure i've also still seen some unrelated strokes getting affected by cap changes after applying the patch, but i can't repro this reliably yet.
Author
Member

This includes erasing the end of a stroke which should make it flat.

This is true even without PR :)
is_cut is not set to true for curve end points (only done for first point of strokes)

I'm pretty sure i've also still seen some unrelated strokes getting affected by cap changes after applying the patch, but i can't repro this reliably yet.

Oh, okay. But I didn't notice in any other case apart from the case mentioned in the .blend file and explained in the PR (just erase inside circled area)

> This includes erasing the end of a stroke which should make it flat. This is true even without PR :) `is_cut` is not set to true for curve end points (only done for first point of strokes) > I'm pretty sure i've also still seen some unrelated strokes getting affected by cap changes after applying the patch, but i can't repro this reliably yet. Oh, okay. But I didn't notice in any other case apart from the case mentioned in the .blend file and explained in the PR (just erase inside circled area)
Member

Here's a test demonstrating that the solution is incomplete: There are 3 curves with 2 points each. The eraser would miss one stroke entirely, cut the second stroke in half, and completely remove the third stroke.

Because the 3rd stroke is removed the overall number of curves changes, so it will pass the new condition and still set the end cap of the first stroke, which should remain untouched. We need a way to determine if the source point corresponding to the last point of the stroke is actually the last of its curve.

image

Here's a test demonstrating that the solution is incomplete: There are 3 curves with 2 points each. The eraser would miss one stroke entirely, cut the second stroke in half, and completely remove the third stroke. Because the 3rd stroke is removed the overall number of curves changes, so it will pass the new condition and still set the end cap of the first stroke, which should remain untouched. We need a way to determine if the source point corresponding to the last point of the stroke is actually the last of its curve. ![image](/attachments/5d0dd592-6859-432a-a141-0d785b96ea3d)
162 KiB
Author
Member

Indeed, it fails in other cases as well. but at least now we know why end_cap of prior stroke is changing :)
Maybe @amelief know how to fix this.

Indeed, it fails in other cases as well. but at least now we know why `end_cap` of prior stroke is changing :) Maybe @amelief know how to fix this.
Author
Member

#119151 🙂

https://projects.blender.org/blender/blender/pulls/119151 🙂
Pratik Borhade closed this pull request 2024-03-07 10:48:29 +01:00
Pratik Borhade deleted branch 119055-erase-start-point 2024-03-07 11:47:24 +01:00

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#119079
No description provided.