[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34082] trunk/blender/release/scripts/op/ io_scene_x3d/export_x3d.py: pep8 cleanup.

Campbell Barton ideasman42 at gmail.com
Wed Jan 5 04:22:47 CET 2011


Revision: 34082
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34082
Author:   campbellbarton
Date:     2011-01-05 04:22:46 +0100 (Wed, 05 Jan 2011)

Log Message:
-----------
pep8 cleanup.

Modified Paths:
--------------
    trunk/blender/release/scripts/op/io_scene_x3d/export_x3d.py

Modified: trunk/blender/release/scripts/op/io_scene_x3d/export_x3d.py
===================================================================
--- trunk/blender/release/scripts/op/io_scene_x3d/export_x3d.py	2011-01-05 02:08:54 UTC (rev 34081)
+++ trunk/blender/release/scripts/op/io_scene_x3d/export_x3d.py	2011-01-05 03:22:46 UTC (rev 34082)
@@ -41,10 +41,11 @@
 
 from io_utils import create_derived_objects, free_derived_objects
 
-DEG2RAD=0.017453292519943295
+DEG2RAD = 0.017453292519943295
 RAD_90D = -(math.pi / 2.0)
-MATWORLD= mathutils.Matrix.Rotation(RAD_90D, 4, 'X')
+MATWORLD = mathutils.Matrix.Rotation(RAD_90D, 4, 'X')
 
+
 def round_color(col, cp):
     return tuple([round(max(min(c, 1.0), 0.0), cp) for c in col])
 
@@ -61,6 +62,7 @@
 # Functions for writing output file
 ##########################################################
 
+
 class x3d_class:
 
     def __init__(self, filepath):
@@ -73,18 +75,18 @@
         self.halonode = 0
         self.collnode = 0
         self.tilenode = 0
-        self.verbose=2	 # level of verbosity in console 0-none, 1-some, 2-most
-        self.cp=3		  # decimals for material color values	 0.000 - 1.000
-        self.vp=3		  # decimals for vertex coordinate values  0.000 - n.000
-        self.tp=3		  # decimals for texture coordinate values 0.000 - 1.000
-        self.it=3
+        self.verbose = 2	 # level of verbosity in console 0-none, 1-some, 2-most
+        self.cp = 3		  # decimals for material color values	 0.000 - 1.000
+        self.vp = 3		  # decimals for vertex coordinate values  0.000 - n.000
+        self.tp = 3		  # decimals for texture coordinate values 0.000 - 1.000
+        self.it = 3
 
         #--- class private don't touch ---
-        self.texNames={}   # dictionary of textureNames
-        self.matNames={}   # dictionary of materiaNames
-        self.meshNames={}   # dictionary of meshNames
-        self.indentLevel=0 # keeps track of current indenting
-        self.filepath=filepath
+        self.texNames = {}   # dictionary of textureNames
+        self.matNames = {}   # dictionary of materiaNames
+        self.meshNames = {}   # dictionary of meshNames
+        self.indentLevel = 0  # keeps track of current indenting
+        self.filepath = filepath
         self.file = None
         if filepath.lower().endswith('.x3dz'):
             try:
@@ -92,45 +94,45 @@
                 self.file = gzip.open(filepath, "w")
             except:
                 print("failed to import compression modules, exporting uncompressed")
-                self.filepath = filepath[:-1] # remove trailing z
+                self.filepath = filepath[:-1]  # remove trailing z
 
         if self.file is None:
             self.file = open(self.filepath, "w", encoding='utf8')
 
-        self.bNav=0
-        self.nodeID=0
-        self.namesReserved=[ "Anchor","Appearance","Arc2D","ArcClose2D","AudioClip","Background","Billboard",
-                             "BooleanFilter","BooleanSequencer","BooleanToggle","BooleanTrigger","Box","Circle2D",
-                             "Collision","Color","ColorInterpolator","ColorRGBA","component","Cone","connect",
-                             "Contour2D","ContourPolyline2D","Coordinate","CoordinateDouble","CoordinateInterpolator",
-                             "CoordinateInterpolator2D","Cylinder","CylinderSensor","DirectionalLight","Disk2D",
-                             "ElevationGrid","EspduTransform","EXPORT","ExternProtoDeclare","Extrusion","field",
-                             "fieldValue","FillProperties","Fog","FontStyle","GeoCoordinate","GeoElevationGrid",
-                             "GeoLocationLocation","GeoLOD","GeoMetadata","GeoOrigin","GeoPositionInterpolator",
-                             "GeoTouchSensor","GeoViewpoint","Group","HAnimDisplacer","HAnimHumanoid","HAnimJoint",
-                             "HAnimSegment","HAnimSite","head","ImageTexture","IMPORT","IndexedFaceSet",
-                             "IndexedLineSet","IndexedTriangleFanSet","IndexedTriangleSet","IndexedTriangleStripSet",
-                             "Inline","IntegerSequencer","IntegerTrigger","IS","KeySensor","LineProperties","LineSet",
-                             "LoadSensor","LOD","Material","meta","MetadataDouble","MetadataFloat","MetadataInteger",
-                             "MetadataSet","MetadataString","MovieTexture","MultiTexture","MultiTextureCoordinate",
-                             "MultiTextureTransform","NavigationInfo","Normal","NormalInterpolator","NurbsCurve",
-                             "NurbsCurve2D","NurbsOrientationInterpolator","NurbsPatchSurface",
-                             "NurbsPositionInterpolator","NurbsSet","NurbsSurfaceInterpolator","NurbsSweptSurface",
-                             "NurbsSwungSurface","NurbsTextureCoordinate","NurbsTrimmedSurface","OrientationInterpolator",
-                             "PixelTexture","PlaneSensor","PointLight","PointSet","Polyline2D","Polypoint2D",
-                             "PositionInterpolator","PositionInterpolator2D","ProtoBody","ProtoDeclare","ProtoInstance",
-                             "ProtoInterface","ProximitySensor","ReceiverPdu","Rectangle2D","ROUTE","ScalarInterpolator",
-                             "Scene","Script","Shape","SignalPdu","Sound","Sphere","SphereSensor","SpotLight","StaticGroup",
-                             "StringSensor","Switch","Text","TextureBackground","TextureCoordinate","TextureCoordinateGenerator",
-                             "TextureTransform","TimeSensor","TimeTrigger","TouchSensor","Transform","TransmitterPdu",
-                             "TriangleFanSet","TriangleSet","TriangleSet2D","TriangleStripSet","Viewpoint","VisibilitySensor",
-                             "WorldInfo","X3D","XvlShell","VertexShader","FragmentShader","MultiShaderAppearance","ShaderAppearance" ]
-        self.namesStandard=[ "Empty","Empty.000","Empty.001","Empty.002","Empty.003","Empty.004","Empty.005",
-                             "Empty.006","Empty.007","Empty.008","Empty.009","Empty.010","Empty.011","Empty.012",
-                             "Scene.001","Scene.002","Scene.003","Scene.004","Scene.005","Scene.06","Scene.013",
-                             "Scene.006","Scene.007","Scene.008","Scene.009","Scene.010","Scene.011","Scene.012",
-                             "World","World.000","World.001","World.002","World.003","World.004","World.005" ]
-        self.namesFog=[ "","LINEAR","EXPONENTIAL","" ]
+        self.bNav = 0
+        self.nodeID = 0
+        self.namesReserved = ("Anchor", "Appearance", "Arc2D", "ArcClose2D", "AudioClip", "Background", "Billboard",
+                             "BooleanFilter", "BooleanSequencer", "BooleanToggle", "BooleanTrigger", "Box", "Circle2D",
+                             "Collision", "Color", "ColorInterpolator", "ColorRGBA", "component", "Cone", "connect",
+                             "Contour2D", "ContourPolyline2D", "Coordinate", "CoordinateDouble", "CoordinateInterpolator",
+                             "CoordinateInterpolator2D", "Cylinder", "CylinderSensor", "DirectionalLight", "Disk2D",
+                             "ElevationGrid", "EspduTransform", "EXPORT", "ExternProtoDeclare", "Extrusion", "field",
+                             "fieldValue", "FillProperties", "Fog", "FontStyle", "GeoCoordinate", "GeoElevationGrid",
+                             "GeoLocationLocation", "GeoLOD", "GeoMetadata", "GeoOrigin", "GeoPositionInterpolator",
+                             "GeoTouchSensor", "GeoViewpoint", "Group", "HAnimDisplacer", "HAnimHumanoid", "HAnimJoint",
+                             "HAnimSegment", "HAnimSite", "head", "ImageTexture", "IMPORT", "IndexedFaceSet",
+                             "IndexedLineSet", "IndexedTriangleFanSet", "IndexedTriangleSet", "IndexedTriangleStripSet",
+                             "Inline", "IntegerSequencer", "IntegerTrigger", "IS", "KeySensor", "LineProperties", "LineSet",
+                             "LoadSensor", "LOD", "Material", "meta", "MetadataDouble", "MetadataFloat", "MetadataInteger",
+                             "MetadataSet", "MetadataString", "MovieTexture", "MultiTexture", "MultiTextureCoordinate",
+                             "MultiTextureTransform", "NavigationInfo", "Normal", "NormalInterpolator", "NurbsCurve",
+                             "NurbsCurve2D", "NurbsOrientationInterpolator", "NurbsPatchSurface",
+                             "NurbsPositionInterpolator", "NurbsSet", "NurbsSurfaceInterpolator", "NurbsSweptSurface",
+                             "NurbsSwungSurface", "NurbsTextureCoordinate", "NurbsTrimmedSurface", "OrientationInterpolator",
+                             "PixelTexture", "PlaneSensor", "PointLight", "PointSet", "Polyline2D", "Polypoint2D",
+                             "PositionInterpolator", "PositionInterpolator2D", "ProtoBody", "ProtoDeclare", "ProtoInstance",
+                             "ProtoInterface", "ProximitySensor", "ReceiverPdu", "Rectangle2D", "ROUTE", "ScalarInterpolator",
+                             "Scene", "Script", "Shape", "SignalPdu", "Sound", "Sphere", "SphereSensor", "SpotLight", "StaticGroup",
+                             "StringSensor", "Switch", "Text", "TextureBackground", "TextureCoordinate", "TextureCoordinateGenerator",
+                             "TextureTransform", "TimeSensor", "TimeTrigger", "TouchSensor", "Transform", "TransmitterPdu",
+                             "TriangleFanSet", "TriangleSet", "TriangleSet2D", "TriangleStripSet", "Viewpoint", "VisibilitySensor",
+                             "WorldInfo", "X3D", "XvlShell", "VertexShader", "FragmentShader", "MultiShaderAppearance", "ShaderAppearance")
+        self.namesStandard = ("Empty", "Empty.000", "Empty.001", "Empty.002", "Empty.003", "Empty.004", "Empty.005",
+                             "Empty.006", "Empty.007", "Empty.008", "Empty.009", "Empty.010", "Empty.011", "Empty.012",
+                             "Scene.001", "Scene.002", "Scene.003", "Scene.004", "Scene.005", "Scene.06", "Scene.013",
+                             "Scene.006", "Scene.007", "Scene.008", "Scene.009", "Scene.010", "Scene.011", "Scene.012",
+                             "World", "World.000", "World.001", "World.002", "World.003", "World.004", "World.005")

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list