本文整理匯總了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