Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2019-08-29 17:22:18 +0300
committerGhostkeeper <rubend@tutanota.com>2019-08-29 17:22:18 +0300
commitb734d34af3e548ffdf86deb49f5bfd9bf1b56c38 (patch)
treed187c85bfc663849c8eec65b058a1fc568fa8f0e /plugins/TrimeshReader
parent5f94657d2ce3b49eb64f667fe58f767ab66cc1f9 (diff)
Add typing for lists that it can't auto-detect
Contributes to issue CURA-6739.
Diffstat (limited to 'plugins/TrimeshReader')
-rw-r--r--plugins/TrimeshReader/TrimeshReader.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/TrimeshReader/TrimeshReader.py b/plugins/TrimeshReader/TrimeshReader.py
index d1e4b73962..41992ddbd1 100644
--- a/plugins/TrimeshReader/TrimeshReader.py
+++ b/plugins/TrimeshReader/TrimeshReader.py
@@ -3,7 +3,7 @@
# The _toMeshData function is taken from the AMFReader class which was built by fieldOfView.
-from typing import List, Union, TYPE_CHECKING
+from typing import Any, List, Union, TYPE_CHECKING
import numpy # To create the mesh data.
import os.path # To create the mesh name for the resulting mesh.
import trimesh # To load the files into a Trimesh.
@@ -85,14 +85,14 @@ class TrimeshReader(MeshReader):
# \return A scene node that contains the file's contents.
def _read(self, file_name: str) -> Union["SceneNode", List["SceneNode"]]:
mesh_or_scene = trimesh.load(file_name)
- meshes = []
+ meshes = [] # type: List[Union[trimesh.Trimesh, trimesh.Scene, Any]]
if isinstance(mesh_or_scene, trimesh.Trimesh):
meshes = [mesh_or_scene]
elif isinstance(mesh_or_scene, trimesh.Scene):
meshes = [mesh for mesh in mesh_or_scene.geometry.values()]
active_build_plate = CuraApplication.getInstance().getMultiBuildPlateModel().activeBuildPlate
- nodes = []
+ nodes = [] # type: List[SceneNode]
for mesh in meshes:
if not isinstance(mesh, trimesh.Trimesh): # Trimesh can also receive point clouds, 2D paths, 3D paths or metadata. Skip those.
continue