[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4694] trunk/py/scripts/addons/ io_scene_ms3d: undo the workaround of my previous commit for "[#36443] Vertex to UV index doesn't match with 2.68a", because that issue is fixed in blender 2.68a r59343 now.

Alexander N alpha-beta-release at gmx.net
Thu Aug 22 15:42:34 CEST 2013


Revision: 4694
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4694
Author:   beta-tester
Date:     2013-08-22 13:42:34 +0000 (Thu, 22 Aug 2013)
Log Message:
-----------
undo the workaround of my previous commit for "[#36443] Vertex to UV index doesn't match with 2.68a", because that issue is fixed in blender 2.68a r59343 now.

- deleted not needed workaround for issue [#36443], because it is fixed in blender 2.68a r59343,
- added BMEdge generation to the importer (only for nice doing),
- added undo to operators,
- deleted some unused strings,

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=59343
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=59343

Modified Paths:
--------------
    trunk/py/scripts/addons/io_scene_ms3d/ms3d_import.py
    trunk/py/scripts/addons/io_scene_ms3d/ms3d_strings.py
    trunk/py/scripts/addons/io_scene_ms3d/ms3d_ui.py

Modified: trunk/py/scripts/addons/io_scene_ms3d/ms3d_import.py
===================================================================
--- trunk/py/scripts/addons/io_scene_ms3d/ms3d_import.py	2013-08-22 13:36:50 UTC (rev 4693)
+++ trunk/py/scripts/addons/io_scene_ms3d/ms3d_import.py	2013-08-22 13:42:34 UTC (rev 4694)
@@ -556,10 +556,24 @@
                                     ms3d_triangle_index))
                 continue
 
-            bmf_normal.normalize()
+            # create edges for the face
+            # (not really needed, because bm.faces.new() will create its edges,
+            # if not exist, but good if we have already in case we need full control
+            # of bmesh stuff maybe in the future.
+            bme = bm.edges.get((bmv_list[0], bmv_list[1]))
+            if bme is None:
+                bme = bm.edges.new((bmv_list[0], bmv_list[1]))
+                bme.index = len(bm.edges) - 1
+            bme = bm.edges.get((bmv_list[1], bmv_list[2]))
+            if bme is None:
+                bme = bm.edges.new((bmv_list[1], bmv_list[2]))
+                bme.index = len(bm.edges) - 1
+            bme = bm.edges.get((bmv_list[2], bmv_list[0]))
+            if bme is None:
+                bme = bm.edges.new((bmv_list[2], bmv_list[0]))
+                bme.index = len(bm.edges) - 1
 
             bmf = bm.faces.get(bmv_list)
-
             if bmf is not None:
                 if self.report and self.options_verbose in Ms3dUi.VERBOSE_NORMAL:
                     self.report(
@@ -570,37 +584,17 @@
 
             bmf = bm.faces.new(bmv_list)
             bmf.index = ms3d_triangle_index
+            bmf_normal.normalize()
             bmf.normal = bmf_normal
 
-            ##########################
-            ## WORKAROUND
-            # [#36443] Vertex to UV index doesn't match with 2.68a
-            # https://projects.blender.org/tracker/index.php?func=detail&aid=36443&group_id=9&atid=498
-            #
-            scrambled_order = dict()
-            for face_vertex_index, face_bm_vertex in enumerate(bmf.verts):
-                scrambled_order[face_bm_vertex] = face_vertex_index
             # blender uv custom data per "face vertex"
-            bmf.loops[scrambled_order[bmv_list[0]]][layer_uv].uv = Vector(
+            bmf.loops[0][layer_uv].uv = Vector(
                     (ms3d_triangle.s[0], 1.0 - ms3d_triangle.t[0]))
-            bmf.loops[scrambled_order[bmv_list[1]]][layer_uv].uv = Vector(
+            bmf.loops[1][layer_uv].uv = Vector(
                     (ms3d_triangle.s[1], 1.0 - ms3d_triangle.t[1]))
-            bmf.loops[scrambled_order[bmv_list[2]]][layer_uv].uv = Vector(
+            bmf.loops[2][layer_uv].uv = Vector(
                     (ms3d_triangle.s[2], 1.0 - ms3d_triangle.t[2]))
-            scrambled_order = None
-            #
-            ## WORKAROUND
-            ##########################
 
-            ## blender uv custom data per "face vertex"
-            #bmf.loops[0][layer_uv].uv = Vector(
-            #        (ms3d_triangle.s[0], 1.0 - ms3d_triangle.t[0]))
-            #bmf.loops[1][layer_uv].uv = Vector(
-            #        (ms3d_triangle.s[1], 1.0 - ms3d_triangle.t[1]))
-            #bmf.loops[2][layer_uv].uv = Vector(
-            #        (ms3d_triangle.s[2], 1.0 - ms3d_triangle.t[2]))
-            ##########################
-
             # ms3d custom data per "mesh face"
             bmf[layer_smoothing_group] = ms3d_triangle.smoothing_group
 

Modified: trunk/py/scripts/addons/io_scene_ms3d/ms3d_strings.py
===================================================================
--- trunk/py/scripts/addons/io_scene_ms3d/ms3d_strings.py	2013-08-22 13:36:50 UTC (rev 4693)
+++ trunk/py/scripts/addons/io_scene_ms3d/ms3d_strings.py	2013-08-22 13:42:34 UTC (rev 4694)
@@ -116,7 +116,6 @@
         'ENUM_SELECT_2_SMOOTHING_GROUP': "selects all faces of selected"\
                 " smoothing group",
         'LABEL_NAME_ANIMATION': "Animation Processing:",
-        'LABEL_NAME_OBJECT': "World Processing:",
         'LABEL_NAME_OPTIONS': "Advanced Options:",
         'LABEL_NAME_PROCESSING': "Object Processing:",
         'LABEL_NAME_MODIFIER': "Modifier Processing:",
@@ -200,7 +199,7 @@
         'PROP_NAME_ROTATION_MODE' : "Bone Rotation Mode",
         'PROP_DESC_ROTATION_MODE' : "set the preferred rotation mode of bones",
         'PROP_ITEM_ROTATION_MODE_EULER_1' : "Euler",
-        'PROP_ITEM_ROTATION_MODE_EULER_2' : "use euler bone rotation"\
+        'PROP_ITEM_ROTATION_MODE_EULER_2' : "use Euler bone rotation"\
                 " (gimbal-lock can be fixed by using "\
                 "'Graph Editor -> Key -> Discontinuity (Euler) Filter')",
         'PROP_ITEM_ROTATION_MODE_QUATERNION_1' : "Quaternion",
@@ -212,11 +211,6 @@
         'PROP_NAME_IMPORT_JOINT_SIZE': "Joint Size",
         'PROP_DESC_IMPORT_JOINT_SIZE': "size of the joint representation in"\
                 " blender",
-        'BL_LABEL_SET_SCENE_TO_METRIC' : "Set Scene to 'Metric' [1 mm]",
-        'BL_DESC_SET_SCENE_TO_METRIC' : "set Scene | Units to Metric"\
-                " (1 Unit = 1 mm),"\
-                " Display | Textured Solid,"\
-                " View | Clip (0.001 mm ... 1 km)",
         'PROP_NAME_NORMALIZE_WEIGHTS' : "Normalize Weights",
         'PROP_DESC_NORMALIZE_WEIGHTS' : "normalize all weights to 100%,",
         'PROP_NAME_SHRINK_TO_KEYS' : "Shrink To Keys",

Modified: trunk/py/scripts/addons/io_scene_ms3d/ms3d_ui.py
===================================================================
--- trunk/py/scripts/addons/io_scene_ms3d/ms3d_ui.py	2013-08-22 13:36:50 UTC (rev 4693)
+++ trunk/py/scripts/addons/io_scene_ms3d/ms3d_ui.py	2013-08-22 13:42:34 UTC (rev 4694)
@@ -263,7 +263,7 @@
     bl_idname = 'import_scene.ms3d'
     bl_label = ms3d_str['BL_LABEL_IMPORTER']
     bl_description = ms3d_str['BL_DESCRIPTION_IMPORTER']
-    bl_options = {'PRESET', }
+    bl_options = {'UNDO', 'PRESET', }
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
 
@@ -428,7 +428,7 @@
     bl_idname = 'export_scene.ms3d'
     bl_label = ms3d_str['BL_LABEL_EXPORTER']
     bl_description = ms3d_str['BL_DESCRIPTION_EXPORTER']
-    bl_options = {'PRESET', }
+    bl_options = {'UNDO', 'PRESET', }
     bl_space_type = 'PROPERTIES'
     bl_region_type = 'WINDOW'
 
@@ -640,7 +640,7 @@
 class Ms3dSetSmoothingGroupOperator(Operator):
     bl_idname = Ms3dUi.OPT_SMOOTHING_GROUP_APPLY
     bl_label = ms3d_str['BL_LABEL_SMOOTHING_GROUP_OPERATOR']
-    bl_options = {'INTERNAL', }
+    bl_options = {'UNDO', 'INTERNAL', }
 
     smoothing_group_index = IntProperty(
             name=ms3d_str['PROP_SMOOTHING_GROUP_INDEX'],
@@ -716,7 +716,7 @@
 class Ms3dGroupOperator(Operator):
     bl_idname = Ms3dUi.OPT_GROUP_APPLY
     bl_label = ms3d_str['BL_LABEL_GROUP_OPERATOR']
-    bl_options = {'INTERNAL', }
+    bl_options = {'UNDO', 'INTERNAL', }
 
     mode = EnumProperty(
             items=( ('', "", ""),
@@ -807,7 +807,7 @@
 class Ms3dMaterialOperator(Operator):
     bl_idname = Ms3dUi.OPT_MATERIAL_APPLY
     bl_label = ms3d_str['BL_LABEL_MATERIAL_OPERATOR']
-    bl_options = {'INTERNAL', }
+    bl_options = {'UNDO', 'INTERNAL', }
 
     mode = EnumProperty(
             items=( ('', "", ""),



More information about the Bf-extensions-cvs mailing list