HideShow.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:mesh_doshape_tools 作者: YHOYO 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号