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]
评论列表
文章目录