[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3595] trunk/py/scripts/addons/ io_scene_3ds/export_3ds.py: 3ds export addon: fixed comments to not interfere with string-literals, reported by IRIE Shinsuke via mailing list

Sebastian Nell codemanx at gmx.de
Sun Jul 8 14:37:53 CEST 2012


Revision: 3595
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3595
Author:   codemanx
Date:     2012-07-08 12:37:52 +0000 (Sun, 08 Jul 2012)
Log Message:
-----------
3ds export addon: fixed comments to not interfere with string-literals, reported by IRIE Shinsuke via mailing list

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_3ds/export_3ds.py

Modified: trunk/py/scripts/addons/io_scene_3ds/export_3ds.py
===================================================================
--- trunk/py/scripts/addons/io_scene_3ds/export_3ds.py	2012-07-08 02:03:27 UTC (rev 3594)
+++ trunk/py/scripts/addons/io_scene_3ds/export_3ds.py	2012-07-08 12:37:52 UTC (rev 3595)
@@ -19,7 +19,7 @@
 # <pep8 compliant>
 
 # Script copyright (C) Bob Holcomb
-# Contributors: Campbell Barton, Bob Holcomb, Richard Lärkäng, Damien McGinnes, Mark Stijnman
+# Contributors: Campbell Barton, Bob Holcomb, Richard L\xE4rk\xE4ng, Damien McGinnes, Mark Stijnman
 
 """
 Exporting is based on 3ds loader from www.gametutorials.com(Thanks DigiBen) and using information
@@ -40,8 +40,8 @@
 KFDATA = 0xB000  # This is the header for all of the key frame info
 
 #------ sub defines of OBJECTINFO
-MATERIAL = 45055  # 0xAFFF				// This stored the texture info
-OBJECT = 16384  # 0x4000				// This stores the faces, vertices, etc...
+MATERIAL = 45055  # 0xAFFF // This stored the texture info
+OBJECT = 16384 # 0x4000 // This stores the faces, vertices, etc...
 
 #>------ sub defines of MATERIAL
 MATNAME = 0xA000  # This holds the material name
@@ -222,7 +222,7 @@
         return '(%f, %f, %f)' % (self.x, self.y, self.z)
 
 # Used for writing a track
-"""
+'''
 class _3ds_point_4d(object):
     """Class representing a four-dimensional point for a 3ds file, for instance a quaternion."""
     __slots__ = "x","y","z","w"
@@ -238,7 +238,7 @@
 
     def __str__(self):
         return '(%f, %f, %f, %f)' % (self.x, self.y, self.z, self.w)
-"""
+'''
 
 
 class _3ds_point_uv(object):
@@ -442,16 +442,19 @@
         return [s for s in material.texture_slots if s and s.texture.type == 'IMAGE' and s.texture.image]
 
     return []
-# 	images = []
-# 	if material:
-# 		for mtex in material.getTextures():
-# 			if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
-# 				image = mtex.tex.image
-# 				if image:
-# 					images.append(image) # maye want to include info like diffuse, spec here.
-# 	return images
 
+    """
+    images = []
+    if material:
+        for mtex in material.getTextures():
+            if mtex and mtex.tex.type == Blender.Texture.Types.IMAGE:
+                image = mtex.tex.image
+                if image:
+                    images.append(image) # maye want to include info like diffuse, spec here.
+    return images
+    """
 
+
 def make_material_subchunk(chunk_id, color):
     """Make a material subchunk.
 
@@ -460,10 +463,12 @@
     col1 = _3ds_chunk(RGB1)
     col1.add_variable("color1", _3ds_rgb_color(color))
     mat_sub.add_subchunk(col1)
-# optional:
-#	col2 = _3ds_chunk(RGB1)
-#	col2.add_variable("color2", _3ds_rgb_color(color))
-#	mat_sub.add_subchunk(col2)
+
+    """optional:
+    col2 = _3ds_chunk(RGB1)
+    col2.add_variable("color2", _3ds_rgb_color(color))
+    mat_sub.add_subchunk(col2)
+    """
     return mat_sub
 
 
@@ -855,7 +860,7 @@
     return mesh_chunk
 
 
-""" # COMMENTED OUT FOR 2.42 RELEASE!! CRASHES 3DS MAX
+''' # COMMENTED OUT FOR 2.42 RELEASE!! CRASHES 3DS MAX
 def make_kfdata(start=0, stop=0, curtime=0):
     """Make the basic keyframe data chunk"""
     kfdata = _3ds_chunk(KFDATA)
@@ -878,9 +883,7 @@
     kfdata.add_subchunk(kfseg)
     kfdata.add_subchunk(kfcurtime)
     return kfdata
-"""
 
-"""
 def make_track_chunk(ID, obj):
     """Make a chunk for track data.
 
@@ -918,9 +921,7 @@
             track_chunk.add_variable("scale", _3ds_point_3d((1.0, 1.0, 1.0)))
 
     return track_chunk
-"""
 
-"""
 def make_kf_obj_node(obj, name_to_id):
     """Make a node chunk for a Blender object.
 
@@ -980,7 +981,7 @@
     kf_obj_node.add_subchunk(make_track_chunk(SCL_TRACK_TAG, obj))
 
     return kf_obj_node
-"""
+'''
 
 
 def save(operator,
@@ -999,7 +1000,7 @@
 
     # Time the export
     time1 = time.clock()
-#	Blender.Window.WaitCursor(1)
+    #Blender.Window.WaitCursor(1)
 
     if global_matrix is None:
         global_matrix = mathutils.Matrix()
@@ -1099,7 +1100,7 @@
     for ob, data in mesh_objects:
         name_to_id[ob.name]= len(name_to_id)
     #for ob in empty_objects:
-    #	name_to_id[ob.name]= len(name_to_id)
+    #    name_to_id[ob.name]= len(name_to_id)
     """
 
     # Create object chunks for all meshes:
@@ -1126,9 +1127,10 @@
         # make a kf object node for the object:
         kfdata.add_subchunk(make_kf_obj_node(ob, name_to_id))
         '''
+
         if not blender_mesh.users:
             bpy.data.meshes.remove(blender_mesh)
-# 		blender_mesh.vertices = None
+                #blender_mesh.vertices = None
 
         i += i
 
@@ -1166,7 +1168,7 @@
     name_mapping.clear()
 
     # Debugging only: report the exporting time:
-# 	Blender.Window.WaitCursor(0)
+    #Blender.Window.WaitCursor(0)
     print("3ds export time: %.2f" % (time.clock() - time1))
 
     # Debugging only: dump the chunk hierarchy:



More information about the Bf-extensions-cvs mailing list