Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-02-04 08:22:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-02-04 08:22:30 +0300
commitdfd3febce161e76015beb0faac516724aceff453 (patch)
tree6a6b5ea13528413100807c37bb6da0ec1ff6c657 /io_scene_x3d
parenta5a0189a3a178a4427bd953e05629473ae0eb2e3 (diff)
bugfix [#25903] Export to X3D should provide relative path with forward slash for subdirectories in url of ImageTexture
Diffstat (limited to 'io_scene_x3d')
-rw-r--r--io_scene_x3d/export_x3d.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index aae369ed..822065b2 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -591,18 +591,19 @@ class x3d_class:
self.write_indented("<ImageTexture DEF=\"%s\" " % self.cleanStr(name), 1)
filepath = image.filepath
+ relpath = os.path.dirname(self.filepath) # could cache
filepath_full = bpy.path.abspath(filepath)
# collect image paths, can load multiple
- # [relative, absolute, name-only]
+ # [relative, name-only, absolute]
images = []
- if bpy.path.is_subdir(filepath_full, self.filepath):
- images.append(os.path.relpath(filepath_full, self.filepath))
+ if bpy.path.is_subdir(filepath_full, relpath):
+ images.append(os.path.relpath(filepath_full, relpath))
- images.append(filepath_full)
images.append(os.path.basename(filepath_full))
+ images.append(filepath_full)
- self.file.write("url='%s' />" % " ".join(["\"%s\"" % f for f in images]))
+ self.file.write("url='%s' />" % " ".join(["\"%s\"" % f.replace("\\", "/") for f in images]))
self.write_indented("\n", -1)
def writeBackground(self, world, alltextures):