cityjson / Up3date

A Blender add-on to import, edit and export 3D city models encoded in CityJSON v.1.0 format preserving geometries, attributes and semantics
MIT License
66 stars 12 forks source link

Investigate into why when creating a new material for a newly added object the exporter can't find it #11

Closed konmast3r closed 3 years ago

tjukanovt commented 2 years ago

How was this solved? I can't seem to get even the most basic export functionality to work (i.e. exporting the default cube as CityJSON). I have the same issue as here: https://blenderartists.org/t/export-to-json/1327958

So I face the following error:

Python: Traceback (most recent call last):
  File "---\Blender\2.93\scripts\addons\Up3date-main\__init__.py", line 124, in execute
    return exporter.execute()
  File "---\Blender\2.93\scripts\addons\Up3date-main\core\objects.py", line 365, in execute
    cj_next_index = self.export_geometry_and_semantics(city_object,init_json,CityObject_id,object_faces,
  File "---\Blender\2.93\scripts\addons\Up3date-main\core\objects.py", line 293, in export_geometry_and_semantics
    semantic_surfaces = store_semantic_surfaces(init_json, city_object, index, CityObject_id)
  File "---\Blender\2.93\scripts\addons\Up3date-main\core\utils.py", line 192, in store_semantic_surfaces
    semantics['surfaces'].append({'type': material['type']})
KeyError: 'bpy_struct[key]: key "type" not found'

location: <unknown location>:-1