def main(self, context, chboxhide, chboxshow):
obj = bpy.context.object
me = obj.data
bm = bmesh.from_edit_mesh(me)
try:
v1 = [v for v in bm.verts if (v.select == True and v.hide == False)]
e1 = [e for e in bm.edges if (e.select == True and e.hide == False)]
f1 = [f for f in bm.faces if (f.select == True and f.hide == False)]
if len(v1)>0 or len(e1) >0 or f1>0:
if chboxhide:
bpy.ops.mesh.select_all(action='INVERT')
bpy.ops.mesh.hide(unselected=False)
bpy.ops.mesh.select_all(action='SELECT')
elif chboxshow:
bpy.ops.mesh.reveal()
except:
if chboxshow:
bpy.ops.mesh.reveal()
bmesh.update_edit_mesh(me, True)
评论列表
文章目录