For a texture, write out the Image.filename instead of Image.name.
authorChris Want <cwant@ualberta.ca>
Mon, 18 Jun 2007 20:03:23 +0000 (20:03 +0000)
committerChris Want <cwant@ualberta.ca>
Mon, 18 Jun 2007 20:03:23 +0000 (20:03 +0000)
release/scripts/vrml97_export.py

index b5afacbe272b15c187ff075d221af23d37afb29a..57ffd243bfc0b69990a62943be247babfe5bff5b 100644 (file)
@@ -656,10 +656,10 @@ class VRML2Export:
                        self.writeMaterial(mater, self.cleanStr(mater.name,''))
                        if (mater.mode & Blender.Material.Modes['TEXFACE']):
                                if image != None:
-                                       self.writeImageTexture(image.name)
+                                       self.writeImageTexture(image.name, image.filename)
                else:
                        if image != None:
-                               self.writeImageTexture(image.name)
+                               self.writeImageTexture(image.name, image.filename)
 
                self.writeIndented("}\n", -1)
 
@@ -837,7 +837,7 @@ class VRML2Export:
                self.writeIndented("transparency %s\n" % (round(transp,self.cp)))
                self.writeIndented("}\n",-1)
 
-       def writeImageTexture(self, name):
+       def writeImageTexture(self, name, filename):
                if self.texNames.has_key(name):
                        self.writeIndented("texture USE %s\n" % self.cleanStr(name))
                        self.texNames[name] += 1
@@ -846,7 +846,7 @@ class VRML2Export:
                        self.writeIndented("texture DEF %s ImageTexture {\n" % \
                                                           self.cleanStr(name), 1)
                        self.writeIndented('url "%s"\n' % \
-                                                          name.split("\\")[-1].split("/")[-1])
+                                                          filename.split("\\")[-1].split("/")[-1])
                        self.writeIndented("}\n",-1)
                        self.texNames[name] = 1