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


Python AssetUtils.getAssetsList方法代码示例

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


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

示例1: listAssets

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
def listAssets():
    for asset in sorted(ueAssetUtils.getAssetsList(settings["spec"])):
        settings["spec"].asst = asset
        asset = ueAssetUtils.getAsset(settings["spec"])
        printLine = asset["name"]
        if "paths" in settings:
            printLine += " -> %s" % asset["path"]
        print printLine
开发者ID:hdd,项目名称:ue,代码行数:10,代码来源:ueListAssets.py

示例2: loadAssets

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
 def loadAssets(self):
     global grp
     grp = str(self.grpMenu.currentText())
     spec = ueSpec.Spec(proj, grp)
     al = sorted(ueAssetUtils.getAssetsList(spec))
     self.asstMenu.clear()
     for a in al:
         self.asstMenu.addItem(a)
     self.loadElements()
开发者ID:hdd,项目名称:ue,代码行数:11,代码来源:Save.py

示例3: __init__

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
    def __init__(self, spec=ueSpec.Context().spec, parent=None):
        QtGui.QDockWidget.__init__(self, parent)

        self.parent = parent
        self.spec = spec

        self.assetsWidget = QtGui.QTreeWidget()

        self.mainWidget = QtGui.QWidget()
        self.mainWidget.setLayout(QtGui.QVBoxLayout())
        self.mainWidget.layout().addWidget(self.assetsWidget)

        self.setWidget(self.mainWidget)
        self.setWindowTitle("Assets")

        for group in ueAssetUtils.getGroupsList(self.spec):
            groupItem = QtGui.QTreeWidgetItem(self.assetsWidget)
            groupItem.setText(0, group)
            self.spec.grp = group
            for asset in ueAssetUtils.getAssetsList(self.spec):
                assetItem = QtGui.QTreeWidgetItem(groupItem)
                assetItem.setText(0, asset)
                self.spec.asst = asset
开发者ID:hdd,项目名称:ue,代码行数:25,代码来源:EditUI.py

示例4: changeAsset

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
def changeAsset():
    spec = ueSpec.Spec(sys.argv[-1])

    if not spec.proj in ueAssetUtils.getProjectsList():
        print "ERROR: Project does not exist"
        sys.exit(2)

    if not spec.grp in ueAssetUtils.getGroupsList(spec):
        print "ERROR: Group does not exist"
        sys.exit(2)

    if not spec.asst in ueAssetUtils.getAssetsList(spec):
        print "ERROR: Asset does not exist"
        sys.exit(2)

    project = ueAssetUtils.getProject(spec)
    asset = ueAssetUtils.getAsset(spec)

    print "export PROJ=%s; " % spec.proj
    print "export GRP=%s; " % spec.grp
    print "export ASST=%s; " % spec.asst
    print "export PROJ_ROOT=%s; " % project["path"]
    print "export ASST_ROOT=%s" % asset["path"]
开发者ID:hdd,项目名称:ue,代码行数:25,代码来源:ueSetProject.py

示例5: __init__

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        global proj, grp, asst, elclass, eltype, elname
        global comment, thumbnail

        self.elclasses = elclasses

        proj = os.getenv("PROJ")
        grp = os.getenv("GRP")
        asst = os.getenv("ASST")
        elclass = None
        eltype = None
        elname = None
        comment = None
        thumbnail = None

        self.setLayout(QtGui.QGridLayout())
        self.layout().setContentsMargins(2, 2, 2, 2)
        self.layout().setSpacing(2)

        self.projMenu = QtGui.QComboBox()
        self.grpMenu = QtGui.QComboBox()
        self.asstMenu = QtGui.QComboBox()
        self.elclassMenu = QtGui.QComboBox()
        self.eltypeMenu = QtGui.QComboBox()
        self.eltypeBox = QtGui.QLineEdit()
        self.elnameMenu = QtGui.QComboBox()
        self.elnameBox = QtGui.QLineEdit()
        self.commentBox = QtGui.QTextEdit()
        self.thumbnailBox = QtGui.QScrollArea()

        self.thumbnailBox.setFixedHeight(160)

        pl = sorted(ueAssetUtils.getProjectsList())
        for p in pl:
            self.projMenu.addItem(p)
        self.projMenu.setCurrentIndex(pl.index(proj))

        gl = sorted(ueAssetUtils.getGroupsList(ueSpec.Spec(proj)))
        for g in gl:
            self.grpMenu.addItem(g)
        self.grpMenu.setCurrentIndex(gl.index(grp))

        al = sorted(ueAssetUtils.getAssetsList(ueSpec.Spec(proj, grp)))
        for a in al:
            self.asstMenu.addItem(a)
        self.asstMenu.setCurrentIndex(al.index(asst))

        for c in sorted(self.elclasses):
            self.elclassMenu.addItem(c)
        elclass = str(self.elclassMenu.currentText())

        self.elements = ueAssetUtils.getElements(ueSpec.Spec(proj, grp, asst))

        if elclass in sorted(self.elements):
            for t in self.elements[elclass]:
                self.eltypeMenu.addItem(t)
            eltype = str(self.eltypeMenu.currentText())

            if eltype in self.elements[elclass]:
                for n in sorted(self.elements[elclass][eltype]):
                    self.elnameMenu.addItem(n)
                elname = str(self.elnameMenu.currentText())

        t = QtGui.QWidget()
        t.setLayout(QtGui.QHBoxLayout())

        self.thumbnailButtons = []
        for f in glob.glob(os.path.join(os.getenv("ASST_ROOT"), "tmp", "ueSaveThumbs_*.png")):
            w = QtGui.QWidget()
            w.setLayout(QtGui.QVBoxLayout())

            name = os.path.basename(f).lstrip("ueSaveThumbs_").rstrip(".png")

            label = QtGui.QLabel()
            img = QtGui.QImage(f)
            imgs = img.scaled(250, 80, aspectRatioMode=QtCore.Qt.KeepAspectRatio)
            label.setPixmap(QtGui.QPixmap.fromImage(imgs))
            radio = QtGui.QRadioButton(name)

            self.thumbnailButtons.append(radio)

            radio.toggled.connect(self.loadThumbnail)

            w.layout().addWidget(label)
            w.layout().addWidget(radio)

            t.layout().addWidget(w)

        self.thumbnailBox.setWidget(t)

        asstBox = QtGui.QGroupBox("Asset")
        asstBox.setLayout(QtGui.QHBoxLayout())

        asstBox.layout().addWidget(QtGui.QLabel("Project"))
        asstBox.layout().addWidget(self.projMenu)
        asstBox.layout().addWidget(QtGui.QLabel("Group"))
        asstBox.layout().addWidget(self.grpMenu)
        asstBox.layout().addWidget(QtGui.QLabel("Asset"))
#.........这里部分代码省略.........
开发者ID:hdd,项目名称:ue,代码行数:103,代码来源:Save.py

示例6: printTree

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
def printTree():
    if "spec" not in info:
        print "ERROR: Spec not set"
        sys.exit(2)

    spec = ueSpec.Spec(info["spec"])

    print "Asset tree on asset:"
    print spec
    print "|"

    groups = ueAssetUtils.getGroupsList(spec)
    lastGroup = "|"
    for g, group in enumerate(sorted(groups)):
        spec.grp = group
        group = ueAssetUtils.getGroup(spec)
        if g == len(groups) - 1:
            lastGroup = " "
        groupSpaceCount = 34
        printLine = "+-+-> %s" % group["name"]
        printLine += (groupSpaceCount - len(printLine)) * " "
        if info["time"]:
            printLine += "%s - %s" % (str(group["startFrame"]), str(group["endFrame"]))
            groupSpaceCount += 10
            printLine += (groupSpaceCount - len(printLine)) * " "
        if info["path"]:
            printLine += group["path"]
            groupSpaceCount += 30
            printLine += (groupSpaceCount - len(printLine)) * " "
        if info["date"]:
            printLine += "%s, %s" % (
                ueCore.formatDatetime(group["created_at"]),
                ueCore.formatDatetime(group["updated_at"]),
            )
            groupSpaceCount += 38
            printLine += (groupSpaceCount - len(printLine)) * " "
        if info["user"]:
            printLine += group["created_by"]
        print printLine
        assets = ueAssetUtils.getAssetsList(spec)
        for asset in sorted(assets):
            spec.asst = asset
            asset = ueAssetUtils.getAsset(spec)
            assetSpaceCount = 34
            printLine = "%s +---> %s" % (lastGroup, asset["name"])
            printLine += (assetSpaceCount - len(printLine)) * " "
            if info["time"]:
                printLine += "%s - %s" % (str(asset["startFrame"]), str(asset["endFrame"]))
                assetSpaceCount += 10
                printLine += (assetSpaceCount - len(printLine)) * " "
            if info["path"]:
                printLine += group["path"]
                assetSpaceCount += 30
                printLine += (assetSpaceCount - len(printLine)) * " "
            if info["date"]:
                printLine += "%s, %s" % (
                    ueCore.formatDatetime(asset["created_at"]),
                    ueCore.formatDatetime(asset["updated_at"]),
                )
                assetSpaceCount += 38
                printLine += (assetSpaceCount - len(printLine)) * " "
            if info["user"]:
                printLine += asset["created_by"]
            print printLine

    print ""
开发者ID:theomission,项目名称:ue,代码行数:68,代码来源:ueTree.py

示例7: loadAssets

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
 def loadAssets(self):
     assets = sorted(ueAssetUtils.getAssetsList(self.spec))
     self.clear()
     self.addItems(assets)
开发者ID:hdd,项目名称:ue,代码行数:6,代码来源:AssetWidgets.py

示例8: __init__

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        global proj, grp, asst, elclass, eltype, elname, vers, elpass

        self.elclasses = elclasses

        proj = os.getenv("PROJ")
        grp = os.getenv("GRP")
        asst = os.getenv("ASST")
        elclass = None
        eltype = None
        elname = None
        vers = None
        elpass = None

        self.setLayout(QtGui.QGridLayout())
        self.layout().setContentsMargins(2, 2, 2, 2)
        self.layout().setSpacing(2)

        self.projMenu = QtGui.QComboBox()
        self.grpMenu = QtGui.QComboBox()
        self.asstMenu = QtGui.QComboBox()
        self.elclassMenu = QtGui.QComboBox()
        self.eltypeList = QtGui.QListWidget()
        self.elnameList = QtGui.QListWidget()
        self.versList = QtGui.QListWidget()

        self.passList = QtGui.QListWidget()

        self.elCreatedBy = QtGui.QLabel("N/A")
        self.elCreatedAt = QtGui.QLabel("N/A")
        self.elComment = QtGui.QLabel("N/A")
        self.elThumb = QtGui.QLabel()

        self.verCreatedBy = QtGui.QLabel("N/A")
        self.verCreatedAt = QtGui.QLabel("N/A")
        self.verComment = QtGui.QLabel("N/A")
        self.verThumb = QtGui.QLabel()
        self.verFilesList = QtGui.QListWidget()

        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))
        self.verThumb.setPixmap(QtGui.QPixmap.fromImage(imgs))

        pl = sorted(ueAssetUtils.getProjectsList())
        for p in pl:
            self.projMenu.addItem(p)
        self.projMenu.setCurrentIndex(pl.index(proj))

        gl = sorted(ueAssetUtils.getGroupsList(ueSpec.Spec(proj)))
        for g in gl:
            self.grpMenu.addItem(g)
        self.grpMenu.setCurrentIndex(gl.index(grp))

        al = sorted(ueAssetUtils.getAssetsList(ueSpec.Spec(proj, grp)))
        for a in al:
            self.asstMenu.addItem(a)
        self.asstMenu.setCurrentIndex(al.index(asst))

        for c in sorted(self.elclasses):
            self.elclassMenu.addItem(c)
        elclass = str(self.elclassMenu.currentText())

        self.elements = ueAssetUtils.getElements(ueSpec.Spec(proj, grp, asst))

        if elclass in self.elements:
            for t in sorted(self.elements[elclass]):
                self.eltypeList.addItem(QtGui.QListWidgetItem(t))
            self.eltypeList.setCurrentItem(self.eltypeList.item(0))
            eltype = str(self.eltypeList.currentItem().text())

            if eltype in self.elements[elclass]:
                for n in sorted(self.elements[elclass][eltype]):
                    self.elnameList.addItem(QtGui.QListWidgetItem(n))
                self.elnameList.setCurrentItem(self.elnameList.item(0))
                elname = str(self.elnameList.currentItem().text())

                self.updateElInfo()

                self.versions = ueAssetUtils.getVersions(ueSpec.Spec(proj, grp, asst, elclass, eltype, elname))
                if len(self.versions) > 0:
                    for v in sorted(range(len(self.versions)), reverse=True):
                        self.versList.addItem(QtGui.QListWidgetItem("%04d" % int(v + 1)))
                    self.versList.setCurrentItem(self.versList.item(0))
                    vers = int(self.versList.currentItem().text())

                    self.loadPasses()

                    self.updateVersInfo()

        asstBox = QtGui.QGroupBox("Asset")
        asstBox.setLayout(QtGui.QHBoxLayout())

        asstBox.layout().addWidget(QtGui.QLabel("Project"))
        asstBox.layout().addWidget(self.projMenu)
        asstBox.layout().addWidget(QtGui.QLabel("Group"))
        asstBox.layout().addWidget(self.grpMenu)
        asstBox.layout().addWidget(QtGui.QLabel("Asset"))
#.........这里部分代码省略.........
开发者ID:theomission,项目名称:ue,代码行数:103,代码来源:Open.py

示例9: __init__

# 需要导入模块: from ueCore import AssetUtils [as 别名]
# 或者: from ueCore.AssetUtils import getAssetsList [as 别名]
    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)
        self.setLayout(QtGui.QVBoxLayout())
        self.layout().setContentsMargins(2, 2, 2, 2)
        self.layout().setSpacing(2)

        global proj, grp, asst
        global elements

        proj = os.getenv("PROJ")
        grp = os.getenv("GRP")
        asst = os.getenv("ASST")

        self.projMenu = QtGui.QComboBox()
        self.grpMenu = QtGui.QComboBox()
        self.asstMenu = QtGui.QComboBox()

        pl = sorted(ueAssetUtils.getProjectsList())
        for p in pl:
            self.projMenu.addItem(p)
        self.projMenu.setCurrentIndex(pl.index(proj))

        gl = sorted(ueAssetUtils.getGroupsList(ueSpec.Spec(proj)))
        for g in gl:
            self.grpMenu.addItem(g)
        self.grpMenu.setCurrentIndex(gl.index(grp))

        al = sorted(ueAssetUtils.getAssetsList(ueSpec.Spec(proj, grp)))
        for a in al:
            self.asstMenu.addItem(a)
        self.asstMenu.setCurrentIndex(al.index(asst))

        zero = QtGui.QWidget()
        one = QtGui.QWidget()

        zero.setLayout(QtGui.QHBoxLayout())
        zero.layout().setContentsMargins(2, 2, 2, 2)
        zero.layout().setSpacing(2)
        one.setLayout(QtGui.QHBoxLayout())
        one.layout().setContentsMargins(2, 2, 2, 2)
        one.layout().setSpacing(2)

        zero.layout().addWidget(QtGui.QLabel("project"))
        zero.layout().addWidget(self.projMenu)
        zero.layout().addWidget(QtGui.QLabel("group"))
        zero.layout().addWidget(self.grpMenu)
        zero.layout().addWidget(QtGui.QLabel("asset"))
        zero.layout().addWidget(self.asstMenu)
        zero.layout().addStretch(0)

        tabs = QtGui.QTabWidget()

        elements = ueAssetUtils.getElements(ueSpec.Spec(proj, grp, asst))

        self.animationTab = AnimationTab()
        self.backgroundTab = BackgroundTab()
        self.renderTab = RenderTab()

        tabs.addTab(self.animationTab, "Animation")
        tabs.addTab(self.backgroundTab, "Background")
        tabs.addTab(self.renderTab, "Render")

        one.layout().addWidget(tabs)

        self.layout().addWidget(zero)
        self.layout().addWidget(one)

        self.projMenu.activated.connect(self.loadGroups)
        self.grpMenu.activated.connect(self.loadAssets)
        self.asstMenu.activated.connect(self.loadElements)
开发者ID:theomission,项目名称:ue,代码行数:72,代码来源:Read.py


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