本文整理汇总了Python中maya.OpenMaya.MTypeId方法的典型用法代码示例。如果您正苦于以下问题:Python OpenMaya.MTypeId方法的具体用法?Python OpenMaya.MTypeId怎么用?Python OpenMaya.MTypeId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类maya.OpenMaya
的用法示例。
在下文中一共展示了OpenMaya.MTypeId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: typeId
# 需要导入模块: from maya import OpenMaya [as 别名]
# 或者: from maya.OpenMaya import MTypeId [as 别名]
def typeId(self):
"""Return the native maya.api.MTypeId of this node
Example:
>>> node = createNode("transform")
>>> node.typeId == tTransform
True
"""
return self._fn.typeId
示例2: createNode
# 需要导入模块: from maya import OpenMaya [as 别名]
# 或者: from maya.OpenMaya import MTypeId [as 别名]
def createNode(type, name=None, parent=None):
"""Create a new node
This function forms the basic building block
with which to create new nodes in Maya.
.. note:: Missing arguments `shared` and `skipSelect`
.. tip:: For additional performance, `type` may be given as an MTypeId
Arguments:
type (str): Type name of new node, e.g. "transform"
name (str, optional): Sets the name of the newly-created node
parent (Node, optional): Specifies the parent in the DAG under which
the new node belongs
Example:
>>> node = createNode("transform") # Type as string
>>> node = createNode(tTransform) # Type as ID
"""
try:
with DagModifier() as mod:
node = mod.createNode(type, name=name, parent=parent)
except TypeError:
with DGModifier() as mod:
node = mod.createNode(type, name=name)
return node