[Bf-extensions-cvs] SVN commit: /data/svn/bf-extensions [4156] contrib/py/scripts/addons/ io_scene_ms3d: fix: material_index, for imported object without a material

Alexander Nussbaumer alpha-beta-release at gmx.net
Thu Jan 10 07:47:27 CET 2013


Revision: 4156
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-extensions&revision=4156
Author:   beta-tester
Date:     2013-01-10 06:47:24 +0000 (Thu, 10 Jan 2013)
Log Message:
-----------
fix: material_index, for imported object without a material

imported objects without a material were not visible to 'Blender Render' camera at render time, even when a new material was assigned to the object.
(edit mesh and reassign material to all the faces was needed to get it visible, because BMesh.Face.material_index was setted to a improper value in the importer)

Modified Paths:
--------------
    contrib/py/scripts/addons/io_scene_ms3d/__init__.py
    contrib/py/scripts/addons/io_scene_ms3d/ms3d_import.py

Modified: contrib/py/scripts/addons/io_scene_ms3d/__init__.py
===================================================================
--- contrib/py/scripts/addons/io_scene_ms3d/__init__.py	2013-01-10 01:30:35 UTC (rev 4155)
+++ contrib/py/scripts/addons/io_scene_ms3d/__init__.py	2013-01-10 06:47:24 UTC (rev 4156)
@@ -23,7 +23,7 @@
     'description': "Import / Export MilkShape3D MS3D files"\
             " (conform with v1.8.4)",
     'author': "Alexander Nussbaumer",
-    'version': (0, 90, 0),
+    'version': (0, 91, 0),
     'blender': (2, 65, 0),
     'location': "File > Import & File > Export",
     'warning': "",
@@ -32,7 +32,6 @@
     'tracker_url': "http://projects.blender.org/tracker/index.php"\
             "?func=detail&aid=29404",
     'category': "Import-Export",
-    'support': 'OFFICIAL',
     }
 
 ###############################################################################

Modified: contrib/py/scripts/addons/io_scene_ms3d/ms3d_import.py
===================================================================
--- contrib/py/scripts/addons/io_scene_ms3d/ms3d_import.py	2013-01-10 01:30:35 UTC (rev 4155)
+++ contrib/py/scripts/addons/io_scene_ms3d/ms3d_import.py	2013-01-10 06:47:24 UTC (rev 4156)
@@ -527,19 +527,10 @@
                 ms3d_material_index \
                         = ms3d_model.groups[ms3d_triangle.group_index].material_index
                 if ms3d_material_index != Ms3dSpec.NONE_GROUP_MATERIAL_INDEX:
-                    # BMFace.material_index expects...
-                    # index of material in types.Mesh.materials,
-                    # not index of material in blender_context.blend_data.materials!
                     bmf.material_index = ms3d_material_index
-
                     # apply diffuse texture image to face, to be visible in 3d view
                     bmf[layer_texture].image = ms3d_to_blender_material.get(
                             ms3d_material_index)
-                else:
-                    # set material index to highes possible index
-                    # - in most cases there is no maretial assigned ;)
-                    bmf.material_index = 32766
-                    pass
 
             # helper dictionary for post-processing smoothing_groups
             smoothing_group_blender_face = smoothing_group_blender_faces.get(



More information about the Bf-extensions-cvs mailing list