Basically the 3dmodel.model file contains references to components defined in other model files. So when it tries to build the build/items the script can't find the sub components in resource_objects and logs the error Build item with unknown resource ID. Sub components are loaded in resource_objects later on but never converted to actual Blender objects.
This fix loads all the models in the 3mf file in resource_objects and then creates all the Blender objects. This assumes all the object IDs are unique and I don't know if that's actually the case.
The automated code style check is complaining that there's whitespace characters on an empty line at line 146 of import_3mf.py. I'll fix that up for you if/when merging, it's a really minor thing.
This is to fix an issue with some 3mf files generated by Bambu Studio as described in https://github.com/Ghostkeeper/Blender3mfFormat/issues/69
Basically the
3dmodel.model
file contains references to components defined in other model files. So when it tries to build the build/items the script can't find the sub components inresource_objects
and logs the errorBuild item with unknown resource ID
. Sub components are loaded inresource_objects
later on but never converted to actual Blender objects.This fix loads all the models in the 3mf file in
resource_objects
and then creates all the Blender objects. This assumes all the object IDs are unique and I don't know if that's actually the case.This was tested with the 3mf file here: https://makerworld.com/en/models/20200#profileId-20736
Before the fix:
After the fix: