OSDN Git Service

implement vertex attributes
[meshio/pymeshio.git] / blender26-meshio / bl.py
index 4d5afde..c668fa0 100644 (file)
@@ -242,6 +242,8 @@ class object:
 
     @staticmethod
     def assignVertexGroup(o, name, index, weight):
 
     @staticmethod
     def assignVertexGroup(o, name, index, weight):
+        if name not in o.vertex_groups:
+            o.vertex_groups.new(name)
         o.vertex_groups[name].add([index], weight, 'ADD')
 
     @staticmethod
         o.vertex_groups[name].add([index], weight, 'ADD')
 
     @staticmethod