mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-03 00:50:39 +08:00
CURA-4839 Create variable before asignment
This commit is contained in:
parent
b92ebadfd0
commit
fe6019988c
@ -704,6 +704,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
|
|
||||||
# load extruder stack files
|
# load extruder stack files
|
||||||
has_extruder_stack_files = len(extruder_stack_files) > 0
|
has_extruder_stack_files = len(extruder_stack_files) > 0
|
||||||
|
empty_quality_container = self._container_registry.findInstanceContainers(id = "empty_quality")[0]
|
||||||
|
empty_quality_changes_container = self._container_registry.findInstanceContainers(id = "empty_quality_changes")[0]
|
||||||
try:
|
try:
|
||||||
for extruder_stack_file in extruder_stack_files:
|
for extruder_stack_file in extruder_stack_files:
|
||||||
container_id = self._stripFileToId(extruder_stack_file)
|
container_id = self._stripFileToId(extruder_stack_file)
|
||||||
@ -779,7 +781,6 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
self._container_registry.removeContainer(container.getId())
|
self._container_registry.removeContainer(container.getId())
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
# Check quality profiles to make sure that if one stack has the "not supported" quality profile,
|
# Check quality profiles to make sure that if one stack has the "not supported" quality profile,
|
||||||
# all others should have the same.
|
# all others should have the same.
|
||||||
#
|
#
|
||||||
@ -811,17 +812,12 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
quality_has_been_changed = False
|
quality_has_been_changed = False
|
||||||
|
|
||||||
if has_not_supported:
|
if has_not_supported:
|
||||||
empty_quality_container = self._container_registry.findInstanceContainers(id = "empty_quality")[0]
|
|
||||||
for stack in [global_stack] + extruder_stacks_in_use:
|
for stack in [global_stack] + extruder_stacks_in_use:
|
||||||
stack.replaceContainer(_ContainerIndexes.Quality, empty_quality_container)
|
stack.replaceContainer(_ContainerIndexes.Quality, empty_quality_container)
|
||||||
empty_quality_changes_container = self._container_registry.findInstanceContainers(id = "empty_quality_changes")[0]
|
|
||||||
for stack in [global_stack] + extruder_stacks_in_use:
|
|
||||||
stack.replaceContainer(_ContainerIndexes.QualityChanges, empty_quality_changes_container)
|
stack.replaceContainer(_ContainerIndexes.QualityChanges, empty_quality_changes_container)
|
||||||
quality_has_been_changed = True
|
quality_has_been_changed = True
|
||||||
|
|
||||||
else:
|
else:
|
||||||
empty_quality_changes_container = self._container_registry.findInstanceContainers(id="empty_quality_changes")[0]
|
|
||||||
|
|
||||||
# The machine in the project has non-empty quality and there are usable qualities for this machine.
|
# The machine in the project has non-empty quality and there are usable qualities for this machine.
|
||||||
# We need to check if the current quality_type is still usable for this machine, if not, then the quality
|
# We need to check if the current quality_type is still usable for this machine, if not, then the quality
|
||||||
# will be reset to the "preferred quality" if present, otherwise "normal".
|
# will be reset to the "preferred quality" if present, otherwise "normal".
|
||||||
|
Loading…
x
Reference in New Issue
Block a user