mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
use first representation in action item collection
This commit is contained in:
parent
917c4e317c
commit
eedd982a84
1 changed files with 6 additions and 3 deletions
|
|
@ -39,12 +39,15 @@ class CopyFileActionPlugin(LoaderActionPlugin):
|
||||||
repre_ids_by_name[repre["name"]].add(repre["id"])
|
repre_ids_by_name[repre["name"]].add(repre["id"])
|
||||||
|
|
||||||
for repre_name, repre_ids in repre_ids_by_name.items():
|
for repre_name, repre_ids in repre_ids_by_name.items():
|
||||||
|
repre_id = next(iter(repre_ids), None)
|
||||||
|
if not repre_id:
|
||||||
|
continue
|
||||||
output.append(
|
output.append(
|
||||||
LoaderActionItem(
|
LoaderActionItem(
|
||||||
label=repre_name,
|
label=repre_name,
|
||||||
group_label="Copy file path",
|
group_label="Copy file path",
|
||||||
data={
|
data={
|
||||||
"representation_ids": list(repre_ids),
|
"representation_id": repre_id,
|
||||||
"action": "copy-path",
|
"action": "copy-path",
|
||||||
},
|
},
|
||||||
icon={
|
icon={
|
||||||
|
|
@ -59,7 +62,7 @@ class CopyFileActionPlugin(LoaderActionPlugin):
|
||||||
label=repre_name,
|
label=repre_name,
|
||||||
group_label="Copy file",
|
group_label="Copy file",
|
||||||
data={
|
data={
|
||||||
"representation_ids": list(repre_ids),
|
"representation_id": repre_id,
|
||||||
"action": "copy-file",
|
"action": "copy-file",
|
||||||
},
|
},
|
||||||
icon={
|
icon={
|
||||||
|
|
@ -80,7 +83,7 @@ class CopyFileActionPlugin(LoaderActionPlugin):
|
||||||
from qtpy import QtWidgets, QtCore
|
from qtpy import QtWidgets, QtCore
|
||||||
|
|
||||||
action = data["action"]
|
action = data["action"]
|
||||||
repre_id = next(iter(data["representation_ids"]))
|
repre_id = data["representation_id"]
|
||||||
repre = next(iter(selection.entities.get_representations({repre_id})))
|
repre = next(iter(selection.entities.get_representations({repre_id})))
|
||||||
path = get_representation_path_with_anatomy(
|
path = get_representation_path_with_anatomy(
|
||||||
repre, selection.get_project_anatomy()
|
repre, selection.get_project_anatomy()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue