Created
March 11, 2015 11:34
-
-
Save robomojo/6546a567f99e430c0168 to your computer and use it in GitHub Desktop.
This file contains 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
import pymel.core as pm | |
def GetDistanceBetweenVectors (objA, objB): | |
''' | |
returns a float. | |
Expects the name of two objects. | |
Uses Pymel to get translation - probably a better way to do this. | |
''' | |
Ax, Ay, Az = pm.PyNode(objA).getTranslation(space="world") | |
Bx, By, Bz = pm.PyNode(objB).getTranslation(space="world") | |
return ( (Ax-Bx)**2 + (Ay-By)**2 + (Az-Bz)**2 )**0.5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment