mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
Refactor - use values from context if available
Remove unnecessary keys from data
This commit is contained in:
parent
60c6a61779
commit
6894e17bbc
2 changed files with 32 additions and 17 deletions
|
|
@ -1468,23 +1468,21 @@ class RepresentationWidget(QtWidgets.QWidget):
|
|||
repre_ids = []
|
||||
data_by_repre_id = {}
|
||||
selected_side = action_representation.get("selected_side")
|
||||
site_name = "{}_site_name".format(selected_side)
|
||||
|
||||
is_sync_loader = tools_lib.is_sync_loader(loader)
|
||||
for item in items:
|
||||
item_id = item.get("_id")
|
||||
repre_ids.append(item_id)
|
||||
repre_id = item["_id"]
|
||||
repre_ids.append(repre_id)
|
||||
if not is_sync_loader:
|
||||
continue
|
||||
|
||||
site_name = "{}_site_name".format(selected_side)
|
||||
data_site_name = item.get(site_name)
|
||||
if not data_site_name:
|
||||
continue
|
||||
|
||||
data_by_repre_id[item_id] = {
|
||||
"_id": item_id,
|
||||
"site_name": data_site_name,
|
||||
"project_name": self.dbcon.active_project()
|
||||
data_by_repre_id[repre_id] = {
|
||||
"site_name": data_site_name
|
||||
}
|
||||
|
||||
repre_contexts = get_repres_contexts(repre_ids, self.dbcon)
|
||||
|
|
@ -1574,8 +1572,8 @@ def _load_representations_by_loader(loader, repre_contexts,
|
|||
version_name = version_doc.get("name")
|
||||
try:
|
||||
if data_by_repre_id:
|
||||
_id = repre_context["representation"]["_id"]
|
||||
data = data_by_repre_id.get(_id)
|
||||
repre_id = repre_context["representation"]["_id"]
|
||||
data = data_by_repre_id.get(repre_id)
|
||||
options.update(data)
|
||||
load_with_repre_context(
|
||||
loader,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue