mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-27 06:12:19 +01:00
Flame: testing passing selection from timeline
This commit is contained in:
parent
07771a4052
commit
f38e4ce44c
3 changed files with 25 additions and 7 deletions
|
|
@ -51,6 +51,7 @@ INVENTORY_PATH = os.path.join(PLUGINS_DIR, "inventory")
|
|||
|
||||
app_framework = None
|
||||
apps = []
|
||||
selection = None
|
||||
|
||||
|
||||
__all__ = [
|
||||
|
|
@ -65,6 +66,7 @@ __all__ = [
|
|||
|
||||
"app_framework",
|
||||
"apps",
|
||||
"selection",
|
||||
|
||||
# pipeline
|
||||
"install",
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ from copy import deepcopy
|
|||
from .lib import rescan_hooks
|
||||
from openpype.tools.utils.host_tools import HostToolsHelper
|
||||
|
||||
|
||||
menu_group_name = 'OpenPype'
|
||||
|
||||
default_flame_export_presets = {
|
||||
|
|
@ -16,6 +15,10 @@ default_flame_export_presets = {
|
|||
'Thumbnail': {'PresetVisibility': 3, 'PresetType': 0, 'PresetFile': 'Generate Thumbnail.xml'}
|
||||
}
|
||||
|
||||
def send_selection(selection):
|
||||
import openpype.hosts.flame as opflame
|
||||
opflame.selection = selection
|
||||
print(opflame.selection)
|
||||
|
||||
class _FlameMenuApp(object):
|
||||
def __init__(self, framework):
|
||||
|
|
@ -99,10 +102,12 @@ class FlameMenuProjectconnect(_FlameMenuApp):
|
|||
})
|
||||
menu['actions'].append({
|
||||
"name": "Create ...",
|
||||
"isVisible": send_selection,
|
||||
"execute": lambda x: self.tools_helper.show_creator()
|
||||
})
|
||||
menu['actions'].append({
|
||||
"name": "Publish ...",
|
||||
"isVisible": send_selection,
|
||||
"execute": lambda x: self.tools_helper.show_publish()
|
||||
})
|
||||
menu['actions'].append({
|
||||
|
|
@ -119,9 +124,6 @@ class FlameMenuProjectconnect(_FlameMenuApp):
|
|||
})
|
||||
return menu
|
||||
|
||||
def get_projects(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def refresh(self, *args, **kwargs):
|
||||
self.rescan()
|
||||
|
||||
|
|
@ -163,10 +165,12 @@ class FlameMenuTimeline(_FlameMenuApp):
|
|||
|
||||
menu['actions'].append({
|
||||
"name": "Create ...",
|
||||
"isVisible": send_selection,
|
||||
"execute": lambda x: self.tools_helper.show_creator()
|
||||
})
|
||||
menu['actions'].append({
|
||||
"name": "Publish ...",
|
||||
"isVisible": send_selection,
|
||||
"execute": lambda x: self.tools_helper.show_publish()
|
||||
})
|
||||
menu['actions'].append({
|
||||
|
|
@ -180,9 +184,6 @@ class FlameMenuTimeline(_FlameMenuApp):
|
|||
|
||||
return menu
|
||||
|
||||
def get_projects(self, *args, **kwargs):
|
||||
pass
|
||||
|
||||
def refresh(self, *args, **kwargs):
|
||||
self.rescan()
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
import pyblish.api
|
||||
import openpype.hosts.flame as opflame
|
||||
import flame
|
||||
|
||||
@pyblish.api.log
|
||||
class CollectTestSelection(pyblish.api.ContextPlugin):
|
||||
"""testing selection sharing
|
||||
"""
|
||||
|
||||
order = pyblish.api.CollectorOrder
|
||||
label = "test selection"
|
||||
hosts = ["flame"]
|
||||
|
||||
def process(self, context):
|
||||
self.log.info(opflame.selection)
|
||||
Loading…
Add table
Add a link
Reference in a new issue