skeleton.py 文件源码

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

项目:cmt 作者: chadmv 项目源码 文件源码
def dump(root=None, file_path=None):
    """Dump the hierarchy data starting at root to disk.
    :param root: Root node of the hierarchy.
    :param file_path: Export json path.
    :return: The hierarchy data that was exported.
    """
    if root is None:
        root = cmds.ls(sl=True)
        if root:
            root = root[0]
        else:
            return
    if file_path is None:
        file_path = cmds.fileDialog2(fileFilter='Skeleton Files (*.json)', dialogStyle=2, caption='Export Skeleton',
                                     fileMode=0, returnFilter=False)
        if file_path:
            file_path = file_path[0]
        else:
            return
    data = get_data(root)
    fh = open(file_path, 'w')
    json.dump(data, fh, indent=4)
    fh.close()
    logger.info('Exported skeleton to %s', file_path)
    return data, file_path
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号