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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2008-01-20 00:52:09 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-01-20 00:52:09 +0300
commite3b202d0b935d991f055a4db9f03419f3bfdd59f (patch)
tree9cfefaaa46dfcbcf6c4f6001c0647790d732ad25 /release
parent231840a99f19cd2a08448e6417890bf40e2e4bb0 (diff)
minor changes to address bugs
[#8109] Incorrect header information in exported X3D Files [#8110] Illegal characters in exported X3D files
Diffstat (limited to 'release')
-rw-r--r--release/scripts/x3d_export.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/release/scripts/x3d_export.py b/release/scripts/x3d_export.py
index 36359f1d122..bf9610fee04 100644
--- a/release/scripts/x3d_export.py
+++ b/release/scripts/x3d_export.py
@@ -162,8 +162,10 @@ class VRML2Export:
##########################################################
def writeHeader(self):
- bfile = sys.expandpath(Blender.Get('filename'))
+ #bfile = sys.expandpath( Blender.Get('filename') ).replace('<', '&lt').replace('>', '&gt')
+ bfile = self.filename.replace('<', '&lt').replace('>', '&gt') # use outfile name
self.file.write("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n")
+ print "fooe"
self.file.write("<!DOCTYPE X3D PUBLIC \"ISO//Web3D//DTD X3D 3.0//EN\" \"http://www.web3d.org/specifications/x3d-3.0.dtd\">\n")
self.file.write("<X3D version=\"3.0\" profile=\"Immersive\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema-instance\" xsd:noNamespaceSchemaLocation=\"http://www.web3d.org/specifications/x3d-3.0.xsd\">\n")
self.file.write("<head>\n")
@@ -256,7 +258,7 @@ class VRML2Export:
headlight = "FALSE"
self.file.write("<NavigationInfo headlight=\"%s\" " % headlight)
self.file.write("visibilityLimit=\"%s\" " % (round(vislimit,self.cp)))
- self.file.write("type=\"EXAMINE, ANY\" avatarSize=\"0.25, 1.75, 0.75\" />\n\n")
+ self.file.write("type=\"EXAMINE\", \"ANY\" avatarSize=\"0.25, 1.75, 0.75\" />\n\n")
def writeSpotLight(self, ob, lamp):
safeName = self.cleanStr(ob.name)
@@ -404,7 +406,7 @@ class VRML2Export:
self.writeIndented("<Appearance>\n", 1)
# right now this script can only handle a single material per mesh.
if len(maters) >= 1:
- mat=Blender.Material.Get(maters[0].name)
+ mat=maters[0]
matFlags = mat.getMode()
if not matFlags & Blender.Material.Modes['TEXFACE']:
self.writeMaterial(mat, self.cleanStr(maters[0].name,''))
@@ -452,6 +454,7 @@ class VRML2Export:
for face in mesh.faces:
if face.smooth:
issmooth=1
+ break
if issmooth==1 and self.wire == 0:
creaseAngle=(mesh.getMaxSmoothAngle())*(math.pi/180.0)
self.file.write("creaseAngle=\"%s\" " % (round(creaseAngle,self.cp)))