Created
December 23, 2022 18:55
-
-
Save redglasses67/0649f5b80196c540341209296eca5a02 to your computer and use it in GitHub Desktop.
MFnTypedAttribute での 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) | |
stringAttr = om2.MFnTypedAttribute() | |
stringAttrObj = stringAttr.create("stringLongName", "stringShortName", om2.MFnData.kString) | |
stringAttr.default = om2.MFnStringData().create("a b c d e f g") | |
fnDepNode.addAttribute(stringAttrObj) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment