shortcuts.py 文件源码

python
阅读 39 收藏 0 点赞 0 评论 0

项目:cmt 作者: chadmv 项目源码 文件源码
def get_node_in_namespace_hierarchy(node, namespace=None, shape=False):
    """Searches a namespace and all nested namespaces for the given node.

    :param node: Name of the node.
    :param namespace: Root namespace
    :param shape: True to get the shape node, False to get the transform.
    :return: The node in the proper namespace.
    """
    if shape and node and cmds.objExists(node):
        node = get_shape(node)

    if node and cmds.objExists(node):
        return node

    if node and namespace:
        # See if it exists in the namespace or any child namespaces
        namespaces = [namespace.replace(':', ''),]
        namespaces += cmds.namespaceInfo(namespace, r=True, lon=True) or []
        for namespace in namespaces:
            namespaced_node = '{0}:{1}'.format(namespace, node)
            if shape:
                namespaced_node = get_shape(namespaced_node)
            if namespaced_node and cmds.objExists(namespaced_node):
                return namespaced_node
    return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号