used is_host attribute to create applications in ftrack

This commit is contained in:
iLLiCiTiT 2020-11-20 19:50:39 +01:00
parent 19a04ea110
commit 1e2c88b1b8
3 changed files with 25 additions and 5 deletions

View file

@ -546,7 +546,13 @@ class ApplicationManager:
label = variant_definitions.get("label") or host_name
variants = variant_definitions.get("variants") or {}
icon = variant_definitions.get("icon")
is_host = variant_definitions.get("is_host", False)
for app_name, app_data in variants.items():
if app_name in self.applications:
raise AssertionError((
"BUG: Duplicated application name in settings \"{}\""
).format(app_name))
# If host is disabled then disable all variants
if not enabled:
app_data["enabled"] = enabled
@ -558,10 +564,9 @@ class ApplicationManager:
if not app_data.get("icon"):
app_data["icon"] = icon
if app_name in self.applications:
raise AssertionError((
"BUG: Duplicated application name in settings \"{}\""
).format(app_name))
is_host = app_data.get("is_host", is_host)
app_data["is_host"] = is_host
self.applications[app_name] = Application(
host_name, app_name, app_data, self
)
@ -661,6 +666,7 @@ class Application:
self.variant_label = app_data.get("variant_label") or None
self.icon = app_data.get("icon") or None
self.enabled = app_data.get("enabled", True)
self.is_host = app_data.get("is_host", False)
executables = app_data["executables"]
if isinstance(executables, dict):

View file

@ -382,7 +382,7 @@ class CustomAttributes(BaseAction):
def app_defs_from_app_manager(self):
app_definitions = []
for app_name, app in self.app_manager.applications.items():
if app.enabled:
if app.enabled and app.is_host:
app_definitions.append({
app_name: app.full_label
})

View file

@ -3,6 +3,7 @@
"enabled": true,
"label": "Autodesk Maya",
"icon": "{}/app_icons/maya.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"maya": [
@ -95,6 +96,7 @@
"enabled": true,
"label": "Nuke",
"icon": "{}/app_icons/nuke.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"nuke": [
@ -176,6 +178,7 @@
"enabled": true,
"label": "Nuke X",
"icon": "{}/app_icons/nuke.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"nukex": [
@ -257,6 +260,7 @@
"enabled": true,
"label": "Nuke Studio",
"icon": "{}/app_icons/nuke.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"nukestudio": [
@ -340,6 +344,7 @@
"enabled": true,
"label": "Hiero",
"icon": "{}/app_icons/hiero.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"hiero": [
@ -425,6 +430,7 @@
"enabled": true,
"label": "BlackMagic Fusion",
"icon": "{}/app_icons/fusion.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"fusion": []
@ -469,6 +475,7 @@
"enabled": true,
"label": "Blackmagic DaVinci Resolve",
"icon": "{}/app_icons/resolve.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"resolve": [
@ -546,6 +553,7 @@
"enabled": true,
"label": "SideFX Houdini",
"icon": "{}/app_icons/houdini.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"houdini": [
@ -603,6 +611,7 @@
"enabled": true,
"label": "Blender",
"icon": "{}/app_icons/blender.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"blender": [
@ -659,6 +668,7 @@
"enabled": true,
"label": "Toon Boom Harmony",
"icon": "{}/app_icons/harmony.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"harmony": [
@ -742,6 +752,7 @@
"enabled": true,
"label": "Adobe Photoshop",
"icon": "{}/app_icons/photoshop.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"photoshop": [
@ -781,6 +792,7 @@
"enabled": true,
"label": "CelAction 2D",
"icon": "app_icons/celaction.png",
"is_host": true,
"environment": {
"__environment_keys__": {
"celaction": [
@ -820,6 +832,7 @@
"enabled": true,
"label": "Unreal Editor",
"icon": "{}/app_icons/ue4.png'",
"is_host": true,
"environment": {
"__environment_keys__": {
"unreal": []
@ -906,6 +919,7 @@
"enabled": true,
"label": "DJV View",
"icon": "{}/app_icons/djvView.png",
"is_host": false,
"environment": {
"__environment_keys__": {
"djvview": []