reorganized code a little bit

This commit is contained in:
Jakub Trllo 2022-04-22 18:27:39 +02:00
parent 7c46088644
commit a5826ae336

View file

@ -38,9 +38,13 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
loaded_versions = []
_containers = list(host.ls())
_repr_ids = [ObjectId(c["representation"]) for c in _containers]
repre_docs = io.find(
{"_id": {"$in": _repr_ids}},
projection={"_id": 1, "parent": 1}
)
version_by_repr = {
str(doc["_id"]): doc["parent"] for doc in
io.find({"_id": {"$in": _repr_ids}}, projection={"parent": 1})
str(doc["_id"]): doc["parent"]
for doc in repre_docs
}
# QUESTION should we add same representation id when loaded multiple