OSDN Git Service

separate vertex with uv or normal.
[meshio/meshio.git] / swig / blender / bl25.py
index a1ed64b..d0138b3 100755 (executable)
@@ -337,16 +337,16 @@ class material:
         return index
 
     @staticmethod
-    def getTexture(material, index):
-        return material.texture_slots[index].texture
+    def getTexture(m, index):
+        return m.texture_slots[index].texture
 
     @staticmethod
-    def hasTexture(material):
-        return material.texture_slots[0]
+    def hasTexture(m):
+        return m.texture_slots[0]
 
     @staticmethod
-    def setUseTexture(material, index, enable):
-        material.use_textures[index]=enable
+    def setUseTexture(m, index, enable):
+        m.use_textures[index]=enable
 
     @staticmethod
     def eachTexturePath(m):
@@ -359,6 +359,17 @@ class material:
                         continue
                     yield image.filename
 
+    @staticmethod
+    def eachEnalbeTexturePath(m):
+        for i, slot in enumerate(m.texture_slots):
+            if m.use_textures[i] and slot and slot.texture:
+                texture=slot.texture
+                if  texture.type=="IMAGE":
+                    image=texture.image
+                    if not image:
+                        continue
+                    yield image.filename
+
 
 class mesh:
     @staticmethod
@@ -477,11 +488,16 @@ class mesh:
 
 class vertex:
     @staticmethod
-    def setNormal(mvert, normal):
-        mvert.normal=mathutils.Vector(normal)
+    def setNormal(v, normal):
+        v.normal=mathutils.Vector(normal)
+
+    @staticmethod
+    def getNormal(v):
+        return v.normal
 
     @staticmethod
-    def setUv(mvert, uv):
+    def setUv(v, uv):
+        # sticky ?
         pass