我只有一个简短的问题。目前我正在为 Blender 编写一个插件。一切正常,但是当我想将顶点和面添加到当前的 Blender-Scene 时,出现以下错误:
File "/usr/lib/blender/scripts/modules/bpy_types.py", line 378, in <listcomp>
vertices_flat = [f for v in vertices for f in v]
TypeError: 'numpy.float32' object is not iterable
编辑:这是代码:
def add2Scene(self,verts):
print("Adding object to current scene")
triMesh = bpy.data.meshes.new("MCIsosurface")
triMesh.from_pydata(verts , [], self.faces)
triObj = bpy.data.objects.new("MCIsosurface", triMesh)
#triObj.setLocation(0,0,0)
bpy.context.scene.objects.link(triObj)
print("done")