Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
超手抜き版エッジから正しいポジションを復元させるやーつ。任意の軸とエッジ(2点)の角度の差をdegreeでなんとなく取得する。
from pymel.core import *
import math
pt0, pt1 = selected(fl=True)
p0 = dt.Vector(xform(pt0, q=True, ws=True, t=True, a=True))
p1 = dt.Vector(xform(pt1, q=True, ws=True, t=True, a=True))
diff = p0-p1
axis = dt.Vector(0, 0, 1)
print(math.degrees(math.acos(diff.normal().dot(axis))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.