Application version
(The version of the application this issue occurs with.)
Platform
(Information about the operating system the issue occurs on. Include at least the operating system. In the case of visual glitches/issues, also include information about your graphics drivers and GPU.)
Printer
(Which printer was selected in Cura? If possible, please attach project file as .curaproject.3mf.zip.)
Reproduction steps
Actual results
(What happens after the above steps have been followed.)
Expected results
(What should happen after the above steps have been followed.)
Additional information
(Extra information relevant to the issue, like screenshots. Don't forget to attach the log files with this issue report.)
Loading an old project using the current master branches I see the following:
2019-10-29 13:27:49,330 - ERROR - [MainThread] UM.Logger.logException [85]: Exception: Could not check file file:///home/markb/smartavionics/projects/tip_led/case/KMMB_tip_led_
case_top.3mf
2019-10-29 13:27:49,332 - ERROR - [MainThread] UM.Logger.logException [89]: Traceback (most recent call last):
2019-10-29 13:27:49,333 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/python3/dist-packages/cura/CuraApplication.py", line 1797, in checkIsValidProj
ectFile
2019-10-29 13:27:49,333 - ERROR - [MainThread] UM.Logger.logException [89]: result = workspace_reader.preRead(file_path, show_dialog=False)
2019-10-29 13:27:49,333 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/cura/plugins/3MFReader/ThreeMFWorkspaceReader.py", line 386, in preRead
2019-10-29 13:27:49,333 - ERROR - [MainThread] UM.Logger.logException [89]: quality_type = instance_container_info_dict[quality_container_id].parser["metadata"]["quality_ty
pe"]
2019-10-29 13:27:49,334 - ERROR - [MainThread] UM.Logger.logException [89]: KeyError: 'base_global_super'
If I make the following patch, it loads OK and appears to slice normally.
```
diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py
index dd35484c3..a08250de1 100755
--- a/plugins/3MFReader/ThreeMFWorkspaceReader.py
+++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py
@@ -383,7 +383,10 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
quality_container_id = parser["containers"][str(_ContainerIndexes.Quality)]
quality_type = "empty_quality"
if quality_container_id not in ("empty", "empty_quality"):
- quality_type = instance_container_info_dict[quality_container_id].parser["metadata"]["quality_type"]
+ try:
+ quality_type = instance_container_info_dict[quality_container_id].parser["metadata"]["quality_type"]
+ except KeyError:
+ Logger.log("w", "Unknown quality container id %s.", quality_container_id)
# Get machine info
serialized = archive.open(global_stack_file).read().decode("utf-8")
````
What's wrong here? the key it doesn't recognise (base_global_super), doesn't seem to feature in the cura sources.
Some context: We've refactored a lot for the whole 'intents' story. (Mostly this involved refactoring code that should be refactored anyway, but that had become work that was really necessary in order to get 'intents' in there.)
Anyway:
The key 'base_global_super' is not in the current source, but it might have perhaps been in the source at one point (or perhaps you did a more exhaustive search than implied)?
The .3mf format is mostly just a renamed zip, we can extract the version it was saved with if we look in the file and see if that key _was_ in the source at that point.
In any case, thanks for noticing. We'll probably end up merging the patch you showed here or something similar.
I did search everywhere for that key and it appears almost nowhere even looklng back into the past so it's a real mystery to me as to where it has come from. Could it be that the key was (is?) made by combining separate words and so the symbol base_global_super doesn't appear anywhere?
That profile is still in our current source, actually. Here it is: https://github.com/Ultimaker/Cura/blob/master/resources/quality/creality/base/base_global_super.inst.cfg
It was added in 4.2.
Not sure why it wouldn't be a valid quality ID.
Maybe we can tell if we have that project file?
Interesting, because I have never used that profile and the .3mf project files that have an issue loading don't contain that identifier.
Here's the project file.
It reproduces with that project file. Initial investigation points fingers at the version upgrade there. It looks like this bit of code in the 4.1 -> 4.2 version upgrade has put that profile in your stack as the quality slot:
So this would've been a problem as well in Cura 4.2 and 4.3, loading that project file. Fairly dangerous to put that profile there. I think the if statements there need to be more careful to only adjust Creality stacks, the same checks as with the variants in the lines above it.
It could be that I haven't actually loaded that project file for some time so the problem could well have reared its head earlier.
Probably the result of that is that for some people using printers without printer-specific profiles, they will have used that Super base profile for Creality and thus would've gotten the wrong wall thickness and skin thickness.
Derp, I mistagged an issue, sorry!
Yup, https://github.com/Ultimaker/Cura/commit/41d1ef5f932144511fd6517fc6126b80c45c3261 doesn't fix this issue!
@smartavionics Could you check now? I've added a fix in aa5b788b5923b8b3d884d75d88022f28dbb78ba3
Just looked at that commit but don't you need to indent the line following the lines you just added? I'm not very used to Python so maybe that's OK.
Hmm, thought as much, please try again...
2019-11-04 11:53:50,851 - WARNING - [MainThread] UM.PluginRegistry._populateMetaData [606]: Could not find plugin VersionUpgrade41to42
2019-11-04 11:53:50,854 - ERROR - [MainThread] UM.Logger.logException [85]: Exception: Import error loading module VersionUpgrade41to42
2019-11-04 11:53:50,855 - ERROR - [MainThread] UM.Logger.logException [89]: Traceback (most recent call last):
2019-11-04 11:53:50,855 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/python3/dist-packages/UM/PluginRegistry.py", line 531, in _findPlugin
2019-11-04 11:53:50,855 - ERROR - [MainThread] UM.Logger.logException [89]: module = imp.load_module(plugin_id, file, path, desc) #type: ignore #MyPy gets the wrong output type from imp.find_module for some reason.
2019-11-04 11:53:50,855 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/python3.5/imp.py", line 245, in load_module
2019-11-04 11:53:50,855 - ERROR - [MainThread] UM.Logger.logException [89]: return load_package(name, filename)
2019-11-04 11:53:50,855 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/python3.5/imp.py", line 217, in load_package
2019-11-04 11:53:50,856 - ERROR - [MainThread] UM.Logger.logException [89]: return _load(spec)
2019-11-04 11:53:50,856 - ERROR - [MainThread] UM.Logger.logException [89]: File "<frozen importlib._bootstrap>", line 693, in _load
2019-11-04 11:53:50,856 - ERROR - [MainThread] UM.Logger.logException [89]: File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
2019-11-04 11:53:50,856 - ERROR - [MainThread] UM.Logger.logException [89]: File "<frozen importlib._bootstrap_external>", line 697, in exec_module
2019-11-04 11:53:50,856 - ERROR - [MainThread] UM.Logger.logException [89]: File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
2019-11-04 11:53:50,857 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/cura/plugins/VersionUpgrade/VersionUpgrade41to42/__init__.py", line 6, in <module>
2019-11-04 11:53:50,857 - ERROR - [MainThread] UM.Logger.logException [89]: from . import VersionUpgrade41to42
2019-11-04 11:53:50,857 - ERROR - [MainThread] UM.Logger.logException [89]: File "/opt/cura/lib/cura/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py", line 330
2019-11-04 11:53:50,857 - ERROR - [MainThread] UM.Logger.logException [89]: parser["containers"]["2"] = _creality_quality_per_material[material_id][old_quality_id]
2019-11-04 11:53:50,857 - ERROR - [MainThread] UM.Logger.logException [89]: ^
2019-11-04 11:53:50,857 - ERROR - [MainThread] UM.Logger.logException [89]: IndentationError: expected an indented block
Ugh. Today is not my day :( I accidentally pressed the unindent. Anyhow, I fixed it.
That's better, this issue looks to be fixed now. Thanks.
Most helpful comment
Just looked at that commit but don't you need to indent the line following the lines you just added? I'm not very used to Python so maybe that's OK.