Created
December 23, 2022 18:54
-
-
Save redglasses67/766e80e2f6ff76f5257b82fe50415754 to your computer and use it in GitHub Desktop.
MFnMatrixAttribute での addAttribute
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() | |
mObject = selList.getDependNode(0) | |
fnDepNode = om2.MFnDependencyNode(mObject) | |
matrixAttr = om2.MFnMatrixAttribute() | |
matrixAttrObj = matrixAttr.create("matrixLongName", "matrixShortName", om2.MFnMatrixAttribute.kDouble) | |
matrixAttr.default = om2.MMatrix([(1, 0, 0, 0), (0, 1, 0, 0), (0, 0, 1, 0), (0, 0, 0, 1)]) | |
fnDepNode.addAttribute(matrixAttrObj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment