smooth-normal.py 文件源码

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

项目:Smooth-Normal 作者: dskjal 项目源码 文件源码
def global_callback_handler(context):
    ob = bpy.context.active_object
    scn = bpy.context.scene
    if is_normal_active(ob):
        new_orientation = get_view_quaternion()
        if new_orientation==None:
            return

        if not is_same_vector(new_orientation, scn.ne_view_orientation):
            #update view orientation
            scn.ne_update_by_global_callback = True
            scn.ne_view_orientation = new_orientation

        #active vertex changed
        bm = bmesh.from_edit_mesh(ob.data)
        ensure_lookup_table(bm)  
        active = bm.select_history.active
        if active!=None:
            index = active.index
            if index != scn.ne_last_selected_vert_index:
                scn.ne_last_selected_vert_index = index
                scn.ne_update_by_global_callback = True
                scn.ne_type_normal = get_active_normal(bpy.context, ob)[0]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号