smooth-normal.py 文件源码

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

项目:Smooth-Normal 作者: dskjal 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号