assetdownload.py 文件源码

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

项目:community-plugins 作者: makehumancommunity 项目源码 文件源码
def getScreenshotPath(self,asset):
        if not asset:
            return None
        if not "files" in asset:
            return None

        files = asset["files"]

        r = None

        if "render" in files:
            r = files["render"]
        else:
            if "illustration" in files:
                r = files["illustration"]

        if not r:
            return None

        fn = r.rsplit('/', 1)[-1]

        if not fn:
            return None

        extension = os.path.splitext(fn)[1]

        if not extension:
            return None

        extension = extension.lower()

        filename = "screenshot" + extension
        assetDir = os.path.join(self.root,str(asset["nid"]))
        fullPath = mhapi.locations.getUnicodeAbsPath(os.path.join(assetDir,filename))

        log.debug("Screenshot path: " + fullPath)

        return fullPath
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号