当前位置: 首页>>代码示例>>Python>>正文


Python MGlobal.displayWarning方法代码示例

本文整理汇总了Python中maya.OpenMaya.MGlobal.displayWarning方法的典型用法代码示例。如果您正苦于以下问题:Python MGlobal.displayWarning方法的具体用法?Python MGlobal.displayWarning怎么用?Python MGlobal.displayWarning使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在maya.OpenMaya.MGlobal的用法示例。


在下文中一共展示了MGlobal.displayWarning方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: exportObjectAsAssFile

# 需要导入模块: from maya.OpenMaya import MGlobal [as 别名]
# 或者: from maya.OpenMaya.MGlobal import displayWarning [as 别名]
def exportObjectAsAssFile(location="", objectName=""):
    if objectName == "":
        MGlobal.displayWarning("No object exported!!!")
        return False

    else:
        cmds.select(objectName, r=True)
        cmds.file(location + "/" + objectName, type="mayaBinary", force=True, exportSelected=True)
        return True
开发者ID:yes7rose,项目名称:maya_utils,代码行数:11,代码来源:maya_utils.py

示例2: exportObjectAsMbFile

# 需要导入模块: from maya.OpenMaya import MGlobal [as 别名]
# 或者: from maya.OpenMaya.MGlobal import displayWarning [as 别名]
def exportObjectAsMbFile(location="", objectName=""):
    if objectName == "":
        MGlobal.displayWarning("No object exported!!!")
        return False

    else:
        print(objectName)
        cmds.select(objectName, replace=True)
        cmds.file(location + "/" + objectName, exportSelected=True, type="mayaBinary", constructionHistory=False, force=True)
        return True
开发者ID:yes7rose,项目名称:maya_utils,代码行数:12,代码来源:maya_utils.py

示例3: ikHandle

# 需要导入模块: from maya.OpenMaya import MGlobal [as 别名]
# 或者: from maya.OpenMaya.MGlobal import displayWarning [as 别名]
def ikHandle(*args, **kwargs):
    """
    Modifications:
        - always converts to PyNodes in create mode, even though results are
          non-unique short names
    """
    import nodetypes
    from maya.OpenMaya import MGlobal

    res = cmds.ikHandle(*args, **kwargs)

    # unfortunately, ikHandle returns non-unique names... however, it
    # doesn't support a parent option - so we can just throw a '|' in front
    # of the first return result (the ikHandle itself) to get a unique name
    # We then need to track through it's connections to find the endEffector...

    if kwargs.get('query', kwargs.get('q', False)):
        if kwargs.get('endEffector', kwargs.get('ee', False)):
            res = _factories.toPyNode(res)
        elif kwargs.get('jointList', kwargs.get('jl', False)):
            res = _factories.toPyNodeList(res)
    elif (not kwargs.get('edit', kwargs.get('e', False))
            and isinstance(res, list) and len(res) == 2
            and all(isinstance(x, basestring) for x in res)):
        handleName, effectorName = res
        # ikHandle doesn't support a parent kwarg, so result should always be
        # grouped under the world...
        handleNode = _factories.toPyNode('|' + handleName)
        # unfortunately, effector location is a little harder to predict. but
        # can find it by following connections...
        effectorNode = handleNode.attr('endEffector').inputs()[0]
        if effectorNode.nodeName() == effectorName:
            res = [handleNode, effectorNode]
        else:
            MGlobal.displayWarning(
                "Warning: returned ikHandle %r was connected to effector %r, "
                "which did not match returned effector name %r"
                % (handleName, effectorNode.shortName(), effectorName))
    return res
开发者ID:LumaPictures,项目名称:pymel,代码行数:41,代码来源:animation.py


注:本文中的maya.OpenMaya.MGlobal.displayWarning方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。