Skip to content

Instantly share code, notes, and snippets.

@fereria
Created March 5, 2014 03:34
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 fereria/39f2d7c4b186845da93d to your computer and use it in GitHub Desktop.
Save fereria/39f2d7c4b186845da93d to your computer and use it in GitHub Desktop.
2Node Distance
#-2つのノードの間の距離を取得する
def getDistance(posA,posB):
if isinstance(posA,str) == True:
posA = pm.PyNode(posA)
if isinstance(posB,str) == True:
posB = pm.PyNode(posB)
vecA = posA.getTranslation(space="world")
vecB = posB.getTranslation(space="world")
vec = vecA - vecB
return vec.length()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment