def interactive_hole(self, context, o):
hole_obj = self.find_hole(o)
if hole_obj is None:
m = bpy.data.meshes.new("hole")
hole_obj = bpy.data.objects.new("hole", m)
context.scene.objects.link(hole_obj)
hole_obj['archipack_hole'] = True
hole_obj.parent = o
hole_obj.matrix_world = o.matrix_world.copy()
MaterialUtils.add_wall2_materials(hole_obj)
hole = self.hole
v = Vector((0, 0, 0))
offset = Vector((0, -0.001, 0))
size = Vector((self.x + 2 * self.frame_x, self.z + self.frame_x + 0.001, self.y))
verts = hole.vertices(16, offset, v, v, size, v, 0, 0, shape_z=None, path_type='RECTANGLE')
faces = hole.faces(16, path_type='RECTANGLE')
matids = hole.mat(16, 0, 1, path_type='RECTANGLE')
uvs = hole.uv(16, v, v, size, v, 0, 0, 0, 0, path_type='RECTANGLE')
bmed.buildmesh(context, hole_obj, verts, faces, matids=matids, uvs=uvs)
return hole_obj
评论列表
文章目录