Last active
January 19, 2024 11:31
-
-
Save redglasses67/96ea8bd319acc5b86e8b300750c1cd46 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 | |
import maya.OpenMaya as om | |
selList = om2.MGlobal.getActiveSelectionList() | |
mDagPath = selList.getDagPath(0) | |
objectName = om.MFnDependencyNode(mDagPath.transform()).name() | |
# 残念ならがまだ Python API 2.0 の方に MFnExpression クラスが移植されていないようなので1.0の方を使います | |
exp = om.MFnExpression() | |
exp.create("%s.rotateY = time * 10;" % objectName) # 中身はいつものExpressionを書く |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment