[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [3236] trunk/py/scripts/addons: - update 3DS export for BMesh.

Campbell Barton ideasman42 at gmail.com
Mon Apr 9 04:19:15 CEST 2012


Revision: 3236
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=3236
Author:   campbellbarton
Date:     2012-04-09 02:19:14 +0000 (Mon, 09 Apr 2012)
Log Message:
-----------
- update 3DS export for BMesh.
- pep8 edits for after effects script.

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

Modified: trunk/py/scripts/addons/io_export_after_effects.py
===================================================================
--- trunk/py/scripts/addons/io_export_after_effects.py	2012-04-07 20:06:09 UTC (rev 3235)
+++ trunk/py/scripts/addons/io_export_after_effects.py	2012-04-09 02:19:14 UTC (rev 3236)
@@ -331,7 +331,6 @@
                 'orientation_anim': False,
                 }
 
-
     # create structure for nulls
     for i, obj in enumerate(selection['nulls']):  # nulls representing blender's obs except cameras, lamps and solids
         if include_selected_objects:
@@ -461,7 +460,7 @@
                     js_data['cameras'][name_ae]['position_static'] = position
                     js_data['cameras'][name_ae]['orientation_static'] = orientation
                     js_data['cameras'][name_ae]['zoom_static'] = zoom
-    
+
         '''
         # keyframes for all solids. Not ready yet. Temporarily not active
         for i, ob in enumerate(selection['solids']):
@@ -469,7 +468,7 @@
             name_ae = selection['solids'][i][1]
             #convert ob position to AE space
         '''
-    
+
         # keyframes for all lights.
         if include_selected_objects:
             for i, ob in enumerate(selection['lights']):
@@ -549,7 +548,6 @@
         #
         #
         #
-        
 
     # ---- write JSX file
     jsx_file = open(file, 'w')
@@ -678,6 +676,7 @@
 # DO IT
 ##########################################
 
+
 def main(file, context, include_animation, include_active_cam, include_selected_cams, include_selected_objects, include_cam_bundles):
     data = get_comp_data(context)
     selection = get_selected(context)
@@ -772,4 +771,3 @@
 
 if __name__ == "__main__":
     register()
-

Modified: trunk/py/scripts/addons/io_scene_3ds/export_3ds.py
===================================================================
--- trunk/py/scripts/addons/io_scene_3ds/export_3ds.py	2012-04-07 20:06:09 UTC (rev 3235)
+++ trunk/py/scripts/addons/io_scene_3ds/export_3ds.py	2012-04-09 02:19:14 UTC (rev 3236)
@@ -525,13 +525,13 @@
 
     If the mesh contains quads, they will be split into triangles.'''
     tri_list = []
-    do_uv = len(mesh.uv_textures)
+    do_uv = bool(mesh.tessface_uv_textures)
 
     img = None
-    for i, face in enumerate(mesh.faces):
+    for i, face in enumerate(mesh.tessfaces):
         f_v = face.vertices
 
-        uf = mesh.uv_textures.active.data[i] if do_uv else None
+        uf = mesh.tessface_uv_textures.active.data[i] if do_uv else None
 
         if do_uv:
             f_uv = uf.uv
@@ -638,7 +638,7 @@
     face_chunk = _3ds_chunk(OBJECT_FACES)
     face_list = _3ds_array()
 
-    if mesh.uv_textures:
+    if mesh.tessface_uv_textures:
         # Gather materials used in this mesh - mat/image pairs
         unique_mats = {}
         for i, tri in enumerate(tri_list):
@@ -725,7 +725,7 @@
     # Extract the triangles from the mesh:
     tri_list = extract_triangles(mesh)
 
-    if mesh.uv_textures:
+    if mesh.tessface_uv_textures:
         # Remove the face UVs and convert it to vertex UV:
         vert_array, uv_array, tri_list = remove_face_uv(mesh.vertices, tri_list)
     else:
@@ -963,11 +963,11 @@
                 mat_ls_len = len(mat_ls)
 
                 # get material/image tuples.
-                if data.uv_textures:
+                if data.tessface_uv_textures:
                     if not mat_ls:
                         mat = mat_name = None
 
-                    for f, uf in zip(data.faces, data.uv_textures.active.data):
+                    for f, uf in zip(data.tessfaces, data.tessface_uv_textures.active.data):
                         if mat_ls:
                             mat_index = f.material_index
                             if mat_index >= mat_ls_len:
@@ -987,7 +987,7 @@
                             materialDict.setdefault((mat.name, None), (mat, None))
 
                     # Why 0 Why!
-                    for f in data.faces:
+                    for f in data.tessfaces:
                         if f.material_index >= mat_ls_len:
                             f.material_index = 0
 



More information about the Bf-extensions-cvs mailing list