Skip to content

Commit

Permalink
Update model.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hisprofile authored Jun 13, 2024
1 parent f7c08b2 commit 03b703b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions plumber/asset/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,12 @@ def import_model(self, model: Model, collection: Collection) -> None:
if material is None:
material_data = get_unknown_material()
else:
material_original_name = material
material = truncate_name(material)
material_data = bpy.data.materials.get(material)
if material_data is None:
material_data = bpy.data.materials.new(material)
material_data['path_id'] = material_original_name
bl_materials.append(material_data)

meshes = model.meshes()
Expand Down Expand Up @@ -159,6 +161,8 @@ def import_mesh(
mesh_data.clear_geometry()
mesh_data.materials.clear()

mesh_data['path_id'] = mesh_name

polygons_len = mesh.polygons_len()

vertices = mesh.vertices()
Expand Down

0 comments on commit 03b703b

Please sign in to comment.