Commit graph

58 commits

Author SHA1 Message Date
HellAholic
a55cca73f4 Apply Review
clear_mask -> clear_texture_bit_mask
2025-08-26 13:05:56 +02:00
Erwan MATHIEU
243b7c56a6 Merge branch 'CURA-12660_painting-UI-improvements' into CURA-12661_make-more-global-paint-undo
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
2025-08-07 11:08:49 +02:00
Erwan MATHIEU
db514f0be7 Properly prepare the model for painting
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
CURA-12660
The UV-unwrapping is now done in a background job, and the UI displays a waiting state. This fixes the issue where the user would start painting but the model was not ready yet, and the first stroke would be missing.
2025-08-07 11:03:51 +02:00
Erwan MATHIEU
8a59faceb1 Merge branch 'CURA-12660_painting-UI-improvements' into CURA-12661_make-more-global-paint-undo
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
2025-08-06 16:39:49 +02:00
Erwan MATHIEU
e69a436942 Fix sometimes wrongly displayed view
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
CURA-12660
This required a refactoring of the management of the active view. The previous behavior was that anyone could set the active view, depending on certain conditions. But now we also have a view that is set by a tool, so sometimes the actually set view would be incorrect. Now each Stage requests an active view, and each tool CAN also request an active view. Then the Controller decides which view should actually be active depending on the active stage and tool.
2025-08-06 16:15:05 +02:00
Erwan MATHIEU
cf24ed91e9 Improve fix for opacity issues
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
CURA-12660
Previous fix caused issues when moving to preview
2025-08-05 15:55:23 +02:00
Erwan MATHIEU
9d97eb7d59 Fix sometimes wrong painting color display
CURA-12660
2025-08-05 14:07:44 +02:00
Erwan MATHIEU
b5e2ce6168 Restore disabled support painting
CURA-12661
2025-08-04 16:07:49 +02:00
Erwan MATHIEU
8f9a17d49e Simplify QML code
CURA-12661
2025-08-04 16:03:09 +02:00
Erwan MATHIEU
586c2939a6 Enable undo/redo buttons when appropriate
CURA-12661
2025-08-04 15:46:51 +02:00
Erwan MATHIEU
53ef6fbdf3 Merge remote-tracking branch 'origin/CURA-12660_painting-UI-improvements' into CURA-12661_make-more-global-paint-undo 2025-08-04 15:29:15 +02:00
Erwan MATHIEU
9685764721 Implement undo-redo by full stroke
CURA-12661
2025-08-04 15:19:04 +02:00
Erwan MATHIEU
63843b59c4 Merge remote-tracking branch 'origin/main' into CURA-12660_painting-UI-improvements
Some checks failed
conan-package-resources / conan-package (push) Has been cancelled
conan-package / conan-package (push) Has been cancelled
printer-linter-format / Printer linter auto format (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
conan-package-resources / signal-curator (push) Has been cancelled
2025-08-04 11:55:26 +02:00
Erwan MATHIEU
44d6c0a969 Call SolidView dynamically instead of by inheritance
CURA-12660
The previous method actually doesn't work when Cura is packaged because the plugins paths change. This method is much safer, and uses the actual SolidView instance.
2025-08-04 11:28:31 +02:00
Erwan MATHIEU
e742ca81f3 Fixed more possible crashes
CURA-12528
2025-08-04 10:24:29 +02:00
Erwan MATHIEU
6547eb6ff3
Merge branch 'main' into CURA-12660_painting-UI-improvements 2025-08-04 08:46:04 +02:00
Erwan MATHIEU
78daa94ebf Save and restore painting tool settings
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
CURA-12660
2025-08-01 17:08:53 +02:00
Erwan MATHIEU
ab58dec5d1 Fix unability to paint with visible message box
CURA-12660
When a message box is displayed, some offscreen rendering passes (face selection) render an unpredictable result and we are unable to start painting.
This went through a refactoring of the rendering passes. Since doing the offscreen rendering outside the Qt rendering loop caused some troubles, we now use the rendering passes only inside the Qt rendering loop, so that they work properly. Tools also have the ability to indicate which extra passes they require, so that we don't run all the passes when they are not required.
Since this issue also concerns the support blockers placement and rotation by face selection, they have been updated so that they now also always work.
The face selection mechanism using the Selection class was partially working and used only by the rotation, so now it has been deprecated in favor of the new mechanism.
2025-08-01 13:10:03 +02:00
HellAholic
be88e9d18f
Merge branch 'main' into CURA-12528_unwrap_uvs
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
2025-08-01 11:27:11 +02:00
Erwan MATHIEU
3cb7eb3c87 Avoid too dark or too light areas while painting
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
CURA-12660
This avoid having parts of the model where you cannot see the painted areas anymore
2025-07-31 11:47:41 +02:00
Erwan MATHIEU
ef7bde87fa Allow painting only when 1 object is selected
CURA-12660
2025-07-31 11:24:36 +02:00
Erwan MATHIEU
6292f5b133 Hide paint-on-support option until it is implemented
CURA-12660
2025-07-30 16:57:29 +02:00
Erwan MATHIEU
91e986697d Fix painting after changing the selected object
CURA-12660
2025-07-30 16:54:05 +02:00
Erwan MATHIEU
6896c0ed4b Display classic view when there is no selection
CURA-12660
2025-07-30 16:53:41 +02:00
Erwan MATHIEU
6bf9a8a0ae Ignore invisible object for selection in paint mode
CURA-12660
2025-07-30 16:00:13 +02:00
Erwan MATHIEU
73f5b817b4 Display build plate in paint mode
CURA-12660
2025-07-30 15:59:30 +02:00
Erwan MATHIEU
da0509cda3 Fix painting through an invisible object
CURA-12660
2025-07-30 15:58:26 +02:00
Erwan MATHIEU
5d2aca4e31 Avoid crash when UV coordinates not loaded/generated
CURA-12664
2025-07-30 12:10:40 +02:00
Erwan MATHIEU
20a2664294 Remove the desired texture definition
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
CURA-12528
2025-07-14 13:36:48 +02:00
Erwan MATHIEU
55ee4ec6e1 Calculate and apply UV coordinates
Some checks failed
conan-package-resources / conan-package (push) Has been cancelled
conan-package / conan-package (push) Has been cancelled
printer-linter-format / Printer linter auto format (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
conan-package-resources / signal-curator (push) Has been cancelled
CURA-12528
2025-07-08 15:47:46 +02:00
Erwan MATHIEU
bbddcab4e9 Proper paint-on-seam UI
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
CURA-12578
2025-07-03 11:05:09 +02:00
Erwan MATHIEU
7dcc5cd470 Expose brush shape to QML
CURA-12543
2025-06-24 13:11:00 +02:00
Erwan MATHIEU
7cca040033 Merge remote-tracking branch 'origin/CURA-12544_saving-and-loading-painted-files-in-Cura' into CURA-12566_save-proper-data-in-painted-texture 2025-06-19 10:35:53 +02:00
Erwan MATHIEU
810638a29a Merge remote-tracking branch 'origin/CURA-12543_painting_ux' into CURA-12544_saving-and-loading-painted-files-in-Cura 2025-06-19 10:24:33 +02:00
Erwan MATHIEU
960d2a2315 Optimized application of stroke
CURA-12566
2025-06-19 10:15:37 +02:00
Erwan MATHIEU
4caba52f05 Basically working multipurpose painting
CURA-12566
2025-06-18 16:00:47 +02:00
Remco Burema
e27926a968 Paint: Have a stroke properly propagate over the texture-triangles.
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
part of CURA-12543
2025-06-18 15:02:06 +02:00
Remco Burema
d2ade67cad Paint: 'Substrokes per face' data-structure.
part of CURA-12543
2025-06-18 13:41:20 +02:00
Remco Burema
56f669d1fd Paint: Replace undo-redo UI code with qml Action.
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
part of CURA-12543
2025-06-18 12:50:21 +02:00
Remco Burema
01c02e4479 Paint: Simplify and clarify input-event-code.
part of CURA-12543
2025-06-18 12:42:45 +02:00
Remco Burema
4fae9b231a Paint: Make calculation of Baricentric-coordinates a bit more robust.
part of CURA-12543
2025-06-18 12:06:04 +02:00
Remco Burema
75946d8871 Shape of brush is an enum now, not a string.
part of CURA-12543
2025-06-18 11:56:08 +02:00
Erwan MATHIEU
864ccbc33b Merge remote-tracking branch 'origin/CURA-12543_painting_ux' into CURA-12544_saving-and-loading-painted-files-in-Cura 2025-06-17 09:27:52 +02:00
Remco Burema
4a87b48084 Stopgap to prevent texture-patch borders from messing up the painting.
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
This code is expandable into the real solution later, see the TODO left in the code by this commit.

part of CURA-12543
2025-06-05 08:25:20 +02:00
Remco Burema
40f02dc15f Defensive coding; deal with degenerate triangles, co-linearity or query pt equal to corner.
This shouldn't happen on a well UV-mapped, manifold mesh -- well, unless someone manages to click exactly on one of the triangle corners. Better to get this fixed now then to run into floating point shenanigans later.

part of CURA-12543
2025-06-05 08:23:22 +02:00
Remco Burema
12d788db62 Review comments: Fix crash when click next to object.
Refactoring that part to up top caused the problem I think -- getSelectedObject(0) over getAllSelectedObjects()[0] is clearly the better call in this case anyway.

part of CURA-12543
2025-06-04 21:00:27 +02:00
Erwan MATHIEU
21443faa92 Merge remote-tracking branch 'origin/CURA-12543_painting_ux' into CURA-12544_saving-and-loading-painted-files-in-Cura
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
2025-06-03 16:08:40 +02:00
Erwan MATHIEU
f0764134cc Store painted texture to 3MF file
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
CURA-12544
Also allows having multiple texture for multiple models while painting
2025-06-03 13:27:57 +02:00
Remco Burema
d28c2aac68 Painting: Fix non-drag not producing a circle (square was already OK though).
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
part of CURA-12543
2025-05-28 17:12:42 +02:00
Remco Burema
c9ca999f10 PaintTool: Undo/Redo should be working now.
Also fix missing pen-shape I suppose.

part of CURA-12543
2025-05-28 16:43:33 +02:00