mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 08:24:53 +01:00
General: Filter available applications (#4667)
* added project settings for applications * filter applications by new settings in launcher and ftrack * disable filtering by default
This commit is contained in:
parent
c5ead7548c
commit
c8c31018d6
5 changed files with 36 additions and 0 deletions
|
|
@ -124,6 +124,11 @@ class AppplicationsAction(BaseAction):
|
||||||
if not avalon_project_apps:
|
if not avalon_project_apps:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
settings = self.get_project_settings_from_event(
|
||||||
|
event, avalon_project_doc["name"])
|
||||||
|
|
||||||
|
only_available = settings["applications"]["only_available"]
|
||||||
|
|
||||||
items = []
|
items = []
|
||||||
for app_name in avalon_project_apps:
|
for app_name in avalon_project_apps:
|
||||||
app = self.application_manager.applications.get(app_name)
|
app = self.application_manager.applications.get(app_name)
|
||||||
|
|
@ -133,6 +138,10 @@ class AppplicationsAction(BaseAction):
|
||||||
if app.group.name in CUSTOM_LAUNCH_APP_GROUPS:
|
if app.group.name in CUSTOM_LAUNCH_APP_GROUPS:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
# Skip applications without valid executables
|
||||||
|
if only_available and not app.find_executable():
|
||||||
|
continue
|
||||||
|
|
||||||
app_icon = app.icon
|
app_icon = app.icon
|
||||||
if app_icon and self.icon_url:
|
if app_icon and self.icon_url:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"only_available": false
|
||||||
|
}
|
||||||
|
|
@ -82,6 +82,10 @@
|
||||||
"type": "schema",
|
"type": "schema",
|
||||||
"name": "schema_project_slack"
|
"name": "schema_project_slack"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "schema",
|
||||||
|
"name": "schema_project_applications"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "schema",
|
"type": "schema",
|
||||||
"name": "schema_project_max"
|
"name": "schema_project_max"
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
{
|
||||||
|
"type": "dict",
|
||||||
|
"key": "applications",
|
||||||
|
"label": "Applications",
|
||||||
|
"collapsible": true,
|
||||||
|
"is_file": true,
|
||||||
|
"children": [
|
||||||
|
{
|
||||||
|
"type": "boolean",
|
||||||
|
"key": "only_available",
|
||||||
|
"label": "Show only available applications"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
@ -19,6 +19,7 @@ from openpype.lib.applications import (
|
||||||
CUSTOM_LAUNCH_APP_GROUPS,
|
CUSTOM_LAUNCH_APP_GROUPS,
|
||||||
ApplicationManager
|
ApplicationManager
|
||||||
)
|
)
|
||||||
|
from openpype.settings import get_project_settings
|
||||||
from openpype.pipeline import discover_launcher_actions
|
from openpype.pipeline import discover_launcher_actions
|
||||||
from openpype.tools.utils.lib import (
|
from openpype.tools.utils.lib import (
|
||||||
DynamicQThread,
|
DynamicQThread,
|
||||||
|
|
@ -94,6 +95,8 @@ class ActionModel(QtGui.QStandardItemModel):
|
||||||
if not project_doc:
|
if not project_doc:
|
||||||
return actions
|
return actions
|
||||||
|
|
||||||
|
project_settings = get_project_settings(project_name)
|
||||||
|
only_available = project_settings["applications"]["only_available"]
|
||||||
self.application_manager.refresh()
|
self.application_manager.refresh()
|
||||||
for app_def in project_doc["config"]["apps"]:
|
for app_def in project_doc["config"]["apps"]:
|
||||||
app_name = app_def["name"]
|
app_name = app_def["name"]
|
||||||
|
|
@ -104,6 +107,9 @@ class ActionModel(QtGui.QStandardItemModel):
|
||||||
if app.group.name in CUSTOM_LAUNCH_APP_GROUPS:
|
if app.group.name in CUSTOM_LAUNCH_APP_GROUPS:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if only_available and not app.find_executable():
|
||||||
|
continue
|
||||||
|
|
||||||
# Get from app definition, if not there from app in project
|
# Get from app definition, if not there from app in project
|
||||||
action = type(
|
action = type(
|
||||||
"app_{}".format(app_name),
|
"app_{}".format(app_name),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue