improved relative path handling for textures #3365

now we're going to store all texture paths in .ifc as posix to keep them working if .ifc moved from one platform to another

previously it was saving all paths as absolute
This commit is contained in:
Andrej730
2023-06-30 17:57:23 +05:00
parent bfcc8decc0
commit 49abaf6798
4 changed files with 36 additions and 11 deletions
@@ -130,12 +130,14 @@ class Usecase:
return self.create_surface_texture(links[0].from_node, "DIFFUSE")
def create_surface_texture(self, node, mode):
import blenderbim.tool as tool
texture = self.file.create_entity(
"IfcImageTexture",
RepeatS=node.extension == "REPEAT",
RepeatT=node.extension == "REPEAT",
Mode=mode,
URLReference=node.image.filepath,
URLReference=tool.Blender.blender_path_to_posix(node.image.filepath),
)
self.textures.append(texture)
self.process_texture_coordinates(node, texture)