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:
authorRemco Burema <r.burema@ultimaker.com>2021-11-16 14:33:29 +0300
committerRemco Burema <r.burema@ultimaker.com>2021-11-16 14:33:29 +0300
commitf0cb9dd39ef996225ebd6d7b8d5ffc986c90e2f0 (patch)
treeb1b794de5bd1df845f80500a854c51503a9abfe2 /plugins/SimulationView
parent5e60cc6208c16d966505e7a97d9bbbb0644d2716 (diff)
Workaround for if layer is None somehow.
Diffstat (limited to 'plugins/SimulationView')
-rw-r--r--plugins/SimulationView/SimulationPass.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/SimulationView/SimulationPass.py b/plugins/SimulationView/SimulationPass.py
index 86cf643e08..495feb6fd3 100644
--- a/plugins/SimulationView/SimulationPass.py
+++ b/plugins/SimulationView/SimulationPass.py
@@ -172,7 +172,8 @@ class SimulationPass(RenderPass):
# where a type-chage occurs. However, the shader expects vertices to have only one type. In order to
# fix this, those vertices are duplicated. This introduces a discrepancy that we have to take into
# account, which is done by the type-change-count.
- type_change_count = layer_data.getLayer(self._layer_view._current_layer_num).lineMeshCumulativeTypeChangeCount(max(self._layer_view._current_path_num - 1, 0))
+ layer = layer_data.getLayer(self._layer_view._current_layer_num)
+ type_change_count = 0 if layer is None else layer.lineMeshCumulativeTypeChangeCount(max(self._layer_view._current_path_num - 1, 0))
current_layer_start = end
current_layer_end = current_layer_start + self._layer_view._current_path_num + current_polygon_offset + type_change_count