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


Python AssetUtils.getThumbnailPath方法代码示例

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


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

示例1: updateVersInfo

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getThumbnailPath [as 别名]
    def updateVersInfo(self):
        try:
            ver = self.versions[int(vers) - 1]
            spec = ueSpec.Spec(proj, grp, asst, elclass, eltype, elname, vers, elpass)

            self.verCreatedBy.setText(ver["created_by"])
            self.verCreatedAt.setText(ueCore.formatDatetime(ver["created_at"]))

            files = glob.glob(os.path.join(ver["path"], ver["file_name"] + "*"))
            self.verFilesList.clear()
            for f in sorted(files):
                self.verFilesList.addItem(QtGui.QListWidgetItem(os.path.basename(f)))

            if "comment" in ver:
                self.verComment.setText(ver["comment"])
            else:
                self.verComment.setText("N/A")

            if "thumbnail" in ver:
                spec = ueSpec.Spec(proj, grp, asst, elclass, eltype, elname, vers)
                f = ueAssetUtils.getThumbnailPath(spec)
                img = QtGui.QImage(f)
                imgs = img.scaled(200, 80, aspectRatioMode=QtCore.Qt.KeepAspectRatio)
                self.verThumb.setPixmap(QtGui.QPixmap.fromImage(imgs))
            else:
                img = QtGui.QImage(os.path.join(os.getenv("UE_PATH"), "lib", "placeholders", "thumbnail.png"))
                imgs = img.scaled(200, 80, aspectRatioMode=QtCore.Qt.KeepAspectRatio)
                self.verThumb.setPixmap(QtGui.QPixmap.fromImage(imgs))
        except IndexError:
            pass
开发者ID:theomission,项目名称:ue,代码行数:32,代码来源:Open.py

示例2: updateElInfo

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getThumbnailPath [as 别名]
 def updateElInfo(self):
     try:
         el = self.elements[elclass][eltype][elname]
         self.elCreatedBy.setText(el["created_by"])
         self.elCreatedAt.setText(ueCore.formatDatetime(el["created_at"]))
         if not el["comment"] == None:
             self.elComment.setText(el["comment"])
         else:
             self.elComment.setText("N/A")
         if not el["thumbnail"] == None:
             spec = ueSpec.Spec(proj, grp, asst, elclass, eltype, elname)
             f = ueAssetUtils.getThumbnailPath(spec)
             img = QtGui.QImage(f)
             imgs = img.scaled(200, 80, aspectRatioMode=QtCore.Qt.KeepAspectRatio)
             self.elThumb.setPixmap(QtGui.QPixmap.fromImage(imgs))
         else:
             img = QtGui.QImage(os.path.join(os.getenv("UE_PATH"), "lib", "placeholders", "thumbnail.png"))
             imgs = img.scaled(200, 80, aspectRatioMode=QtCore.Qt.KeepAspectRatio)
             self.elThumb.setPixmap(QtGui.QPixmap.fromImage(imgs))
     except KeyError:
         pass
开发者ID:theomission,项目名称:ue,代码行数:23,代码来源:Open.py


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