def type_direction_callback(self, context):
scn = context.scene
v = mathutils.Vector(scn.ne_type_normal)
nv = copy.deepcopy(v)
nv.normalize()
rotated = nv
if scn.ne_view_sync_mode:
mView = get_view_rotational_matrix(True)
mObject = get_object_rotational_matrix()
rotated = mView * mObject * nv
else:
rotated = rot_vector(nv, reverse=True)
if not is_same_vector(scn.ne_type_normal, scn.ne_type_normal_old):
if not scn.ne_update_by_global_callback:
set_normal_to_selected(context, nv)
scn.ne_type_normal_old = scn.ne_type_normal
# update direction sphere
# avoid recursive call
scn.ne_update_by_global_callback = True
scn.ne_view_normal = rotated
评论列表
文章目录