支持
目前3.0也可以使用
使用方法
切换脚本模式,输入脚本内容,然后右上角运行
完成
源码
import bpy
def rotate_between_two():
if len(bpy.context.selected_objects) != 3: return
objTarget = bpy.context.view_layer.objects.active
posA, posB = [ob.location for ob in bpy.context.selected_objects if ob != objTarget]
midPoint = (posA + posB)/2
objTarget.location = midPoint
axis = posA - posB
rotation_mode = objTarget.rotation_mode
objTarget.rotation_mode = 'QUATERNION'
objTarget.rotation_quaternion = axis.to_track_quat('Z','Y')
objTarget.rotation_mode = rotation_mode
rotate_between_two()
说明:如果有精彩文章或者技巧,欢迎投稿