pyslapi icon indicating copy to clipboard operation
pyslapi copied to clipboard

Import SKP error (line 29 __init__.py | Key Error) [Semi Solved]

Open BrunoRobim opened this issue 2 years ago • 0 comments

Describe the bug [Temporarily Solved]

Importing a SKP 2023 file in Blender 4.0.2 results in an error that just the camera comes up. But this will occur only if you have a wooden slat in your scene.

To Reproduce Steps to reproduce the behavior:

  1. Go to ' File -> Import -> "Import SketchUp Scene (.skp)" '
  2. Choose you file .skp
  3. In the error Logger:
Python: Traceback (most recent call last):
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\__init__.py", line 889, in execute
    return SceneImporter().set_filename(keywords['filepath']).load(
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\__init__.py", line 184, in load
    self.write_duplicateable_groups()
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\__init__.py", line 208, in write_duplicateable_groups
    component_stats = self.analyze_entities(
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\__init__.py", line 265, in analyze_entities
    self.analyze_entities(group.entities,
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\__init__.py", line 265, in analyze_entities
    self.analyze_entities(group.entities,
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\__init__.py", line 277, in analyze_entities
    cdef = self.skp_components[instance.definition.name]
  File "C:\Program Files\Blender Foundation\Blender 4.0\4.0\scripts\addons\sketchup_importer\SKPutil\__init__.py", line 29, in __getitem__
    return dict.__getitem__(self, key)
KeyError: 'Agrupar#45'

Expected behavior When imported the file comes with all the scene, not just the camera.

Screenshots

ErrorLogger

Screenshot 2024-01-08 165109

SKP File

Screenshot 2024-01-08 165320

Bug Trigger

1

System Info

  • Operating System: windows 11 LTS
  • Blender Version: 4.0.2
  • SketchUp Version: 2023 Pro
  • Importer Versions:
    • Latest
    • 0.23.1

Additional context

  1. Since the line29 in the __init__.py file is getting the props to create a Dict, the problem is, in my guess, with something related to a unique ID, reference or something like that to the components , groups, obj from SKP. A purge in those statistics could be a solution. Remembering I'm not familiar with the SKP or Blender API , I'm just trying to help someone with the same error.

  2. The fast solution is to use a grouped wooden slat unless a extruded one.

BrunoRobim avatar Jan 08 '24 20:01 BrunoRobim