当前位置: 首页>>代码示例>>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;未经允许,请勿转载。