mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
Merge pull request #761 from BigRoy/enhancement/publish_collect_ignore_invalid_representation_ids
Publishing collectors: Ignore invalid representation ids
This commit is contained in:
commit
142d875748
2 changed files with 16 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import ayon_api
|
||||
import ayon_api.utils
|
||||
import pyblish.api
|
||||
|
||||
|
||||
|
|
@ -23,6 +24,12 @@ class CollectInputRepresentationsToVersions(pyblish.api.ContextPlugin):
|
|||
if inst_repre:
|
||||
representations.update(inst_repre)
|
||||
|
||||
# Ignore representation ids that are not valid
|
||||
representations = {
|
||||
representation_id for representation_id in representations
|
||||
if ayon_api.utils.convert_entity_id(representation_id)
|
||||
}
|
||||
|
||||
repre_entities = ayon_api.get_representations(
|
||||
project_name=context.data["projectName"],
|
||||
representation_ids=representations,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import ayon_api
|
||||
import pyblish.api
|
||||
import ayon_api.utils
|
||||
|
||||
from ayon_core.pipeline import registered_host
|
||||
import pyblish.api
|
||||
|
||||
|
||||
class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
||||
|
|
@ -41,6 +42,12 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
|||
for container in containers
|
||||
}
|
||||
|
||||
# Ignore representation ids that are not valid
|
||||
repre_ids = {
|
||||
representation_id for representation_id in repre_ids
|
||||
if ayon_api.utils.convert_entity_id(representation_id)
|
||||
}
|
||||
|
||||
project_name = context.data["projectName"]
|
||||
repre_entities = ayon_api.get_representations(
|
||||
project_name,
|
||||
|
|
@ -65,7 +72,7 @@ class CollectSceneLoadedVersions(pyblish.api.ContextPlugin):
|
|||
continue
|
||||
|
||||
# NOTE:
|
||||
# may have more then one representation that are same version
|
||||
# may have more than one representation that are same version
|
||||
version = {
|
||||
"container_name": con["name"],
|
||||
"representation_id": repre_entity["id"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue