本文整理汇总了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
示例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