Created
September 15, 2019 10:07
-
-
Save nobolu-ootsuka-unrealengine/e9a9a616eb14273167c7cdb1f1d746e1 to your computer and use it in GitHub Desktop.
jointTojointLong.py
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
from maya import cmds ,OpenMaya | |
# ジョイントのローカルXの差が出したいから | |
start = cmds.xform("joint1" , q=1 , ws = 0 , translation =1) | |
end = cmds.xform("joint2" , q=1 , ws = 0 , translation =1) | |
print("start[0]="+str(start[0])) | |
print("end[0]="+str(end[0])) | |
long=end[0]-start[0] | |
long=abs(long) | |
long=long*1 | |
print("long="+str(long)) | |
# ジョイントの長さにそわせたいから長さ、Cubeと書く | |
cmds.xform("Cube" , ws=1 ,scale=(long,1,1)) | |
#cmds.scaleConstraint( 'cone1', 'cube1' ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment