[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [2503] tags/2_60_release/py/scripts/ addons/io_scene_map/export_map.py: undo this commit, needs to be applied to the 2.60a tag

Campbell Barton ideasman42 at gmail.com
Sun Oct 23 17:36:10 CEST 2011


Revision: 2503
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=2503
Author:   campbellbarton
Date:     2011-10-23 15:36:10 +0000 (Sun, 23 Oct 2011)
Log Message:
-----------
undo this commit, needs to be applied to the 2.60a tag

Modified Paths:
--------------
    tags/2_60_release/py/scripts/addons/io_scene_map/export_map.py

Modified: tags/2_60_release/py/scripts/addons/io_scene_map/export_map.py
===================================================================
--- tags/2_60_release/py/scripts/addons/io_scene_map/export_map.py	2011-10-23 14:59:43 UTC (rev 2502)
+++ tags/2_60_release/py/scripts/addons/io_scene_map/export_map.py	2011-10-23 15:36:10 UTC (rev 2503)
@@ -16,7 +16,7 @@
 #
 # ##### END GPL LICENSE BLOCK #####
 
-# <pep8-80 compliant>
+# <pep8 compliant>
 
 import bpy
 import os
@@ -44,14 +44,6 @@
         return None
 
 
-def face_material_get(face):
-    me = face.id_data
-    try:
-        return me.materials[f.material_index]
-    except:
-        return None
-
-
 def write_cube2brush(file, faces):
     '''
     Takes 6 faces and writes a brush,
@@ -74,18 +66,15 @@
         for v in f.vertices[:][2::-1]:
             file.write(format_vec % me.vertices[v].co[:])
 
-        material = face_material_get(f)
+        uf = face_uv_get(f)
 
-        if material and material.game_settings.invisible:
+        if uf and uf.hide:
             file.write(PREF_INVIS_TEX)
         else:
-            uf = face_uv_get(f)
-
             image = uf.image if uf else None
 
             if image:
-                file.write(os.path.splitext(
-                        bpy.path.basename(image.filepath))[0])
+                file.write(os.path.splitext(bpy.path.basename(image.filepath))[0])
             else:
                 file.write(PREF_NULL_TEX)
 
@@ -114,13 +103,11 @@
 
     image_text = PREF_NULL_TEX
 
-    material = face_material_get(f)
+    uf = face_uv_get(face)
 
-    if material and material.game_settings.invisible:
+    if uf and uf.hide:
         image_text = PREF_INVIS_TEX
     else:
-        uf = face_uv_get(face)
-
         image = uf.image if uf else None
 
         if image:
@@ -282,18 +269,13 @@
 def export_map(context, filepath):
     """
     pup_block = [\
-    ('Scale:', PREF_SCALE, 1, 1000,
-            'Scale the blender scene by this value.'),\
-    ('Face Width:', PREF_FACE_THICK, 0.01, 10,
-            'Thickness of faces exported as brushes.'),\
-    ('Grid Snap', PREF_GRID_SNAP,
-            'snaps floating point values to whole numbers.'),\
+    ('Scale:', PREF_SCALE, 1, 1000, 'Scale the blender scene by this value.'),\
+    ('Face Width:', PREF_FACE_THICK, 0.01, 10, 'Thickness of faces exported as brushes.'),\
+    ('Grid Snap', PREF_GRID_SNAP, 'snaps floating point values to whole numbers.'),\
     'Null Texture',\
-    ('', PREF_NULL_TEX, 1, 128,
-            'Export textureless faces with this texture'),\
+    ('', PREF_NULL_TEX, 1, 128, 'Export textureless faces with this texture'),\
     'Unseen Texture',\
-    ('', PREF_INVIS_TEX, 1, 128,
-            'Export invisible faces with this texture'),\
+    ('', PREF_INVIS_TEX, 1, 128, 'Export invisible faces with this texture'),\
     ]
 
     if not Draw.PupBlock('map export', pup_block):



More information about the Bf-extensions-cvs mailing list