editing.py 文件源码

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

项目:io_scene_kcl 作者: Syroot 项目源码 文件源码
def scene_update_post_handler(scene):
    obj = scene.objects.active
    if not obj:
        return
    if obj.mode == "EDIT" and obj.type == "MESH":
        # Ensure to have an instance of the edit bmesh in the global dictionary to retrieve it in update methods.
        bm = kcl_dict.setdefault(obj.name, bmesh.from_edit_mesh(obj.data))
        face = bm.faces.active # TODO: bm instance might be dead here due to previous editing.
        flag_layer = bm.faces.layers.int.get("kcl_flags")
        if face and flag_layer:
            flags = face[flag_layer]
            # Update the flags stored in the window manager.
            kcl_dict["update_by_code"] = True
            bpy.context.window_manager.kcl_flag = flags
            bpy.context.window_manager.kcl_is_lakitu = (flags & 0x0010) != 0 # Bit 5
            kcl_dict["update_by_code"] = False
    else:
        kcl_dict.clear()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号