mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
Support collecting all items when nothing is selected.
This commit is contained in:
parent
3715600594
commit
7a9d288044
1 changed files with 12 additions and 2 deletions
|
|
@ -2,6 +2,7 @@ import pyblish.api
|
|||
|
||||
import hiero
|
||||
|
||||
|
||||
class CollectSelection(pyblish.api.ContextPlugin):
|
||||
"""Inject the selection in the context."""
|
||||
|
||||
|
|
@ -9,7 +10,16 @@ class CollectSelection(pyblish.api.ContextPlugin):
|
|||
label = "Selection"
|
||||
|
||||
def process(self, context):
|
||||
selection = getattr(hiero, "selection")
|
||||
selection = list(hiero.selection)
|
||||
|
||||
self.log.debug("selection: {}".format(selection))
|
||||
context.data["selection"] = hiero.selection
|
||||
|
||||
if not selection:
|
||||
self.log.debug(
|
||||
"Nothing is selected. Collecting all items from sequence "
|
||||
"\"{}\"".format(hiero.ui.activeSequence())
|
||||
)
|
||||
for track in hiero.ui.activeSequence().items():
|
||||
selection.extend(track.items())
|
||||
|
||||
context.data["selection"] = selection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue