Skip to content

Commit

Permalink
fix(obj): Only write the mtllib reference when requested
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswmackey authored and Chris Mackey committed Jan 12, 2024
1 parent 9522ffd commit 97e8190
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ladybug_geometry/interop/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,8 @@ def to_file(self, folder, name, triangulate_quads=False, include_mtl=False):

# add material file name if include_mtl is true
if self._material_structure is not None or include_mtl:
outfile.write('mtllib ' + mtl_file + '\n')
if include_mtl:
outfile.write('mtllib ' + mtl_file + '\n')
if self._material_structure is None:
outfile.write('usemtl diffuse_0\n')

Expand Down
1 change: 0 additions & 1 deletion tests/obj/two_material_cubes_edit.obj
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Rhino

mtllib two_material_cubes.mtl
v 10 0 -20
v 10 10 -20
v 10 0 -10
Expand Down

0 comments on commit 97e8190

Please sign in to comment.