Skip to content

Instantly share code, notes, and snippets.

@taikomatsu
Created April 13, 2018 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taikomatsu/3d564d89f355f65a8e22e1da3c304bc0 to your computer and use it in GitHub Desktop.
Save taikomatsu/3d564d89f355f65a8e22e1da3c304bc0 to your computer and use it in GitHub Desktop.
超手抜き版エッジから正しいポジションを復元させるやーつ。任意の軸とエッジ(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