mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
Loading texture maps - fallback to absolute paths
If it's not possible to get relative path, fallback to absolute path and show an info message.
This commit is contained in:
@@ -538,7 +538,12 @@ class ChooseTextureMapPath(bpy.types.Operator):
|
|||||||
|
|
||||||
abs_path = Path(self.filepath)
|
abs_path = Path(self.filepath)
|
||||||
if self.use_relative_path:
|
if self.use_relative_path:
|
||||||
image_filepath = abs_path.relative_to(Path(tool.Ifc.get_path()).parent)
|
parent = Path(tool.Ifc.get_path()).parent
|
||||||
|
if abs_path.is_relative_to(parent):
|
||||||
|
image_filepath = abs_path.relative_to(parent)
|
||||||
|
else:
|
||||||
|
self.report({"INFO"}, "Path is not relative to the .ifc file, it will be saved as absolute.")
|
||||||
|
image_filepath = abs_path
|
||||||
else:
|
else:
|
||||||
image_filepath = abs_path
|
image_filepath = abs_path
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user