Update openpype/plugins/load/add_site.py

Co-authored-by: Roy Nieterau <roy_nieterau@hotmail.com>
This commit is contained in:
Petr Kalis 2022-03-31 11:53:58 +02:00 committed by GitHub
parent a0a2e2678e
commit f6fb60bb49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -38,23 +38,20 @@ class AddSyncSite(load.LoaderPlugin):
family = context["representation"]["context"]["family"]
project_name = data["project_name"]
repre_id = data["_id"]
self.add_site_to_representation(project_name,
repre_id,
data["site_name"],
is_main=True)
add_ids = [repre_id]
if family == "workfile":
links = get_linked_ids_for_representations(project_name,
add_ids,
link_type="reference")
add_ids.extend(links)
add_ids = set(add_ids)
self.log.info("Add to repre_ids {}".format(add_ids))
is_main = True
for add_repre_id in add_ids:
self.add_site_to_representation(project_name,
add_repre_id,
data["site_name"],
is_main)
is_main = False
for link_repre_id in links:
self.add_site_to_representation(project_name,
link_repre_id,
data["site_name"],
is_main=False)
self.log.debug("Site added.")