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 |
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
# -*- coding: utf-8 -*- | |
import maya.cmds as mc | |
import maya.mel as mel | |
# 33 のビュー変換で使用する名前の一覧クラス. 変更時に文字列指定するので事前にこのように用意しておくと楽そう | |
class ViewTransformName(): | |
ACES_RRT_v_0_7 = "ACES RRT v0.7" | |
ACES_RRT_v_1_0 = "ACES RRT v1.0" | |
Log = "Log" |