Skip to content

Commit

Permalink
Also add map_Kd to the OBJ/MTL material kwargs
Browse files Browse the repository at this point in the history
While all the other key/values for the MTL material are provided directly on top of Trimesh's interpretation for SimpleMaterial, then accessible through material.kwargs which is useful for custom handling of the materials, map_Kd isn't.
I've had a need for getting the map_Kd file path directly instead of the already loaded PIL.Image.
  • Loading branch information
ChuangTseu authored Dec 17, 2024
1 parent 2fcb2b2 commit 9b51b6a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions trimesh/exchange/obj.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ def parse_mtl(mtl, resolver=None):
# load the bytes into a PIL image
# an image file name
material["image"] = Image.open(util.wrap_as_stream(file_data))
# also store the original map_kd file name
material[key] = file_name
except BaseException:
log.debug("failed to load image", exc_info=True)

Expand Down

0 comments on commit 9b51b6a

Please sign in to comment.