def _create_mesh_object(self, bm, name):
# Transform the coordinate system so that Y is up.
matrix_y_to_z = Matrix(((1, 0, 0), (0, 0, -1), (0, 1, 0)))
bmesh.ops.transform(bm, matrix=matrix_y_to_z, verts=bm.verts)
# Create the mesh into which each bmesh will be written.
mesh = bpy.data.meshes.new(name)
bm.to_mesh(mesh)
bm.free()
# Create, group and link an object representing that mesh.
ob = bpy.data.objects.new(name, mesh)
self._add_to_group(ob, "KCL")
bpy.context.scene.objects.link(ob)
评论列表
文章目录