From b01bf9c91fd7a0b43e8e9dbb84e31d13b15a9f77 Mon Sep 17 00:00:00 2001 From: Jakub Trllo Date: Fri, 4 Feb 2022 17:03:38 +0100 Subject: [PATCH] all applications can be set on project but custom launch applications are defined in applications lib --- openpype/lib/applications.py | 3 +++ .../ftrack/event_handlers_user/action_applications.py | 8 ++++++-- openpype/settings/entities/enum_entity.py | 8 -------- openpype/tools/launcher/models.py | 11 +++++++++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/openpype/lib/applications.py b/openpype/lib/applications.py index a704c3ae68..aa37abfdd3 100644 --- a/openpype/lib/applications.py +++ b/openpype/lib/applications.py @@ -44,6 +44,9 @@ _logger = None PLATFORM_NAMES = {"windows", "linux", "darwin"} DEFAULT_ENV_SUBGROUP = "standard" +CUSTOM_LAUNCH_APP_GROUPS = { + "djvview" +} def parse_environments(env_data, env_group=None, platform_name=None): diff --git a/openpype/modules/default_modules/ftrack/event_handlers_user/action_applications.py b/openpype/modules/default_modules/ftrack/event_handlers_user/action_applications.py index 6d45d43958..48a0dea006 100644 --- a/openpype/modules/default_modules/ftrack/event_handlers_user/action_applications.py +++ b/openpype/modules/default_modules/ftrack/event_handlers_user/action_applications.py @@ -2,10 +2,11 @@ import os from uuid import uuid4 from openpype_modules.ftrack.lib import BaseAction -from openpype.lib import ( +from openpype.lib.applications import ( ApplicationManager, ApplicationLaunchFailed, - ApplictionExecutableNotFound + ApplictionExecutableNotFound, + CUSTOM_LAUNCH_APP_GROUPS ) from avalon.api import AvalonMongoDB @@ -136,6 +137,9 @@ class AppplicationsAction(BaseAction): if not app or not app.enabled: continue + if app.group.name in CUSTOM_LAUNCH_APP_GROUPS: + continue + app_icon = app.icon if app_icon and self.icon_url: try: diff --git a/openpype/settings/entities/enum_entity.py b/openpype/settings/entities/enum_entity.py index 54e09cd823..010377426a 100644 --- a/openpype/settings/entities/enum_entity.py +++ b/openpype/settings/entities/enum_entity.py @@ -266,11 +266,6 @@ class AppsEnumEntity(BaseEnumEntity): """Enum of applications for project anatomy attributes.""" schema_types = ["apps-enum"] - _skip_app_groups = [ - # DJV make sense to be launched on representation level - "djvview" - ] - def _item_initialization(self): self.multiselection = True self.value_on_not_set = [] @@ -290,9 +285,6 @@ class AppsEnumEntity(BaseEnumEntity): if enabled_entity and not enabled_entity.value: continue - if app_group.key in self._skip_app_groups: - continue - group_label = app_group["label"].value variants_entity = app_group["variants"] for variant_name, variant_entity in variants_entity.items(): diff --git a/openpype/tools/launcher/models.py b/openpype/tools/launcher/models.py index 6ade9d33ed..02aeb094e3 100644 --- a/openpype/tools/launcher/models.py +++ b/openpype/tools/launcher/models.py @@ -15,8 +15,12 @@ from .constants import ( from .actions import ApplicationAction from Qt import QtCore, QtGui from avalon.vendor import qtawesome -from avalon import style, api -from openpype.lib import ApplicationManager, JSONSettingRegistry +from avalon import api +from openpype.lib import JSONSettingRegistry +from openpype.lib.applications import ( + CUSTOM_LAUNCH_APP_GROUPS, + ApplicationManager +) log = logging.getLogger(__name__) @@ -72,6 +76,9 @@ class ActionModel(QtGui.QStandardItemModel): if not app or not app.enabled: continue + if app.group.name in CUSTOM_LAUNCH_APP_GROUPS: + continue + # Get from app definition, if not there from app in project action = type( "app_{}".format(app_name),