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:
Diffstat (limited to 'io_scene_x3d/export_x3d.py')
-rw-r--r--io_scene_x3d/export_x3d.py16
1 files changed, 5 insertions, 11 deletions
diff --git a/io_scene_x3d/export_x3d.py b/io_scene_x3d/export_x3d.py
index 111814e3..d599db75 100644
--- a/io_scene_x3d/export_x3d.py
+++ b/io_scene_x3d/export_x3d.py
@@ -640,18 +640,11 @@ class x3d_class:
self.file.write("skyColor=\"%.3f %.3f %.3f\" " % sky_triple)
for tex in bpy.data.textures:
- if tex.type != 'IMAGE' or tex.image is None:
- continue
-
- namemat = tex.name
- # namemat = alltextures[i].name
-
- pic = tex.image
+ if tex.type == 'IMAGE' and tex.image:
+ namemat = tex.name
+ pic = tex.image
+ basename = os.path.basename(bpy.path.abspath(pic.filepath))
- # using .expandpath just in case, os.path may not expect //
- basename = os.path.basename(bpy.path.abspath(pic.filepath))
-
- if pic:
if namemat == "back":
self.file.write("\n\tbackUrl=\"%s\" " % basename)
elif namemat == "bottom":
@@ -664,6 +657,7 @@ class x3d_class:
self.write_indented("rightUrl=\"%s\" " % basename)
elif namemat == "top":
self.write_indented("topUrl=\"%s\" " % basename)
+
self.write_indented("/>\n\n")
##########################################################