def index_callback(self, context):
scn = context.scene
if scn.ne_split_mode:
o = context.active_object
bm = bmesh.from_edit_mesh(o.data)
ensure_lookup_table(bm)
index = bm.select_history.active.index
masked_vertices = get_masked_vertices(context)
loop_index = scn.ne_view_normal_index
to_loops = create_loop_table(o.data)
if loop_index < len(to_loops[index]):
o.data.calc_normals_split()
loop_index = to_loops[index][face_index]
rotated = o.data.loops[loop_index].normal
if scn.ne_view_sync_mode:
mView = get_view_rotational_matrix(True)
mObject = get_object_rotational_matrix()
rotated = mView * mObject * rotated
else:
rotated = rot_vector(rotated, reverse=True)
scn.ne_view_normal = rotated
评论列表
文章目录