mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
Merge pull request #113 from aardschok/FUS-40
Add custom action for manager
This commit is contained in:
commit
dbc42c3631
3 changed files with 28 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import os
|
|||
from avalon import api as avalon
|
||||
from pyblish import api as pyblish
|
||||
|
||||
|
||||
PARENT_DIR = os.path.dirname(__file__)
|
||||
PACKAGE_DIR = os.path.dirname(PARENT_DIR)
|
||||
PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins")
|
||||
|
|
@ -10,6 +11,7 @@ PLUGINS_DIR = os.path.join(PACKAGE_DIR, "plugins")
|
|||
PUBLISH_PATH = os.path.join(PLUGINS_DIR, "fusion", "publish")
|
||||
LOAD_PATH = os.path.join(PLUGINS_DIR, "fusion", "load")
|
||||
CREATE_PATH = os.path.join(PLUGINS_DIR, "fusion", "create")
|
||||
INVENTORY_PATH = os.path.join(PLUGINS_DIR, "fusion", "inventory")
|
||||
|
||||
|
||||
def install():
|
||||
|
|
@ -17,6 +19,7 @@ def install():
|
|||
pyblish.register_plugin_path(PUBLISH_PATH)
|
||||
avalon.register_plugin_path(avalon.Loader, LOAD_PATH)
|
||||
avalon.register_plugin_path(avalon.Creator, CREATE_PATH)
|
||||
avalon.register_plugin_path(avalon.InventoryAction, INVENTORY_PATH)
|
||||
|
||||
pyblish.register_callback("instanceToggled", on_pyblish_instance_toggled)
|
||||
|
||||
|
|
|
|||
25
colorbleed/plugins/fusion/inventory/select_containers.py
Normal file
25
colorbleed/plugins/fusion/inventory/select_containers.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
from avalon import api
|
||||
|
||||
|
||||
class FusionSelectContainers(api.InventoryAction):
|
||||
|
||||
label = "Select Containers"
|
||||
icon = "mouse-pointer"
|
||||
color = "#d8d8d8"
|
||||
|
||||
def process(self, containers):
|
||||
|
||||
import avalon.fusion
|
||||
|
||||
tools = [i["_tool"] for i in containers]
|
||||
|
||||
comp = avalon.fusion.get_current_comp()
|
||||
flow = comp.CurrentFrame.FlowView
|
||||
|
||||
with avalon.fusion.comp_lock_and_undo_chunk(comp, self.label):
|
||||
# Clear selection
|
||||
flow.Select()
|
||||
|
||||
# Select tool
|
||||
for tool in tools:
|
||||
flow.Select(tool)
|
||||
|
|
@ -30,7 +30,6 @@ class Popup(QtWidgets.QDialog):
|
|||
QtWidgets.QSizePolicy.Maximum)
|
||||
show.setStyleSheet("""QPushButton { background-color: #BB0000 }""")
|
||||
|
||||
|
||||
layout.addWidget(message)
|
||||
layout.addWidget(show)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue