Last active
December 25, 2019 04:40
-
-
Save redglasses67/488ffc3f60a165fc3bb24279fa15197f to your computer and use it in GitHub Desktop.
トランスフォームとメッシュを取得する
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.api.OpenMaya as om2 | |
| selList = om2.MGlobal.getActiveSelectionList() | |
| mDagPath = selList.getDagPath(0) | |
| if mDagPath.hasFn(om2.MFn.kMesh): | |
| transform = om2.MFnTransform(mDagPath) | |
| print("transform = %s" %transform.fullPathName()) | |
| mesh = om2.MFnMesh(mDagPath) | |
| mesh2 = mDagPath.extendToShape() # こんな方法もあります | |
| print("mesh = %s ( mesh2 = %s )" %(mesh.fullPathName(), mesh2.fullPathName())) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment