From 8b339cdad2a63d5f409e794357c939d2e9297763 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 May 2011 16:22:26 +0000 Subject: another small cleanup. --- io_scene_x3d/export_x3d.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'io_scene_x3d') 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") ########################################################## -- cgit v1.2.3