diff options
author | Ghostkeeper <rubend@tutanota.com> | 2019-08-29 17:22:18 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2019-08-29 17:22:18 +0300 |
commit | b734d34af3e548ffdf86deb49f5bfd9bf1b56c38 (patch) | |
tree | d187c85bfc663849c8eec65b058a1fc568fa8f0e /plugins/TrimeshReader | |
parent | 5f94657d2ce3b49eb64f667fe58f767ab66cc1f9 (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.py | 6 |
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 |