mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 10:51:13 +00:00
Avoid duplicate image datablocks when loading textures
This commit is contained in:
@@ -315,7 +315,7 @@ class Loader(bonsai.core.tool.Loader):
|
|||||||
image_url = str(image_url)
|
image_url = str(image_url)
|
||||||
if is_relative and bpy.data.filepath:
|
if is_relative and bpy.data.filepath:
|
||||||
image_url = bpy.path.relpath(image_url)
|
image_url = bpy.path.relpath(image_url)
|
||||||
return bpy.data.images.load(image_url)
|
return bpy.data.images.load(image_url, check_existing=True)
|
||||||
|
|
||||||
elif texture["type"] == "IfcBlobTexture":
|
elif texture["type"] == "IfcBlobTexture":
|
||||||
# https://blender.stackexchange.com/questions/173206/how-to-efficiently-convert-a-pil-image-to-bpy-types-image
|
# https://blender.stackexchange.com/questions/173206/how-to-efficiently-convert-a-pil-image-to-bpy-types-image
|
||||||
|
|||||||
Reference in New Issue
Block a user