Commit graph

10151 commits

Author SHA1 Message Date
HellAholic
02dbc7e6e1 add temp shortcuts
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
2025-08-27 15:02:22 +02:00
Remco Burema
10897e2b71 Painting: Show brush-preview when moving the mouse over.
CURA-12663
2025-08-23 22:42:47 +02:00
Remco Burema
fec24bfb19 Make sure the paint-strokes are as solid as before.
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
For fixing the paint-splatter issue Iswitched to a new way of drawing the polygon, which could result in missed strokes of pixels at the edge of (UV) polygons. This change should catch most of the remaining X% where that happened.

done as part of CURA-12662
2025-08-20 16:38:02 +02:00
Remco Burema
8bab847594 Remap-barycentric was slowing things down; optimize.
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
It was using the old (well, relatively speaking ... from the start of development of the current paint-epic) getIntersectRatioViaPt (three times no less), which was massive overkill for what we're trying to accomplish here.

done as part of CURA-12662
2025-08-20 15:13:03 +02:00
Remco Burema
1f60829959 Cleaning, small optimizations.
part of CURA-12662
2025-08-20 09:21:04 +02:00
Remco Burema
9bc1294ce1 Remove useless parameters (use already cached values instead).
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
part of CURA-12662
2025-08-19 09:08:09 +02:00
Remco Burema
28dc0cd32a PaintTool: Optimization refactors.
Don't have so many function-calls in performant code and cache camera-related variables until the camera moves again.

part of CURA-12662
2025-08-19 08:55:55 +02:00
Remco Burema
d339e092e7 Painting: Make fill-polygon miss less gaps.
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
... but one of the problems is that it doesn't give an outline.

part of CURA-12662
2025-08-18 22:35:18 +02:00
Remco Burema
6da4ca66a8 Painting: Have a sensible coordinate system.
Using the camera is more standard, and while it has some downsides ('smearing'/large skews on surfaces angled away from the camera) it seems to have the least quirks (or at least ones that users are used to already). -- Also the what was here previously was just wrong, I'm just saying it could in theory have been solved the way I originally wanted to, but that'd take a long time to get completely right and efficient.

part of CURA-12662
2025-08-18 21:05:09 +02:00
Remco Burema
b091cc23a1 Have the projection of the paint-stroke involve the camera after all.
This fixes the issue that it wouldn't flood over the 'rim' whenever the endpoints of a stroke was wholly within one plane, but the stroke itself would overlapp another. Plus also handle click on single point and use transformed mesh consistantly.

part of CURA-12662
2025-08-14 14:30:12 +02:00
Remco Burema
392e614887 Get PaintTool in a working state again after rewrite of projection.
Various fixes applied; method of drawing changed a bit (use qpath, otherwise we can't fill, right-size the brush in various ways (w/h of UV-canvas taken into account, fix that 'stroke-coords' are _yet another_ coord system instead of the same as one of the existing) also, with the stroke; fix that it should have been a convex hull of the union, not a convex hull of the intersection -- also take the scale of the model into account (which we need to) (but this has a side-effect in that the brush is now always the same size, regardless of which size the object is -- makes sense, but not 100pct sure if wanted) -- various other things cleaned up etc.

part of CURA-12662
2025-08-13 11:09:57 +02:00
Remco Burema
4f465bc30f Merge remote-tracking branch 'origin/CURA-12660_painting-UI-improvements' into CURA-12662_paint_splatter_issue 2025-08-12 20:31:50 +02:00
Remco Burema
a746a60afb Intersection each polygon with the stroke; paint that instead of dumping it to UV directly.
This prevents 'paint splatter', that is, previously, we had just a begin and an end point (actually we had a temp stopgap that iterated per triangle, but similar problems persisted), which we then mapped directly to UV and drew the stroke in that space. This causes the stroke to overlap parts of the UV-map that it didn't touch in 3D at all.

Now, we instead gather each triangle, map that to the estimated stroke plane, intersect the result with the stroke-shape, then map the resulting polygon back to UV-space.

At the moment this code isn't fully working yet -- but I solved all of the obvious things that can be wrong, and it could partially be that I based this branch off of a moment in time the other branch wasn't functionally properly.

part of CURA-12262
2025-08-12 19:29:43 +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
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
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
e8423755a4 Add button to auto-disable unused extruders
CURA-12622
2025-07-24 11:14:36 +02:00
Erwan MATHIEU
a39f6c94fa Make the warning message more concise
CURA-12622
The purpose being to make the message as short as possible so that people are not too much discouraged to read it
2025-07-24 10:50:31 +02:00
Erwan MATHIEU
b43bc95e2b
Merge branch 'main' into CURA-12622_warn_on_actual_unused
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
2025-07-21 13:56:58 +02:00
Erwan MATHIEU
3fa0dad1bf
Merge branch 'main' into CURA-12528_unwrap_uvs
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-07-21 11:37:58 +02:00
HellAholic
249d5f5245
Merge pull request #20640 from Ultimaker/CURA-12543_painting_ux
Some checks failed
conan-package / conan-package (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
[CURA-12543] Painting UI
2025-07-17 12:07:12 +02:00
Remco Burema
b3552d8b20 Basic warning on unused extruder.
Since the bed-temp (for example) might be unfluenced by unused but (probably accidentally) enabled extruders, we want to be able to warn the user of such.

part of CURA-12622
2025-07-16 11:27:49 +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
4cb7a0dc9f Merge remote-tracking branch 'origin/CURA-12543_painting_ux' into CURA-12528_unwrap_uvs 2025-07-08 10:50:28 +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
HellAholic
4a18b2e0af
Merge branch 'main' into CURA-12557_handle-deactivated-things 2025-06-30 12:50:15 +02:00
Erwan MATHIEU
ae2a189c14 Replace "cloudActive" property by generic "active"
CURA-12557
2025-06-30 09:53:54 +02:00
HellAholic
9cf75648ab Review comment
Some checks failed
conan-package / conan-package (push) Has been cancelled
unit-test / Run unit tests (push) Has been cancelled
- Set default to `""` for `Optional[str]` to remove the `or ""`
-The FW version can be returned as None which requires the fallback `or ""`
2025-06-25 13:54:56 +02:00
HellAholic
6a230b3df5 ClusterPrinterStatus: optional init args
Prevents a cura crash if any of the args are not returned from api call
2025-06-24 14:03:07 +02:00
Erwan MATHIEU
a1d1dc2ea0 Merge remote-tracking branch 'origin/main' into CURA-12543_painting_ux
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-06-24 13:37:23 +02:00
Erwan MATHIEU
be14fc7dd6 Send texture data to the engine
CURA-12574
2025-06-24 13:36:49 +02:00
Erwan MATHIEU
7dcc5cd470 Expose brush shape to QML
CURA-12543
2025-06-24 13:11:00 +02:00