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) |
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) | |
| enumAttr = om2.MFnEnumAttribute() | |
| enumAttrObj = enumAttr.create("enumLongName", "enumShortName", 0) | |
| enumAttr.addField("AAA", 0) | |
| enumAttr.addField("BBB", 1) |
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) | |
| floatAttr = om2.MFnNumericAttribute() | |
| floatAttrObj = floatAttr.create("floatLongName", "floatShortName", om2.MFnNumericData.kFloat, 1.0) | |
| # create後じゃないと設定できない | |
| floatAttr.writable = True |
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
| Shader "Dynamic Branch Shader Complex" | |
| { | |
| Properties | |
| { | |
| _TexAAA ("Tex AAA", 2D) = "white" {} | |
| _TexBBB ("Tex BBB", 2D) = "white" {} | |
| _TexCCC ("Tex CCC", 2D) = "white" {} | |
| [KeywordEnum(None, AAA, BBB, CCC)] _Var_Test ("Variant Test", Float) = 1 | |
| } |
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
| Shader "Dynamic Branch Shader Simple" | |
| { | |
| Properties | |
| { | |
| _TexAAA ("Tex AAA", 2D) = "white" {} | |
| _TexBBB ("Tex BBB", 2D) = "white" {} | |
| _TexCCC ("Tex CCC", 2D) = "white" {} | |
| [KeywordEnum(None, AAA, BBB, CCC)] _Var_Test ("Variant Test", Float) = 1 | |
| } |
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
| Shader "Multi Compile Shader Simple Toggle" | |
| { | |
| Properties | |
| { | |
| [Toggle(_VAR_TEST_AAA)] _Use_TexAAA ("Use Tex AAA", int) = 0 | |
| _TexAAA ("Tex AAA", 2D) = "white" {} | |
| [Toggle(_VAR_TEST_BBB)] _Use_TexBBB ("Use Tex BBB", int) = 0 | |
| _TexBBB ("Tex BBB", 2D) = "white" {} | |
| [Toggle(_VAR_TEST_CCC)] _Use_TexCCC ("Use Tex CCC", int) = 0 | |
| _TexCCC ("Tex CCC", 2D) = "white" {} |
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
| Shader "Multi Compile Shader Complex Toggle" | |
| { | |
| Properties | |
| { | |
| [Toggle(_VAR_TEST_AAA)] _Use_TexAAA ("Use Tex AAA", int) = 0 | |
| _TexAAA ("Tex AAA", 2D) = "white" {} | |
| [Toggle(_VAR_TEST_BBB)] _Use_TexBBB ("Use Tex BBB", int) = 0 | |
| _TexBBB ("Tex BBB", 2D) = "white" {} | |
| [Toggle(_VAR_TEST_CCC)] _Use_TexCCC ("Use Tex CCC", int) = 0 | |
| _TexCCC ("Tex CCC", 2D) = "white" {} |
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
| Shader "Multi Compile Shader Complex" | |
| { | |
| Properties | |
| { | |
| _TexAAA ("Tex AAA", 2D) = "white" {} | |
| _TexBBB ("Tex BBB", 2D) = "white" {} | |
| _TexCCC ("Tex CCC", 2D) = "white" {} | |
| [KeywordEnum(None, AAA, BBB, CCC)] _Var_Test ("Variant Test", Float) = 1 | |
| } |
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
| Shader "Multi Compile Shader Simple" | |
| { | |
| Properties | |
| { | |
| _TexAAA ("Tex AAA", 2D) = "white" {} | |
| _TexBBB ("Tex BBB", 2D) = "white" {} | |
| _TexCCC ("Tex CCC", 2D) = "white" {} | |
| [KeywordEnum(None, AAA, BBB, CCC)] _Var_Test ("Variant Test", Float) = 1 | |
| } |
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.mel as mel | |
| try: | |
| xbmLangPaths = mel.eval("getenv XBMLANGPATH;") | |
| except: | |
| xbmLangPaths = '' | |
| addPath = r";D:/Test/icons" | |
| if not addPath in xbmLangPaths: | |
| xbmLangPaths += addPath |