Cura/cura/Scene/SliceableObjectDecorator.py
Erwan MATHIEU f0764134cc
Some checks are pending
conan-package / conan-package (push) Waiting to run
unit-test / Run unit tests (push) Waiting to run
Store painted texture to 3MF file
CURA-12544
Also allows having multiple texture for multiple models while painting
2025-06-03 13:27:57 +02:00

23 lines
827 B
Python

from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
from UM.View.GL.OpenGL import OpenGL
# FIXME: When the texture UV-unwrapping is done, these two values will need to be set to a proper value (suggest 4096 for both).
TEXTURE_WIDTH = 512
TEXTURE_HEIGHT = 512
class SliceableObjectDecorator(SceneNodeDecorator):
def __init__(self) -> None:
super().__init__()
self._paint_texture = None
def isSliceable(self) -> bool:
return True
def getPaintTexture(self, create_if_required: bool = True):
if self._paint_texture is None and create_if_required:
self._paint_texture = OpenGL.getInstance().createTexture(TEXTURE_WIDTH, TEXTURE_HEIGHT)
return self._paint_texture
def __deepcopy__(self, memo) -> "SliceableObjectDecorator":
return type(self)()