mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
delivery is using guery functions
This commit is contained in:
parent
f5cceb3e05
commit
bc2f8387fe
1 changed files with 9 additions and 13 deletions
|
|
@ -3,8 +3,9 @@ from collections import defaultdict
|
|||
|
||||
from Qt import QtWidgets, QtCore, QtGui
|
||||
|
||||
from openpype.client import get_representations
|
||||
from openpype.lib import config
|
||||
from openpype.pipeline import load, AvalonMongoDB, Anatomy
|
||||
from openpype.pipeline import load, Anatomy
|
||||
from openpype import resources, style
|
||||
|
||||
from openpype.lib.delivery import (
|
||||
|
|
@ -68,17 +69,13 @@ class DeliveryOptionsDialog(QtWidgets.QDialog):
|
|||
|
||||
self.setStyleSheet(style.load_stylesheet())
|
||||
|
||||
project = contexts[0]["project"]["name"]
|
||||
self.anatomy = Anatomy(project)
|
||||
project_name = contexts[0]["project"]["name"]
|
||||
self.anatomy = Anatomy(project_name)
|
||||
self._representations = None
|
||||
self.log = log
|
||||
self.currently_uploaded = 0
|
||||
|
||||
self.dbcon = AvalonMongoDB()
|
||||
self.dbcon.Session["AVALON_PROJECT"] = project
|
||||
self.dbcon.install()
|
||||
|
||||
self._set_representations(contexts)
|
||||
self._set_representations(project_name, contexts)
|
||||
|
||||
dropdown = QtWidgets.QComboBox()
|
||||
self.templates = self._get_templates(self.anatomy)
|
||||
|
|
@ -238,13 +235,12 @@ class DeliveryOptionsDialog(QtWidgets.QDialog):
|
|||
|
||||
return templates
|
||||
|
||||
def _set_representations(self, contexts):
|
||||
def _set_representations(self, project_name, contexts):
|
||||
version_ids = [context["version"]["_id"] for context in contexts]
|
||||
|
||||
repres = list(self.dbcon.find({
|
||||
"type": "representation",
|
||||
"parent": {"$in": version_ids}
|
||||
}))
|
||||
repres = list(get_representations(
|
||||
project_name, version_ids=version_ids
|
||||
))
|
||||
|
||||
self._representations = repres
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue