archipack_wall.py 文件源码

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

项目:bpy_lambda 作者: bcongdon 项目源码 文件源码
def update(self, context):
        # update height via bmesh to avoid loosing material ids
        # this should be the rule for other simple objects
        # as long as there is no topologic changes
        o = context.active_object
        if archipack_wall.datablock(o) != self:
            return
        bpy.ops.object.mode_set(mode='EDIT')
        me = o.data
        bm = bmesh.from_edit_mesh(me)
        bm.verts.ensure_lookup_table()
        bm.faces.ensure_lookup_table()
        new_z = self.z
        last_z = list(v.co.z for v in bm.verts)
        max_z = max(last_z)
        for v in bm.verts:
            if v.co.z == max_z:
                v.co.z = new_z
        bmesh.update_edit_mesh(me, True)
        bpy.ops.object.mode_set(mode='OBJECT')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号