From f49f0e5a889d6b090853faa2215ba4c3efb8b9ab Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Wed, 11 Feb 2026 16:52:28 +0100 Subject: [PATCH 1/2] Gracefully fail painting in OpenGL compatibility mode CURA-12853 --- plugins/PaintTool/PaintTool.py | 12 +++++++++++- plugins/PaintTool/PaintTool.qml | 16 ++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/plugins/PaintTool/PaintTool.py b/plugins/PaintTool/PaintTool.py index ad088dc1b8..5d57ccff28 100644 --- a/plugins/PaintTool/PaintTool.py +++ b/plugins/PaintTool/PaintTool.py @@ -21,6 +21,7 @@ from UM.Scene.Camera import Camera from UM.Scene.SceneNode import SceneNode from UM.Scene.Selection import Selection from UM.Tool import Tool +from UM.View.GL.OpenGLContext import OpenGLContext from cura.CuraApplication import CuraApplication from cura.PickingPass import PickingPass @@ -44,6 +45,7 @@ class PaintTool(Tool): MULTIPLE_SELECTION = 0 # Multiple objects are selected, wait until there is only one PREPARING_MODEL = 1 # Model is being prepared (UV-unwrapping, texture generation) READY = 2 # Ready to paint ! + NOT_SUPPORTED = 3 # Painting is not supported (due to OpenGL compatibility mode) def __init__(self, view: PaintView) -> None: super().__init__() @@ -72,7 +74,9 @@ class PaintTool(Tool): self._last_world_coords: Optional[numpy.ndarray] = None - self._state: PaintTool.Paint.State = PaintTool.Paint.State.MULTIPLE_SELECTION + legacy_opengl = OpenGLContext.isLegacyOpenGL() + self._state: PaintTool.Paint.State = PaintTool.Paint.State.NOT_SUPPORTED if legacy_opengl else\ + PaintTool.Paint.State.MULTIPLE_SELECTION self._prepare_texture_job: Optional[PrepareTextureJob] = None self.setExposedProperties("PaintType", "BrushSize", "BrushColor", "BrushShape", "BrushExtruder", "State", "CanUndo", "CanRedo") @@ -413,11 +417,17 @@ class PaintTool(Tool): self._updateState() def _updateActiveView(self) -> None: + if self._state == PaintTool.Paint.State.NOT_SUPPORTED: + return + has_painted_object = self._view.hasPaintedObject() stage_is_prepare = self._controller.getActiveStage().stageId == "PrepareStage" self.setActiveView("PaintTool" if has_painted_object and stage_is_prepare else None) def _updateState(self): + if self._state == PaintTool.Paint.State.NOT_SUPPORTED: + return + painted_object = self._view.getPaintedObject() if painted_object is not None and self._controller.getActiveTool() == self: if painted_object.callDecoration("getPaintTexture") is not None and painted_object.getMeshData().hasUVCoordinates(): diff --git a/plugins/PaintTool/PaintTool.qml b/plugins/PaintTool/PaintTool.qml index 2f96bffd24..1ef67c19ae 100644 --- a/plugins/PaintTool/PaintTool.qml +++ b/plugins/PaintTool/PaintTool.qml @@ -332,4 +332,20 @@ Item horizontalAlignment: Text.AlignHCenter } } + + Rectangle + { + id: warningLegacyOpenGLItem + anchors.fill: parent + color: UM.Theme.getColor("main_background") + visible: UM.Controller.properties.getValue("State") === Cura.PaintToolState.NOT_SUPPORTED + + UM.Label + { + anchors.fill: parent + text: catalog.i18nc("@label", "Painting is not available in OpenGL compatibility mode. Please use a different system.") + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + } } From 2cc3b0bbf5ec1f2739c19db2f83b9fc06c63ef0a Mon Sep 17 00:00:00 2001 From: HellAholic Date: Tue, 3 Mar 2026 11:51:11 +0100 Subject: [PATCH 2/2] Update error message for painting availability --- plugins/PaintTool/PaintTool.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PaintTool/PaintTool.qml b/plugins/PaintTool/PaintTool.qml index 1ef67c19ae..1eae6a2ed7 100644 --- a/plugins/PaintTool/PaintTool.qml +++ b/plugins/PaintTool/PaintTool.qml @@ -343,7 +343,7 @@ Item UM.Label { anchors.fill: parent - text: catalog.i18nc("@label", "Painting is not available in OpenGL compatibility mode. Please use a different system.") + text: catalog.i18nc("@label", "Painting is not available on this device. Your graphics card or drivers do not fully support it. Updating your graphics drivers may enable this feature.") verticalAlignment: Text.AlignVCenter horizontalAlignment: Text.AlignHCenter }