Created
April 13, 2018 09:12
-
-
Save taikomatsu/3d564d89f355f65a8e22e1da3c304bc0 to your computer and use it in GitHub Desktop.
超手抜き版エッジから正しいポジションを復元させるやーつ。任意の軸とエッジ(2点)の角度の差をdegreeでなんとなく取得する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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