3
3
4
4
try :
5
5
from cura .ApplicationMetadata import CuraSDKVersion
6
- except ImportError : # Cura <= 3.6
6
+ except ImportError : # Cura <= 3.6
7
7
CuraSDKVersion = "6.0.0"
8
8
USE_QT5 = False
9
9
if CuraSDKVersion >= "8.0.0" :
19
19
from UM .PluginRegistry import PluginRegistry
20
20
from UM .Message import Message
21
21
from UM .Logger import Logger
22
- from UM .Version import Version
23
22
24
23
from UM .Scene .Selection import Selection
25
24
from UM .Scene .SceneNode import SceneNode
31
30
from cura .Scene .SliceableObjectDecorator import SliceableObjectDecorator
32
31
from cura .Scene .BuildPlateDecorator import BuildPlateDecorator
33
32
from UM .Mesh .MeshData import MeshData , calculateNormalsFromIndexedVertices
34
- from UM .Mesh .MeshBuilder import MeshBuilder
35
33
from UM .Math .AxisAlignedBox import AxisAlignedBox
36
34
from UM .Mesh .ReadMeshJob import ReadMeshJob
37
35
from UM .Math .Vector import Vector
38
36
from UM .Math .Matrix import Matrix
37
+ from UM .Resources import Resources
38
+ from UM .i18n import i18nCatalog
39
39
40
40
from .SetTransformMatrixOperation import SetTransformMatrixOperation
41
41
from .SetParentOperationSimplified import SetParentOperationSimplified
42
42
from .SetMeshDataAndNameOperation import SetMeshDataAndNameOperation
43
-
43
+
44
44
import os
45
45
import sys
46
46
import numpy
47
47
import trimesh
48
48
import random
49
- import copy
50
49
51
50
from typing import Optional , List , Dict
52
51
53
- from UM .Resources import Resources
54
- from UM .i18n import i18nCatalog
55
-
56
52
Resources .addSearchPath (
57
53
os .path .join (os .path .abspath (os .path .dirname (__file__ )))
58
54
) # Plugin translation file import
59
55
60
56
catalog = i18nCatalog ("meshtools" )
61
57
62
- if catalog .hasTranslationLoaded ():
63
- Logger .log ("i" , "Mesh-Tool Plugin translation loaded!" )
64
-
58
+
65
59
class MeshTools (Extension , QObject ,):
66
60
def __init__ (self , parent = None ) -> None :
67
61
QObject .__init__ (self , parent )
@@ -78,9 +72,9 @@ def __init__(self, parent = None) -> None:
78
72
self ._controller = self ._application .getController ()
79
73
self ._controller .getScene ().sceneChanged .connect (self ._onSceneChanged )
80
74
81
- self ._currently_loading_files = [] # type: List[str]
82
- self ._node_queue = [] # type: List[SceneNode]
83
- self ._mesh_not_watertight_messages = {} # type: Dict[str, Message]
75
+ self ._currently_loading_files = [] # type: List[str]
76
+ self ._node_queue = [] # type: List[SceneNode]
77
+ self ._mesh_not_watertight_messages = {} # type: Dict[str, Message]
84
78
85
79
self ._settings_dialog = None
86
80
self ._rename_dialog = None
@@ -128,7 +122,7 @@ def _onEngineCreated(self) -> None:
128
122
for child in main_window .contentItem ().children ():
129
123
try :
130
124
if not USE_QT5 :
131
- test = child .handleVisibility # With QtQuick Controls 2, ContextMenu is the only item that has a findItemIndex function in the main window root contentitem
125
+ test = child .handleVisibility # With QtQuick Controls 2, ContextMenu is the only item that has a findItemIndex function in the main window root contentitem
132
126
else :
133
127
test = child .findItemIndex # With QtQuick Controls 1, ContextMenu is the only item that has a findItemIndex function
134
128
context_menu = child
@@ -346,7 +340,10 @@ def fixSimpleHolesForMeshes(self) -> None:
346
340
success = tri_node .fill_holes ()
347
341
self ._replaceSceneNode (node , [tri_node ])
348
342
if not success :
349
- self ._message .setText (catalog .i18nc ("@info:status" , "The mesh needs more extensive repair to become watertight" ))
343
+ self ._message .setText (catalog .i18nc (
344
+ "@info:status" ,
345
+ "The mesh needs more extensive repair to become watertight"
346
+ ))
350
347
self ._message .show ()
351
348
352
349
@pyqtSlot ()
0 commit comments