From af890a6270e654247a2b02184b406fc7431293e1 Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Mon, 6 Jun 2005 19:00:02 +0000 Subject: [PATCH] Bart updated his scripts... Fixes: - naming of Transform instead of Shape node X3D exporter: line 431 and 432 VRML exporter: line 430 and 433 - wrong import of modules in the X3D exporter line 72 --- release/scripts/vrml97_export.py | 20 ++++++++------------ release/scripts/x3d_export.py | 17 ++++++++--------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/release/scripts/vrml97_export.py b/release/scripts/vrml97_export.py index 812ea95d5cc..3b7751c5fec 100644 --- a/release/scripts/vrml97_export.py +++ b/release/scripts/vrml97_export.py @@ -11,9 +11,8 @@ Tooltip: 'Export to VRML97 file (.wrl)' __author__ = ("Rick Kimball", "Ken Miller", "Steve Matthews", "Bart") __url__ = ["blender", "elysiun", "Author's (Rick) homepage, http://kimballsoftware.com/blender", -"Author's (Bart) homepage, http://www.neeneenee.de/vrml", -"Complete online documentation, http://www.neeneenee.de/blender/x3d/exporting_web3d.html"] -__version__ = "2005/04/20" +"Author's (Bart) homepage, http://www.neeneenee.de/vrml"] +__version__ = "2005/06/03" __bpydoc__ = """\ This script exports to VRML97 format. @@ -166,7 +165,7 @@ class VRML2Export: self.file.write("# This file was authored with Blender (http://www.blender.org/)\n") self.file.write("# Blender version %s\n" % Blender.Get('version')) self.file.write("# Blender file %s\n" % filename) - self.file.write("# Exported using VRML97 exporter v1.50 (2005/04/20)\n\n") + self.file.write("# Exported using VRML97 exporter v1.50 (2005/06/03)\n\n") def writeInline(self): inlines = Blender.Scene.Get() @@ -428,10 +427,10 @@ class VRML2Export: bTwoSided=0 om = object.getMatrix(); location=self.rotVertex(om, (0,0,0)); - self.writeIndented("Transform {\n",1) + self.writeIndented("DEF %s Transform {\n" % meshName,1) self.writeIndented("translation %s %s %s\n" % (round(location[0],3), round(location[1],3), round(location[2],3)),1) self.writeIndented("children [\n") - self.writeIndented("DEF %s Shape {\n" % meshName,1) + self.writeIndented("Shape {\n",1) maters=mesh.materials hasImageTexture=0 @@ -909,10 +908,7 @@ class VRML2Export: print "Debug: mesh.materials=%d" % len(mesh.materials) def rgbToFS(self, c): - s="%s %s %s" % ( - round(c.r/255.0,self.cp), - round(c.g/255.0,self.cp), - round(c.b/255.0,self.cp)) + s="%s %s %s" % (round(c.r/255.0,self.cp), round(c.g/255.0,self.cp), round(c.b/255.0,self.cp)) return s def computeDirection(self, object): @@ -1026,12 +1022,12 @@ def select_file(filename): def createWRLPath(): filename = Blender.Get('filename') - #print filename + print filename if filename.find('.') != -1: filename = filename.split('.')[0] filename += ".wrl" - #print filename + print filename return filename diff --git a/release/scripts/x3d_export.py b/release/scripts/x3d_export.py index a5de6a7a2da..322af5eac25 100644 --- a/release/scripts/x3d_export.py +++ b/release/scripts/x3d_export.py @@ -9,9 +9,8 @@ Tooltip: 'Export to Extensible 3D file (.x3d)' """ __author__ = ("Bart") -__url__ = ["Author's (Bart) homepage, http://www.neeneenee.de/vrml", -"Complete online documentation, http://www.neeneenee.de/blender/x3d/exporting_web3d.html"] -__version__ = "2005/05/10" +__url__ = ["Author's (Bart) homepage, http://www.neeneenee.de/vrml"] +__version__ = "2005/06/06" @@ -70,7 +69,7 @@ try: except: print "No Python installed, for full features install Python (http://www.python.org/)." pytinst = 0 -import math, sys, datetime +import math #################################### # Global Variables @@ -184,7 +183,7 @@ class VRML2Export: self.file.write("\n") self.file.write("\t\n" % filename) self.file.write("\t\n" % Blender.Get('version')) - self.file.write("\t\n") + self.file.write("\t\n") self.file.write("\n") self.file.write("\n") @@ -429,8 +428,8 @@ class VRML2Export: bTwoSided=0 om = object.getMatrix(); location=self.rotVertex(om, (0,0,0)); - self.writeIndented("\n" % (round(location[0],3), round(location[1],3), round(location[2],3)),1) - self.writeIndented("\n" % meshName,1) + self.writeIndented("\n" % (meshName, round(location[0],3), round(location[1],3), round(location[2],3)),1) + self.writeIndented("\n",1) maters=mesh.materials hasImageTexture=0 @@ -1023,12 +1022,12 @@ def select_file(filename): def createWRLPath(): filename = Blender.Get('filename') - #print filename + print filename if filename.find('.') != -1: filename = filename.split('.')[0] filename += ".x3d" - #print filename + print filename return filename