mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Merge pull request #2918 from pypeclub/enhancement/OP-2949_move-pipeline-constants
General: Move pipeline constants to OpenPype
This commit is contained in:
commit
83fd67eb8d
68 changed files with 229 additions and 133 deletions
|
|
@ -1,3 +1,4 @@
|
|||
from bson.objectid import ObjectId
|
||||
|
||||
import pyblish.api
|
||||
from avalon import api, io
|
||||
|
|
@ -35,7 +36,7 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
|||
|
||||
loaded_versions = []
|
||||
_containers = list(host.ls())
|
||||
_repr_ids = [io.ObjectId(c["representation"]) for c in _containers]
|
||||
_repr_ids = [ObjectId(c["representation"]) for c in _containers]
|
||||
version_by_repr = {
|
||||
str(doc["_id"]): doc["parent"] for doc in
|
||||
io.find({"_id": {"$in": _repr_ids}}, projection={"parent": 1})
|
||||
|
|
@ -46,7 +47,7 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
|||
# may have more then one representation that are same version
|
||||
version = {
|
||||
"subsetName": con["name"],
|
||||
"representation": io.ObjectId(con["representation"]),
|
||||
"representation": ObjectId(con["representation"]),
|
||||
"version": version_by_repr[con["representation"]], # _id
|
||||
}
|
||||
loaded_versions.append(version)
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import clique
|
|||
import errno
|
||||
import shutil
|
||||
|
||||
from bson.objectid import ObjectId
|
||||
from pymongo import InsertOne, ReplaceOne
|
||||
import pyblish.api
|
||||
from avalon import api, io, schema
|
||||
|
|
@ -161,7 +162,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
|
|||
if old_version:
|
||||
new_version_id = old_version["_id"]
|
||||
else:
|
||||
new_version_id = io.ObjectId()
|
||||
new_version_id = ObjectId()
|
||||
|
||||
new_hero_version = {
|
||||
"_id": new_version_id,
|
||||
|
|
@ -384,7 +385,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
|
|||
|
||||
# Create representation
|
||||
else:
|
||||
repre["_id"] = io.ObjectId()
|
||||
repre["_id"] = ObjectId()
|
||||
bulk_writes.append(
|
||||
InsertOne(repre)
|
||||
)
|
||||
|
|
@ -420,7 +421,7 @@ class IntegrateHeroVersion(pyblish.api.InstancePlugin):
|
|||
|
||||
else:
|
||||
repre["old_id"] = repre["_id"]
|
||||
repre["_id"] = io.ObjectId()
|
||||
repre["_id"] = ObjectId()
|
||||
repre["type"] = "archived_representation"
|
||||
bulk_writes.append(
|
||||
InsertOne(repre)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
from collections import OrderedDict
|
||||
from avalon import io
|
||||
|
||||
from bson.objectid import ObjectId
|
||||
import pyblish.api
|
||||
|
||||
from avalon import io
|
||||
|
||||
|
||||
class IntegrateInputLinks(pyblish.api.ContextPlugin):
|
||||
"""Connecting version level dependency links"""
|
||||
|
|
@ -104,7 +106,7 @@ class IntegrateInputLinks(pyblish.api.ContextPlugin):
|
|||
# future.
|
||||
link = OrderedDict()
|
||||
link["type"] = link_type
|
||||
link["id"] = io.ObjectId(input_id)
|
||||
link["id"] = ObjectId(input_id)
|
||||
link["linkedBy"] = "publish"
|
||||
|
||||
if "inputLinks" not in version_doc["data"]:
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import six
|
|||
import re
|
||||
import shutil
|
||||
|
||||
from bson.objectid import ObjectId
|
||||
from pymongo import DeleteOne, InsertOne
|
||||
import pyblish.api
|
||||
from avalon import io
|
||||
|
|
@ -294,7 +295,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
bulk_writes.append(DeleteOne({"_id": repre_id}))
|
||||
|
||||
repre["orig_id"] = repre_id
|
||||
repre["_id"] = io.ObjectId()
|
||||
repre["_id"] = ObjectId()
|
||||
repre["type"] = "archived_representation"
|
||||
bulk_writes.append(InsertOne(repre))
|
||||
|
||||
|
|
@ -573,7 +574,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
|
||||
# Create new id if existing representations does not match
|
||||
if repre_id is None:
|
||||
repre_id = io.ObjectId()
|
||||
repre_id = ObjectId()
|
||||
|
||||
data = repre.get("data") or {}
|
||||
data.update({'path': dst, 'template': template})
|
||||
|
|
@ -782,7 +783,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
families = [instance.data["family"]]
|
||||
families.extend(instance.data.get("families", []))
|
||||
io.update_many(
|
||||
{"type": "subset", "_id": io.ObjectId(subset["_id"])},
|
||||
{"type": "subset", "_id": ObjectId(subset["_id"])},
|
||||
{"$set": {"data.families": families}}
|
||||
)
|
||||
|
||||
|
|
@ -807,7 +808,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
if subset_group:
|
||||
io.update_many({
|
||||
'type': 'subset',
|
||||
'_id': io.ObjectId(subset_id)
|
||||
'_id': ObjectId(subset_id)
|
||||
}, {'$set': {'data.subsetGroup': subset_group}})
|
||||
|
||||
def _get_subset_group(self, instance):
|
||||
|
|
@ -1054,7 +1055,7 @@ class IntegrateAssetNew(pyblish.api.InstancePlugin):
|
|||
sync_project_presets = None
|
||||
|
||||
rec = {
|
||||
"_id": io.ObjectId(),
|
||||
"_id": ObjectId(),
|
||||
"path": path
|
||||
}
|
||||
if size:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue