From 2c236d3c8124959434f73f6c93ddc8fe6d13292f Mon Sep 17 00:00:00 2001
From: Campbell Barton <ideasman42@gmail.com>
Date: Tue, 12 Mar 2013 14:17:13 +0000
Subject: [PATCH] don't write absolute paths when writing relative vrml or x3d

---
 io_scene_vrml2/export_vrml2.py | 4 +++-
 io_scene_x3d/export_x3d.py     | 3 ++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/io_scene_vrml2/export_vrml2.py b/io_scene_vrml2/export_vrml2.py
index 03deeb2ab..7b77cc08d 100644
--- a/io_scene_vrml2/export_vrml2.py
+++ b/io_scene_vrml2/export_vrml2.py
@@ -43,8 +43,10 @@ def save_bmesh(fw, bm,
         images = [
             filepath_ref,
             filepath_base,
-            filepath_full,
         ]
+        if path_mode != 'RELATIVE':
+            images.append(filepath_full)
+
         fw('\t\t\turl [ %s ]\n' % " ".join(['"%s"' % f for f in images]) )
         del images
         del filepath_ref, filepath_base, filepath_full, filepath
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index d40c4dde3..0b3250441 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -1302,8 +1302,9 @@ def export(file,
             images = [
                 filepath_ref,
                 filepath_base,
-                filepath_full,
             ]
+            if path_mode != 'RELATIVE':
+                images.append(filepath_full)
 
             images = [f.replace('\\', '/') for f in images]
             images = [f for i, f in enumerate(images) if f not in images[:i]]
-- 
GitLab