Created
September 4, 2023 13:25
-
-
Save yohawing/adca9bd175848e137ca685cab20d5119 to your computer and use it in GitHub Desktop.
親ボーンのJointOrientをコピーして適応するスクリプト
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
| import maya.cmds as cmds | |
| selected_joint = cmds.ls(selection=True, flatten=True) | |
| for jnt in selected_joint: | |
| tr = cmds.ls(jnt, type="transform") | |
| parent_tr = cmds.listRelatives(tr, parent=True, fullPath=False) | |
| if parent_tr: | |
| rot = cmds.getAttr(parent_tr[0] + ".jointOrient") | |
| print(rot) | |
| child_rot = cmds.getAttr(jnt + ".jointOrient") | |
| cmds.setAttr(jnt + ".jointOrientX", rot[0][0]) | |
| cmds.setAttr(jnt + ".jointOrientY", rot[0][1]) | |
| cmds.setAttr(jnt + ".jointOrientZ", rot[0][2]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment