當前位置: 首頁>>代碼示例>>Python>>正文


Python OpenMaya.MTypeId方法代碼示例

本文整理匯總了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 
開發者ID:mottosso,項目名稱:cmdx,代碼行數:13,代碼來源:cmdx.py

示例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 
開發者ID:mottosso,項目名稱:cmdx,代碼行數:32,代碼來源:cmdx.py


注:本文中的maya.OpenMaya.MTypeId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。