From 52b1619b50158baa578607600511c3138c929981 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 17:52:50 +0200 Subject: [PATCH 01/17] removed env_group_key from application schemas --- .../system_settings/applications.json | 443 +++--------------- .../host_settings/schema_aftereffects.json | 3 +- .../host_settings/schema_blender.json | 3 +- .../host_settings/schema_celaction.json | 3 +- .../host_settings/schema_djv.json | 3 +- .../host_settings/schema_fusion.json | 3 +- .../host_settings/schema_harmony.json | 3 +- .../host_settings/schema_houdini.json | 3 +- .../host_settings/schema_maya.json | 3 +- .../host_settings/schema_mayabatch.json | 3 +- .../host_settings/schema_photoshop.json | 3 +- .../host_settings/schema_resolve.json | 3 +- .../host_settings/schema_shell.json | 3 +- .../host_settings/schema_tvpaint.json | 3 +- .../host_settings/schema_unreal.json | 3 +- .../host_settings/template_host_variant.json | 3 +- .../host_settings/template_nuke.json | 3 +- 17 files changed, 77 insertions(+), 414 deletions(-) diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index ea910e125d..08e7a16599 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -16,18 +16,7 @@ "MAYA_DISABLE_CER": "Yes", "PYMEL_SKIP_MEL_INIT": "Yes", "LC_ALL": "C", - "PYPE_LOG_NO_COLORS": "Yes", - "__environment_keys__": { - "maya": [ - "PYTHONPATH", - "MAYA_DISABLE_CLIC_IPM", - "MAYA_DISABLE_CIP", - "MAYA_DISABLE_CER", - "PYMEL_SKIP_MEL_INIT", - "LC_ALL", - "PYPE_LOG_NO_COLORS" - ] - } + "PYPE_LOG_NO_COLORS": "Yes" }, "variants": { "maya_2020": { @@ -50,12 +39,7 @@ "linux": [] }, "environment": { - "MAYA_VERSION": "2020", - "__environment_keys__": { - "maya_2020": [ - "MAYA_VERSION" - ] - } + "MAYA_VERSION": "2020" } }, "maya_2019": { @@ -78,12 +62,7 @@ "linux": [] }, "environment": { - "MAYA_VERSION": "2019", - "__environment_keys__": { - "maya_2019": [ - "MAYA_VERSION" - ] - } + "MAYA_VERSION": "2019" } }, "maya_2018": { @@ -106,12 +85,7 @@ "linux": [] }, "environment": { - "MAYA_VERSION": "2018", - "__environment_keys__": { - "maya_2018": [ - "MAYA_VERSION" - ] - } + "MAYA_VERSION": "2018" } } } @@ -134,19 +108,7 @@ "PYMEL_SKIP_MEL_INIT": "Yes", "LC_ALL": "C", "PYPE_LOG_NO_COLORS": "Yes", - "MAYA_TEST": "{MAYA_VERSION}", - "__environment_keys__": { - "mayabatch": [ - "PYTHONPATH", - "MAYA_DISABLE_CLIC_IPM", - "MAYA_DISABLE_CIP", - "MAYA_DISABLE_CER", - "PYMEL_SKIP_MEL_INIT", - "LC_ALL", - "PYPE_LOG_NO_COLORS", - "MAYA_TEST" - ] - } + "MAYA_TEST": "{MAYA_VERSION}" }, "variants": { "mayabatch_2020": { @@ -167,12 +129,7 @@ "linux": [] }, "environment": { - "MAYA_VERSION": "2020", - "__environment_keys__": { - "mayabatch_2020": [ - "MAYA_VERSION" - ] - } + "MAYA_VERSION": "2020" } }, "mayabatch_2019": { @@ -193,12 +150,7 @@ "linux": [] }, "environment": { - "MAYA_VERSION": "2019", - "__environment_keys__": { - "mayabatch_2019": [ - "MAYA_VERSION" - ] - } + "MAYA_VERSION": "2019" } }, "mayabatch_2018": { @@ -219,12 +171,7 @@ "linux": [] }, "environment": { - "MAYA_VERSION": "2018", - "__environment_keys__": { - "mayabatch_2018": [ - "MAYA_VERSION" - ] - } + "MAYA_VERSION": "2018" } } } @@ -243,14 +190,7 @@ "PATH": { "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" }, - "LOGLEVEL": "DEBUG", - "__environment_keys__": { - "nuke": [ - "NUKE_PATH", - "PATH", - "LOGLEVEL" - ] - } + "LOGLEVEL": "DEBUG" }, "variants": { "nuke_12-2": { @@ -272,11 +212,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "nuke_12-2": [] - } - } + "environment": {} }, "nuke_12-0": { "enabled": true, @@ -297,11 +233,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "nuke_12-0": [] - } - } + "environment": {} }, "nuke_11-3": { "enabled": true, @@ -322,11 +254,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "nuke_11-3": [] - } - } + "environment": {} }, "nuke_11-2": { "enabled": true, @@ -345,11 +273,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "nuke_11-2": [] - } - } + "environment": {} } } }, @@ -367,14 +291,7 @@ "PATH": { "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" }, - "LOGLEVEL": "DEBUG", - "__environment_keys__": { - "nukex": [ - "NUKE_PATH", - "PATH", - "LOGLEVEL" - ] - } + "LOGLEVEL": "DEBUG" }, "variants": { "nukex_12-2": { @@ -402,11 +319,7 @@ "--nukex" ] }, - "environment": { - "__environment_keys__": { - "nukex_12-2": [] - } - } + "environment": {} }, "nukex_12-0": { "enabled": true, @@ -433,11 +346,7 @@ "--nukex" ] }, - "environment": { - "__environment_keys__": { - "nukex_12-0": [] - } - } + "environment": {} }, "nukex_11-3": { "enabled": true, @@ -464,11 +373,7 @@ "--nukex" ] }, - "environment": { - "__environment_keys__": { - "nukex_11-3": [] - } - } + "environment": {} }, "nukex_11-2": { "enabled": true, @@ -493,11 +398,7 @@ "--nukex" ] }, - "environment": { - "__environment_keys__": { - "nukex_11-2": [] - } - } + "environment": {} } } }, @@ -515,16 +416,7 @@ }, "WORKFILES_STARTUP": "0", "TAG_ASSETBUILD_STARTUP": "0", - "LOGLEVEL": "DEBUG", - "__environment_keys__": { - "nukestudio": [ - "HIERO_PLUGIN_PATH", - "PATH", - "WORKFILES_STARTUP", - "TAG_ASSETBUILD_STARTUP", - "LOGLEVEL" - ] - } + "LOGLEVEL": "DEBUG" }, "variants": { "nukestudio_12-2": { @@ -552,11 +444,7 @@ "--studio" ] }, - "environment": { - "__environment_keys__": { - "nukestudio_12-2": [] - } - } + "environment": {} }, "nukestudio_12-0": { "enabled": true, @@ -583,11 +471,7 @@ "--studio" ] }, - "environment": { - "__environment_keys__": { - "nukestudio_12-0": [] - } - } + "environment": {} }, "nukestudio_11-3": { "enabled": true, @@ -614,11 +498,7 @@ "--studio" ] }, - "environment": { - "__environment_keys__": { - "nukestudio_11-3": [] - } - } + "environment": {} }, "nukestudio_11-2": { "enabled": true, @@ -641,11 +521,7 @@ "--studio" ] }, - "environment": { - "__environment_keys__": { - "nukestudio_11-2": [] - } - } + "environment": {} } } }, @@ -663,16 +539,7 @@ }, "WORKFILES_STARTUP": "0", "TAG_ASSETBUILD_STARTUP": "0", - "LOGLEVEL": "DEBUG", - "__environment_keys__": { - "hiero": [ - "HIERO_PLUGIN_PATH", - "PATH", - "WORKFILES_STARTUP", - "TAG_ASSETBUILD_STARTUP", - "LOGLEVEL" - ] - } + "LOGLEVEL": "DEBUG" }, "variants": { "hiero_12-2": { @@ -700,11 +567,7 @@ "--hiero" ] }, - "environment": { - "__environment_keys__": { - "hiero_12-2": [] - } - } + "environment": {} }, "hiero_12-0": { "enabled": true, @@ -731,11 +594,7 @@ "--hiero" ] }, - "environment": { - "__environment_keys__": { - "hiero_12-0": [] - } - } + "environment": {} }, "hiero_11-3": { "enabled": true, @@ -762,11 +621,7 @@ "--hiero" ] }, - "environment": { - "__environment_keys__": { - "hiero_11-3": [] - } - } + "environment": {} }, "hiero_11-2": { "enabled": true, @@ -791,11 +646,7 @@ "--hiero" ] }, - "environment": { - "__environment_keys__": { - "hiero_11-2": [] - } - } + "environment": {} } } }, @@ -826,17 +677,7 @@ "{PYTHON36}/Scripts", "{PATH}" ], - "PYPE_LOG_NO_COLORS": "Yes", - "__environment_keys__": { - "fusion": [ - "FUSION_UTILITY_SCRIPTS_SOURCE_DIR", - "FUSION_UTILITY_SCRIPTS_DIR", - "PYTHON36", - "PYTHONPATH", - "PATH", - "PYPE_LOG_NO_COLORS" - ] - } + "PYPE_LOG_NO_COLORS": "Yes" }, "variants": { "fusion_16": { @@ -854,11 +695,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "fusion_16": [] - } - } + "environment": {} }, "fusion_9": { "enabled": true, @@ -877,11 +714,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "fusion_9": [] - } - } + "environment": {} } } }, @@ -926,21 +759,7 @@ ], "PRE_PYTHON_SCRIPT": "{PYPE_ROOT}/pype/resolve/preload_console.py", "PYPE_LOG_NO_COLORS": "True", - "RESOLVE_DEV": "True", - "__environment_keys__": { - "resolve": [ - "RESOLVE_UTILITY_SCRIPTS_SOURCE_DIR", - "RESOLVE_SCRIPT_API", - "RESOLVE_SCRIPT_LIB", - "RESOLVE_UTILITY_SCRIPTS_DIR", - "PYTHON36_RESOLVE", - "PYTHONPATH", - "PATH", - "PRE_PYTHON_SCRIPT", - "PYPE_LOG_NO_COLORS", - "RESOLVE_DEV" - ] - } + "RESOLVE_DEV": "True" }, "variants": { "resolve_16": { @@ -960,11 +779,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "resolve_16": [] - } - } + "environment": {} } } }, @@ -983,12 +798,6 @@ "darwin": "{PYPE_ROOT}/pype/hosts/houdini/startup:&", "linux": "{PYPE_ROOT}/pype/hosts/houdini/startup:&", "windows": "{PYPE_ROOT}/pype/hosts/houdini/startup;&" - }, - "__environment_keys__": { - "houdini": [ - "HOUDINI_PATH", - "HOUDINI_MENU_PATH" - ] } }, "variants": { @@ -1009,11 +818,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "houdini_18-5": [] - } - } + "environment": {} }, "houdini_18": { "enabled": true, @@ -1030,11 +835,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "houdini_18": [] - } - } + "environment": {} }, "houdini_17": { "enabled": true, @@ -1051,11 +852,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "houdini_17": [] - } - } + "environment": {} } } }, @@ -1070,14 +867,7 @@ "{PYPE_REPOS_ROOT}/avalon-core/setup/blender", "{PYTHONPATH}" ], - "CREATE_NEW_CONSOLE": "yes", - "__environment_keys__": { - "blender": [ - "BLENDER_USER_SCRIPTS", - "PYTHONPATH", - "CREATE_NEW_CONSOLE" - ] - } + "CREATE_NEW_CONSOLE": "yes" }, "variants": { "blender_2-83": { @@ -1103,11 +893,7 @@ "--python-use-system-env" ] }, - "environment": { - "__environment_keys__": { - "blender_2-83": [] - } - } + "environment": {} }, "blender_2-90": { "enabled": true, @@ -1132,11 +918,7 @@ "--python-use-system-env" ] }, - "environment": { - "__environment_keys__": { - "blender_2-90": [] - } - } + "environment": {} } } }, @@ -1147,13 +929,7 @@ "host_name": "harmony", "environment": { "AVALON_HARMONY_WORKFILES_ON_LAUNCH": "1", - "LIB_OPENHARMONY_PATH": "{PYPE_ROOT}/pype/vendor/OpenHarmony", - "__environment_keys__": { - "harmony": [ - "AVALON_HARMONY_WORKFILES_ON_LAUNCH", - "LIB_OPENHARMONY_PATH" - ] - } + "LIB_OPENHARMONY_PATH": "{PYPE_ROOT}/pype/vendor/OpenHarmony" }, "variants": { "harmony_20": { @@ -1171,11 +947,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "harmony_20": [] - } - } + "environment": {} }, "harmony_17": { "enabled": true, @@ -1194,11 +966,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "harmony_17": [] - } - } + "environment": {} } } }, @@ -1208,12 +976,7 @@ "icon": "{}/app_icons/tvpaint.png", "host_name": "tvpaint", "environment": { - "PYPE_LOG_NO_COLORS": "True", - "__environment_keys__": { - "tvpaint": [ - "PYPE_LOG_NO_COLORS" - ] - } + "PYPE_LOG_NO_COLORS": "True" }, "variants": { "tvpaint_animation_11-64bits": { @@ -1233,11 +996,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "tvpaint_animation_11-64bits": [] - } - } + "environment": {} }, "tvpaint_animation_11-32bits": { "enabled": true, @@ -1256,11 +1015,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "tvpaint_animation_11-32bits": [] - } - } + "environment": {} } } }, @@ -1273,15 +1028,7 @@ "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH": "1", "PYPE_LOG_NO_COLORS": "Yes", "WEBSOCKET_URL": "ws://localhost:8099/ws/", - "WORKFILES_SAVE_AS": "Yes", - "__environment_keys__": { - "photoshop": [ - "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH", - "PYPE_LOG_NO_COLORS", - "WEBSOCKET_URL", - "WORKFILES_SAVE_AS" - ] - } + "WORKFILES_SAVE_AS": "Yes" }, "variants": { "photoshop_2020": { @@ -1301,11 +1048,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "photoshop_2020": [] - } - } + "environment": {} }, "photoshop_2021": { "enabled": true, @@ -1324,11 +1067,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "photoshop_2021": [] - } - } + "environment": {} } } }, @@ -1341,15 +1080,7 @@ "AVALON_AFTEREFFECTS_WORKFILES_ON_LAUNCH": "1", "PYPE_LOG_NO_COLORS": "Yes", "WEBSOCKET_URL": "ws://localhost:8097/ws/", - "WORKFILES_SAVE_AS": "Yes", - "__environment_keys__": { - "aftereffects": [ - "AVALON_AFTEREFFECTS_WORKFILES_ON_LAUNCH", - "PYPE_LOG_NO_COLORS", - "WEBSOCKET_URL", - "WORKFILES_SAVE_AS" - ] - } + "WORKFILES_SAVE_AS": "Yes" }, "variants": { "aftereffects_2020": { @@ -1369,11 +1100,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "aftereffects_2020": [] - } - } + "environment": {} }, "aftereffects_2021": { "enabled": true, @@ -1392,11 +1119,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "aftereffects_2021": [] - } - } + "environment": {} } } }, @@ -1406,12 +1129,7 @@ "icon": "app_icons/celaction.png", "host_name": "celaction", "environment": { - "CELACTION_TEMPLATE": "{PYPE_ROOT}/pype/hosts/celaction/celaction_template_scene.scn", - "__environment_keys__": { - "celaction": [ - "CELACTION_TEMPLATE" - ] - } + "CELACTION_TEMPLATE": "{PYPE_ROOT}/pype/hosts/celaction/celaction_template_scene.scn" }, "variants": { "celation_Local": { @@ -1425,11 +1143,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "celation_Local": [] - } - } + "environment": {} } } }, @@ -1441,14 +1155,7 @@ "environment": { "AVALON_UNREAL_PLUGIN": "{PYPE_REPOS_ROOT}/avalon-unreal-integration", "PYPE_LOG_NO_COLORS": "True", - "QT_PREFERRED_BINDING": "PySide", - "__environment_keys__": { - "unreal": [ - "AVALON_UNREAL_PLUGIN", - "PYPE_LOG_NO_COLORS", - "QT_PREFERRED_BINDING" - ] - } + "QT_PREFERRED_BINDING": "PySide" }, "variants": { "unreal_4-24": { @@ -1466,21 +1173,13 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "unreal_4-24": [] - } - } + "environment": {} } } }, "shell": { "enabled": true, - "environment": { - "__environment_keys__": { - "shell": [] - } - }, + "environment": {}, "variants": { "python_python_3-7": { "enabled": true, @@ -1497,11 +1196,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "python_python_3-7": [] - } - } + "environment": {} }, "python_python_2-7": { "enabled": true, @@ -1518,11 +1213,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "python_python_2-7": [] - } - } + "environment": {} }, "terminal_terminal": { "enabled": true, @@ -1539,11 +1230,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "terminal_terminal": [] - } - } + "environment": {} } } }, @@ -1552,11 +1239,7 @@ "label": "DJV View", "icon": "{}/app_icons/djvView.png", "host_name": "", - "environment": { - "__environment_keys__": { - "djvview": [] - } - }, + "environment": {}, "variants": { "djvview_1-1": { "enabled": true, @@ -1573,11 +1256,7 @@ "darwin": [], "linux": [] }, - "environment": { - "__environment_keys__": { - "djvview_1-1": [] - } - } + "environment": {} } } } diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_aftereffects.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_aftereffects.json index 6e1ba352fc..cd080bf0f2 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_aftereffects.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_aftereffects.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "aftereffects" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_blender.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_blender.json index 5030f8280f..2501e94b50 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_blender.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_blender.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "blender" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_celaction.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_celaction.json index c5fe824f94..fbdad62a92 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_celaction.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_celaction.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "celaction" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_djv.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_djv.json index 3f3af3585a..381437d4ff 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_djv.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_djv.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "djvview" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_fusion.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_fusion.json index d693c39ffe..8661916d06 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_fusion.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_fusion.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "fusion" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_harmony.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_harmony.json index 8ad07c95ba..7c59b0febd 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_harmony.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_harmony.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "harmony" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_houdini.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_houdini.json index 7698cb4cc1..70e06d170d 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_houdini.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_houdini.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "houdini" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_maya.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_maya.json index d8396b16cb..07c8aa0106 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_maya.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_maya.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "maya" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_mayabatch.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_mayabatch.json index af7cc3d301..bea59656af 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_mayabatch.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_mayabatch.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "mayabatch" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_photoshop.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_photoshop.json index a8e3574aa3..6f67e29df2 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_photoshop.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_photoshop.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "photoshop" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_resolve.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_resolve.json index 052a935410..644e3046ce 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_resolve.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_resolve.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "resolve" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_shell.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_shell.json index 3288fe2ffb..f2f9376029 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_shell.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_shell.json @@ -13,8 +13,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "shell" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_tvpaint.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_tvpaint.json index a3cc6188ac..fa28c4448c 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_tvpaint.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_tvpaint.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "tvpaint" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/schema_unreal.json b/pype/settings/entities/schemas/system_schema/host_settings/schema_unreal.json index c79f08b71a..e9d1b68130 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/schema_unreal.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/schema_unreal.json @@ -17,8 +17,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "unreal" + "type": "raw-json" }, { "type": "dict", diff --git a/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json b/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json index c809891b30..cf43dca6b5 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json @@ -77,8 +77,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "{app_name}_{app_variant}" + "type": "raw-json" } ] } diff --git a/pype/settings/entities/schemas/system_schema/host_settings/template_nuke.json b/pype/settings/entities/schemas/system_schema/host_settings/template_nuke.json index c86c2aef61..d99e0b9a85 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/template_nuke.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/template_nuke.json @@ -18,8 +18,7 @@ { "key": "environment", "label": "Environment", - "type": "raw-json", - "env_group_key": "{nuke_type}" + "type": "raw-json" }, { "type": "dict", From 6fa65a9bf8b26d544e6ab6c08d3ab1373f3fccff Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:29:17 +0200 Subject: [PATCH 02/17] removed previous implementation of Application object --- pype/lib/applications.py | 88 ---------------------------------------- 1 file changed, 88 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 4b2cab99aa..a006538db1 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -235,94 +235,6 @@ class ApplicationExecutable: return bool(self._realpath()) -class Application: - """Hold information about application. - - Object by itself does nothing special. - - Args: - app_group (str): App group name. - e.g. "maya", "nuke", "photoshop", etc. - app_name (str): Specific version (or variant) of host. - e.g. "maya2020", "nuke11.3", etc. - host_name (str): Name of host implementation. - app_data (dict): Data for the version containing information about - executables, label, variant label, icon or if is enabled. - Only required key is `executables`. - manager (ApplicationManager): Application manager that created object. - """ - - def __init__(self, app_group, app_name, host_name, app_data, manager): - self.app_group = app_group - self.app_name = app_name - self.host_name = host_name - self.app_data = app_data - self.manager = manager - - self.label = app_data.get("label") or app_name - 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 not _executables: - _executables = [] - - elif isinstance(_executables, dict): - _executables = _executables.get(platform.system().lower()) or [] - - _arguments = app_data["arguments"] - if not _arguments: - _arguments = [] - - elif isinstance(_arguments, dict): - _arguments = _arguments.get(platform.system().lower()) or [] - - executables = [] - for executable in _executables: - executables.append(ApplicationExecutable(executable)) - - self.executables = executables - self.arguments = _arguments - - @property - def full_label(self): - """Full label of application. - - Concatenate `label` and `variant_label` attributes if `variant_label` - is set. - """ - if self.variant_label: - return "{} {}".format(self.label, self.variant_label) - return str(self.label) - - def find_executable(self): - """Try to find existing executable for application. - - Returns (str): Path to executable from `executables` or None if any - exists. - """ - for executable in self.executables: - if executable.exists(): - return executable - return None - - def launch(self, *args, **kwargs): - """Launch the application. - - For this purpose is used manager's launch method to keep logic at one - place. - - Arguments must match with manager's launch method. That's why *args - **kwargs are used. - - Returns: - subprocess.Popen: Return executed process as Popen object. - """ - return self.manager.launch(self.app_name, *args, **kwargs) - - @six.add_metaclass(ABCMeta) class LaunchHook: """Abstract base class of launch hook.""" From dcdbae5156efa4717814f040c58537b2b90734d1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:30:04 +0200 Subject: [PATCH 03/17] implemented application group class it's object holds environments --- pype/lib/applications.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index a006538db1..e2596cbacb 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -90,6 +90,37 @@ class ApplicationLaunchFailed(Exception): pass +class ApplicationGroup: + def __init__(self, name, data, manager): + self.name = name + self.manager = manager + self._data = data + + self.enabled = data.get("enabled", True) + self.label = data.get("label") or name + self.icon = data.get("icon") or None + self._environment = data.get("environment") or {} + + host_name = data.get("host_name", None) + self.is_host = host_name is not None + self.host_name = host_name + + variants = data.get("variants") or {} + + self.variants = variants + + def __repr__(self): + return "<{}> - {}".format(self.__class__.__name__, self.name) + + def __iter__(self): + for variant in self.variants.values(): + yield variant + + @property + def environment(self): + return copy.deepcopy(self._environment) + + class ApplicationManager: def __init__(self): self.log = PypeLogger().get_logger(self.__class__.__name__) From 68954e034e4edd24b060b84d938839cdf8a44d37 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:37:07 +0200 Subject: [PATCH 04/17] implemented new Application class which use more data from group and keeps only it's environments --- pype/lib/applications.py | 75 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index e2596cbacb..3f573ba6c6 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -121,6 +121,81 @@ class ApplicationGroup: return copy.deepcopy(self._environment) +class Application: + """Hold information about application. + + Object by itself does nothing special. + + Args: + name (str): Specific version (or variant) of application. + e.g. "maya2020", "nuke11.3", etc. + data (dict): Data for the version containing information about + executables, variant label or if is enabled. + Only required key is `executables`. + group (ApplicationGroup): App group object that created the applicaiton + and under which application belongs. + """ + + def __init__(self, name, data, group): + self.name = name + self.group = group + self._data = data + + enabled = False + if group.enabled: + enabled = data.get("enabled", True) + self.enabled = enabled + + self.label = data.get("variant_label") or name + self.full_name = "/".join((group.name, name)) + self.full_label = " ".join((group.label, self.label)) + self._environment = data.get("environment") or {} + + _executables = data["executables"] + if not _executables: + _executables = [] + + elif isinstance(_executables, dict): + _executables = _executables.get(platform.system().lower()) or [] + + _arguments = data["arguments"] + if not _arguments: + _arguments = [] + + elif isinstance(_arguments, dict): + _arguments = _arguments.get(platform.system().lower()) or [] + + executables = [] + for executable in _executables: + executables.append(ApplicationExecutable(executable)) + + self.executables = executables + self.arguments = _arguments + + def __repr__(self): + return "<{}> - {}".format(self.__class__.__name__, self.full_name) + + @property + def environment(self): + return copy.deepcopy(self._environment) + + @property + def manager(self): + return self.group.manager + + @property + def host_name(self): + return self.group.host_name + + @property + def icon(self): + return self.group.icon + + @property + def is_host(self): + return self.group.is_host + + class ApplicationManager: def __init__(self): self.log = PypeLogger().get_logger(self.__class__.__name__) From be66e4cf70ad85df2b7aca47f5d3f9e950f1d3f3 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:37:23 +0200 Subject: [PATCH 05/17] added docstring to ApplicationGroup --- pype/lib/applications.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 3f573ba6c6..efe8d5f73e 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -91,6 +91,22 @@ class ApplicationLaunchFailed(Exception): class ApplicationGroup: + """Hold information about application group. + + Application group wraps different versions(variants) of application. + e.g. "maya" is group and "maya_2020" is variant. + + Group hold `host_name` which is implementation name used in pype. Also + holds `enabled` if whole app group is enabled or `icon` for application + icon path in resources. + + Group has also `environment` which hold same environments for all variants. + + Args: + name (str): Groups' name. + data (dict): Group defying data loaded from settings. + manager (ApplicationManager): Manager that created the group. + """ def __init__(self, name, data, manager): self.name = name self.manager = manager From f5a046bbcbf07b2100faa9eda5de0331091f2086 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:37:43 +0200 Subject: [PATCH 06/17] ApplicationGroup creates objects of Application class --- pype/lib/applications.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index efe8d5f73e..77dc62f8c9 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -4,6 +4,7 @@ import copy import json import platform import getpass +import collections import inspect import subprocess import distutils.spawn @@ -122,6 +123,10 @@ class ApplicationGroup: self.host_name = host_name variants = data.get("variants") or {} + for variant_name, variant_data in variants.items(): + variants[variant_name] = Application( + variant_name, variant_data, self + ) self.variants = variants From aa0b3211fc4b27837beef7f1c08429168676b88a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:40:29 +0200 Subject: [PATCH 07/17] ApplicationManager is using new classes to get applications --- pype/lib/applications.py | 40 +++++++++------------------------------- 1 file changed, 9 insertions(+), 31 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 77dc62f8c9..f53194ea72 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -221,6 +221,7 @@ class ApplicationManager: def __init__(self): self.log = PypeLogger().get_logger(self.__class__.__name__) + self.app_groups = {} self.applications = {} self.tools = {} @@ -228,42 +229,19 @@ class ApplicationManager: def refresh(self): """Refresh applications from settings.""" + self.app_groups.clear() self.applications.clear() self.tools.clear() settings = get_system_settings() - hosts_definitions = settings["applications"] - for app_group, variant_definitions in hosts_definitions.items(): - enabled = variant_definitions["enabled"] - label = variant_definitions.get("label") or app_group - variants = variant_definitions.get("variants") or {} - icon = variant_definitions.get("icon") - group_host_name = variant_definitions.get("host_name") or None - 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 - - # Pass label from host definition - if not app_data.get("label"): - app_data["label"] = label - - if not app_data.get("icon"): - app_data["icon"] = icon - - host_name = app_data.get("host_name") or group_host_name - - app_data["is_host"] = host_name is not None - - self.applications[app_name] = Application( - app_group, app_name, host_name, app_data, self - ) + app_defs = settings["applications"] + for group_name, variant_defs in app_defs.items(): + group = ApplicationGroup(group_name, variant_defs, self) + self.app_groups[group_name] = group + for app in group: + # TODO This should be replaced with `full_name` in future + self.applications[app.name] = app tools_definitions = settings["tools"]["tool_groups"] for tool_group_name, tool_group_data in tools_definitions.items(): From b6b1ab4b3a1257ca74c61c33276ee16fced6b29f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:40:43 +0200 Subject: [PATCH 08/17] reimplemented require Application methods --- pype/lib/applications.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index f53194ea72..161198a85d 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -216,6 +216,31 @@ class Application: def is_host(self): return self.group.is_host + def find_executable(self): + """Try to find existing executable for application. + + Returns (str): Path to executable from `executables` or None if any + exists. + """ + for executable in self.executables: + if executable.exists(): + return executable + return None + + def launch(self, *args, **kwargs): + """Launch the application. + + For this purpose is used manager's launch method to keep logic at one + place. + + Arguments must match with manager's launch method. That's why *args + **kwargs are used. + + Returns: + subprocess.Popen: Return executed process as Popen object. + """ + return self.manager.launch(self.name, *args, **kwargs) + class ApplicationManager: def __init__(self): From a507d78f9c19bf481333a0e85283ebabae0d362c Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:43:05 +0200 Subject: [PATCH 09/17] fixed attributes usage --- pype/hooks/pre_global_host_data.py | 2 +- pype/lib/applications.py | 13 +++++++------ .../event_handlers_user/action_applications.py | 4 ++-- pype/tools/launcher/models.py | 6 +++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/pype/hooks/pre_global_host_data.py b/pype/hooks/pre_global_host_data.py index 74be208367..876c5840e7 100644 --- a/pype/hooks/pre_global_host_data.py +++ b/pype/hooks/pre_global_host_data.py @@ -32,7 +32,7 @@ class GlobalHostDataHook(PreLaunchHook): "project_name": self.data["project_name"], "asset_name": self.data["asset_name"], "task_name": self.data["task_name"], - "app_name": app.app_name, + "app": app, "dbcon": self.data["dbcon"], diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 161198a85d..36d3722701 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -418,7 +418,7 @@ class LaunchHook: return False if cls.app_groups: - if launch_context.app_group not in cls.app_groups: + if launch_context.app_group.name not in cls.app_groups: return False if cls.app_names: @@ -445,11 +445,11 @@ class LaunchHook: @property def app_group(self): - return getattr(self.application, "app_group", None) + return getattr(self.application, "group", None) @property def app_name(self): - return getattr(self.application, "app_name", None) + return getattr(self.application, "name", None) def validate(self): """Optional validation of launch hook on initialization. @@ -718,7 +718,7 @@ class ApplicationLaunchContext: @property def app_name(self): - return self.application.app_name + return self.application.name @property def host_name(self): @@ -726,7 +726,7 @@ class ApplicationLaunchContext: @property def app_group(self): - return self.application.app_group + return self.application.group @property def manager(self): @@ -1060,7 +1060,8 @@ def prepare_context_environments(data): "AVALON_ASSET": asset_doc["name"], "AVALON_TASK": task_name, "AVALON_APP": app.host_name, - "AVALON_APP_NAME": app.app_name, + # TODO this hould be `app.full_name` in future PRs + "AVALON_APP_NAME": app.name, "AVALON_WORKDIR": workdir } log.debug( diff --git a/pype/modules/ftrack/event_handlers_user/action_applications.py b/pype/modules/ftrack/event_handlers_user/action_applications.py index 5b6657793a..2c42cadfb7 100644 --- a/pype/modules/ftrack/event_handlers_user/action_applications.py +++ b/pype/modules/ftrack/event_handlers_user/action_applications.py @@ -133,8 +133,8 @@ class AppplicationsAction(BaseAction): app_icon = None items.append({ - "label": app.label, - "variant": app.variant_label, + "label": app.group.label, + "variant": app.label, "description": None, "actionIdentifier": self.identifier + app_name, "icon": app_icon diff --git a/pype/tools/launcher/models.py b/pype/tools/launcher/models.py index d1742014ef..c617c7cace 100644 --- a/pype/tools/launcher/models.py +++ b/pype/tools/launcher/models.py @@ -162,9 +162,9 @@ class ActionModel(QtGui.QStandardItemModel): (ApplicationAction,), { "application": app, - "name": app.app_name, - "label": app.label, - "label_variant": app.variant_label, + "name": app.name, + "label": app.group.label, + "label_variant": app.label, "group": None, "icon": app.icon, "color": getattr(app, "color", None), From 9a18da32ac8ccab1cff76392e861c2208d8bf7ae Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:50:33 +0200 Subject: [PATCH 10/17] Implemented EnvironmentToolGroup to hold tool group --- pype/lib/applications.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 36d3722701..56432ec357 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -314,6 +314,46 @@ class ApplicationManager: return context.launch() +class EnvironmentToolGroup: + """Hold information about environment tool group. + + Environment tool group may hold different variants of same tool and set + environments that are same for all of them. + + e.g. "mtoa" may have different versions but all environments except one + are same. + + Args: + name (str): Name of the tool group. + data (dict): Group's information with it's variants. + manager (ApplicationManager): Manager that creates the group. + """ + + def __init__(self, name, data, manager): + self.name = name + self._data = data + self.manager = manager + self._environment = data["environment"] + + variants = data.get("variants") or {} + variants_by_name = {} + for variant_name, variant_env in variants.items(): + tool = EnvironmentTool(variant_name, variant_env, self) + variants_by_name[variant_name] = tool + self.variants = variants_by_name + + def __repr__(self): + return "<{}> - {}".format(self.__class__.__name__, self.name) + + def __iter__(self): + for variant in self.variants.values(): + yield variant + + @property + def environment(self): + return copy.deepcopy(self._environment) + + class ApplicationTool: """Hold information about application tool. From ed148c7c1135145d8b855e2f475e239d1de12c4a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:51:09 +0200 Subject: [PATCH 11/17] renamed ApplicationTool to EnvironmentTool and changed what data holds --- pype/lib/applications.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 56432ec357..5b0e61b909 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -354,23 +354,29 @@ class EnvironmentToolGroup: return copy.deepcopy(self._environment) -class ApplicationTool: +class EnvironmentTool: """Hold information about application tool. Structure of tool information. Args: - tool_name (str): Name of the tool. - group_name (str): Name of group which wraps tool. + name (str): Name of the tool. + environment (dict): Variant environments. + group (str): Name of group which wraps tool. """ - def __init__(self, tool_name, group_name): - self.name = tool_name - self.group_name = group_name + def __init__(self, name, environment, group): + self.name = name + self.group = group + self._environment = environment + self.full_name = "/".join((group.name, name)) + + def __repr__(self): + return "<{}> - {}".format(self.__class__.__name__, self.full_name) @property - def full_name(self): - return "/".join((self.group_name, self.name)) + def environment(self): + return copy.deepcopy(self._environment) class ApplicationExecutable: From 19313b06bdc2722eab88571921055cb6a357510b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:51:30 +0200 Subject: [PATCH 12/17] ApplicationManager use new tools classes to define it's tools --- pype/lib/applications.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 5b0e61b909..37021e0a5c 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -248,6 +248,7 @@ class ApplicationManager: self.app_groups = {} self.applications = {} + self.tool_groups = {} self.tools = {} self.refresh() @@ -256,6 +257,7 @@ class ApplicationManager: """Refresh applications from settings.""" self.app_groups.clear() self.applications.clear() + self.tool_groups.clear() self.tools.clear() settings = get_system_settings() @@ -270,13 +272,13 @@ class ApplicationManager: tools_definitions = settings["tools"]["tool_groups"] for tool_group_name, tool_group_data in tools_definitions.items(): - tool_variants = tool_group_data.get("variants") or {} - for tool_name, tool_data in tool_variants.items(): - tool = ApplicationTool(tool_name, tool_group_name) - if tool.full_name in self.tools: - self.log.warning(( - "Duplicated tool name in settings \"{}\"" - ).format(tool.full_name)) + if not tool_group_name: + continue + group = EnvironmentToolGroup( + tool_group_name, tool_group_data, self + ) + self.tool_groups[tool_group_name] = group + for tool in group: self.tools[tool.full_name] = tool def launch(self, app_name, **data): From 1a4abd712838ca1c3d80f9a3d00598a57748bc0f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:52:50 +0200 Subject: [PATCH 13/17] changed how environments for apps and tools are retrieved --- pype/lib/applications.py | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 37021e0a5c..cfb79f3a18 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -988,29 +988,42 @@ def prepare_host_environments(data): app = data["app"] log = data["log"] - # Keys for getting environments - env_keys = [app.app_group, app.app_name] + # `added_env_keys` has debug purpose + added_env_keys = {app.group.name, app.name} + # Environments for application + environments = [ + app.group.environment, + app.environment + ] asset_doc = data.get("asset_doc") + # Add tools environments + groups_by_name = {} + tool_by_group_name = collections.defaultdict(list) if asset_doc: - # Add tools environments + # Make sure each tool group can be added only once for key in asset_doc["data"].get("tools_env") or []: tool = app.manager.tools.get(key) - if tool: - if tool.group_name not in env_keys: - env_keys.append(tool.group_name) + if not tool: + continue + groups_by_name[tool.group.name] = tool.group + tool_by_group_name[tool.group.name].append(tool) - if tool.name not in env_keys: - env_keys.append(tool.name) + for group_name, group in groups_by_name.items(): + environments.append(group.environment) + added_env_keys.add(group_name) + for tool in tool_by_group_name[group_name]: + environments.append(tool.environment) + added_env_keys.add(tool.name) log.debug( - "Finding environment groups for keys: {}".format(env_keys) + "Will add environments for apps and tools: {}".format( + ", ".join(added_env_keys) + ) ) - settings_env = data["settings_env"] env_values = {} - for env_key in env_keys: - _env_values = settings_env.get(env_key) + for _env_values in environments: if not _env_values: continue From 9f14f89173260c47827d18f748f0671b9fdaaa07 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 19:53:47 +0200 Subject: [PATCH 14/17] removed usage of "settings_env" key in launch context --- pype/hooks/pre_global_host_data.py | 1 - pype/lib/applications.py | 9 --------- 2 files changed, 10 deletions(-) diff --git a/pype/hooks/pre_global_host_data.py b/pype/hooks/pre_global_host_data.py index 876c5840e7..5405bc0894 100644 --- a/pype/hooks/pre_global_host_data.py +++ b/pype/hooks/pre_global_host_data.py @@ -41,7 +41,6 @@ class GlobalHostDataHook(PreLaunchHook): "anatomy": self.data["anatomy"], - "settings_env": self.data.get("settings_env"), "env": self.launch_context.env, "log": self.log diff --git a/pype/lib/applications.py b/pype/lib/applications.py index cfb79f3a18..e7e161b0a9 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -572,12 +572,6 @@ class ApplicationLaunchContext: self.data = dict(data) - # Load settings if were not passed in data - settings_env = self.data.get("settings_env") - if settings_env is None: - settings_env = get_environments() - self.data["settings_env"] = settings_env - # subprocess.Popen launch arguments (first argument in constructor) self.launch_args = executable.as_args() self.launch_args.extend(application.arguments) @@ -896,9 +890,6 @@ class EnvironmentPrepData(dict): if data.get("env") is None: data["env"] = os.environ.copy() - if data.get("settings_env") is None: - data["settings_env"] = get_environments() - super(EnvironmentPrepData, self).__init__(data) From 0caa77261ac2ec30efe03fc9c75daccb747062b7 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 20:02:20 +0200 Subject: [PATCH 15/17] removed label and icon from variants --- .../system_settings/applications.json | 88 ------------------- .../host_settings/template_host_variant.json | 14 --- 2 files changed, 102 deletions(-) diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index 08e7a16599..5eccdfb83d 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -21,9 +21,7 @@ "variants": { "maya_2020": { "enabled": true, - "label": "", "variant_label": "2020", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Autodesk\\Maya2020\\bin\\maya.exe" @@ -44,9 +42,7 @@ }, "maya_2019": { "enabled": true, - "label": "", "variant_label": "2019", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Autodesk\\Maya2019\\bin\\maya.exe" @@ -67,9 +63,7 @@ }, "maya_2018": { "enabled": true, - "label": "", "variant_label": "2018", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Autodesk\\Maya2018\\bin\\maya.exe" @@ -113,9 +107,7 @@ "variants": { "mayabatch_2020": { "enabled": true, - "label": "", "variant_label": "2020", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Autodesk\\Maya2020\\bin\\mayabatch.exe" @@ -134,9 +126,7 @@ }, "mayabatch_2019": { "enabled": true, - "label": "", "variant_label": "2019", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Autodesk\\Maya2019\\bin\\mayabatch.exe" @@ -155,9 +145,7 @@ }, "mayabatch_2018": { "enabled": true, - "label": "", "variant_label": "2018", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Autodesk\\Maya2018\\bin\\mayabatch.exe" @@ -195,9 +183,7 @@ "variants": { "nuke_12-2": { "enabled": true, - "label": "", "variant_label": "12.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" @@ -216,9 +202,7 @@ }, "nuke_12-0": { "enabled": true, - "label": "", "variant_label": "12.0", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" @@ -237,9 +221,7 @@ }, "nuke_11-3": { "enabled": true, - "label": "", "variant_label": "11.3", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" @@ -258,9 +240,7 @@ }, "nuke_11-2": { "enabled": true, - "label": "", "variant_label": "11.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe" @@ -296,9 +276,7 @@ "variants": { "nukex_12-2": { "enabled": true, - "label": "", "variant_label": "12.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" @@ -323,9 +301,7 @@ }, "nukex_12-0": { "enabled": true, - "label": "", "variant_label": "12.0", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" @@ -350,9 +326,7 @@ }, "nukex_11-3": { "enabled": true, - "label": "", "variant_label": "11.3", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" @@ -377,9 +351,7 @@ }, "nukex_11-2": { "enabled": true, - "label": "", "variant_label": "11.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe" @@ -421,9 +393,7 @@ "variants": { "nukestudio_12-2": { "enabled": true, - "label": "", "variant_label": "12.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" @@ -448,9 +418,7 @@ }, "nukestudio_12-0": { "enabled": true, - "label": "", "variant_label": "12.0", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" @@ -475,9 +443,7 @@ }, "nukestudio_11-3": { "enabled": true, - "label": "", "variant_label": "11.3", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" @@ -502,9 +468,7 @@ }, "nukestudio_11-2": { "enabled": true, - "label": "", "variant_label": "11.2", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -544,9 +508,7 @@ "variants": { "hiero_12-2": { "enabled": true, - "label": "", "variant_label": "12.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" @@ -571,9 +533,7 @@ }, "hiero_12-0": { "enabled": true, - "label": "", "variant_label": "12.0", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" @@ -598,9 +558,7 @@ }, "hiero_11-3": { "enabled": true, - "label": "", "variant_label": "11.3", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" @@ -625,9 +583,7 @@ }, "hiero_11-2": { "enabled": true, - "label": "", "variant_label": "11.2", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe" @@ -682,9 +638,7 @@ "variants": { "fusion_16": { "enabled": true, - "label": "", "variant_label": "16", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -699,9 +653,7 @@ }, "fusion_9": { "enabled": true, - "label": "", "variant_label": "9", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Blackmagic Design\\Fusion 9\\Fusion.exe" @@ -764,9 +716,7 @@ "variants": { "resolve_16": { "enabled": true, - "label": "", "variant_label": "16", - "icon": "", "executables": { "windows": [ "C:/Program Files/Blackmagic Design/DaVinci Resolve/Resolve.exe" @@ -803,9 +753,7 @@ "variants": { "houdini_18-5": { "enabled": true, - "label": "", "variant_label": "18.5", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Side Effects Software\\Houdini 18.5.499\\bin\\houdini.exe" @@ -822,9 +770,7 @@ }, "houdini_18": { "enabled": true, - "label": "", "variant_label": "18", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -839,9 +785,7 @@ }, "houdini_17": { "enabled": true, - "label": "", "variant_label": "17", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -872,9 +816,7 @@ "variants": { "blender_2-83": { "enabled": true, - "label": "", "variant_label": "2.83", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Blender Foundation\\Blender 2.83\\blender.exe" @@ -897,9 +839,7 @@ }, "blender_2-90": { "enabled": true, - "label": "", "variant_label": "2.90", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Blender Foundation\\Blender 2.90\\blender.exe" @@ -934,9 +874,7 @@ "variants": { "harmony_20": { "enabled": true, - "label": "", "variant_label": "20", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -951,9 +889,7 @@ }, "harmony_17": { "enabled": true, - "label": "", "variant_label": "17", - "icon": "", "executables": { "windows": [], "darwin": [ @@ -981,9 +917,7 @@ "variants": { "tvpaint_animation_11-64bits": { "enabled": true, - "label": "", "variant_label": "11 (64bits)", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\TVPaint Developpement\\TVPaint Animation 11 (64bits)\\TVPaint Animation 11 (64bits).exe" @@ -1000,9 +934,7 @@ }, "tvpaint_animation_11-32bits": { "enabled": true, - "label": "", "variant_label": "11 (32bits)", - "icon": "", "executables": { "windows": [ "C:\\Program Files (x86)\\TVPaint Developpement\\TVPaint Animation 11 (32bits)\\TVPaint Animation 11 (32bits).exe" @@ -1033,9 +965,7 @@ "variants": { "photoshop_2020": { "enabled": true, - "label": "", "variant_label": "2020", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Adobe\\Adobe Photoshop 2020\\Photoshop.exe" @@ -1052,9 +982,7 @@ }, "photoshop_2021": { "enabled": true, - "label": "", "variant_label": "2021", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Adobe\\Adobe Photoshop 2021\\Photoshop.exe" @@ -1085,9 +1013,7 @@ "variants": { "aftereffects_2020": { "enabled": true, - "label": "", "variant_label": "2020", - "icon": "", "executables": { "windows": [ "" @@ -1104,9 +1030,7 @@ }, "aftereffects_2021": { "enabled": true, - "label": "", "variant_label": "2021", - "icon": "", "executables": { "windows": [ "C:\\Program Files\\Adobe\\Adobe After Effects 2021\\Support Files\\AfterFX.exe" @@ -1134,9 +1058,7 @@ "variants": { "celation_Local": { "enabled": true, - "label": "", "variant_label": "Local", - "icon": "{}/app_icons/celaction_local.png", "executables": "", "arguments": { "windows": [], @@ -1160,9 +1082,7 @@ "variants": { "unreal_4-24": { "enabled": true, - "label": "", "variant_label": "4.24", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -1183,9 +1103,7 @@ "variants": { "python_python_3-7": { "enabled": true, - "label": "Python", "variant_label": "3.7", - "icon": "{}/app_icons/python.png", "executables": { "windows": [], "darwin": [], @@ -1200,9 +1118,7 @@ }, "python_python_2-7": { "enabled": true, - "label": "Python", "variant_label": "2.7", - "icon": "{}/app_icons/python.png", "executables": { "windows": [], "darwin": [], @@ -1217,9 +1133,7 @@ }, "terminal_terminal": { "enabled": true, - "label": "Terminal", "variant_label": "", - "icon": "", "executables": { "windows": [], "darwin": [], @@ -1243,9 +1157,7 @@ "variants": { "djvview_1-1": { "enabled": true, - "label": "", "variant_label": "1.1", - "icon": "", "executables": { "windows": [], "darwin": [], diff --git a/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json b/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json index cf43dca6b5..10aab06466 100644 --- a/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json +++ b/pype/settings/entities/schemas/system_schema/host_settings/template_host_variant.json @@ -17,13 +17,6 @@ "key": "enabled", "label": "Enabled" }, - { - "type": "text", - "key": "label", - "label": "Label", - "placeholder": "Used from host label if not filled.", - "roles": ["developer"] - }, { "type": "text", "key": "variant_label", @@ -31,13 +24,6 @@ "placeholder": "Only \"Label\" is used if not filled.", "roles": ["developer"] }, - { - "type": "text", - "key": "icon", - "label": "Icon", - "placeholder": "Host icon path template. Used from host if not filled.", - "roles": ["developer"] - }, { "type": "path", "key": "executables", From f1b154a94f70527d7bd833137e0383747be5c762 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Tue, 30 Mar 2021 20:04:34 +0200 Subject: [PATCH 16/17] group does not have to have set label --- pype/lib/applications.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index e7e161b0a9..6df296db95 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -114,7 +114,7 @@ class ApplicationGroup: self._data = data self.enabled = data.get("enabled", True) - self.label = data.get("label") or name + self.label = data.get("label") or None self.icon = data.get("icon") or None self._environment = data.get("environment") or {} @@ -169,7 +169,12 @@ class Application: self.label = data.get("variant_label") or name self.full_name = "/".join((group.name, name)) - self.full_label = " ".join((group.label, self.label)) + + if group.label: + full_label = " ".join((group.label, self.label)) + else: + full_label = self.label + self.full_label = full_label self._environment = data.get("environment") or {} _executables = data["executables"] From 4eab3340a16a7719d0719c4827745ab5e00f6d29 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Wed, 31 Mar 2021 15:07:39 +0200 Subject: [PATCH 17/17] fix label issue --- pype/settings/entities/enum_entity.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pype/settings/entities/enum_entity.py b/pype/settings/entities/enum_entity.py index c486de397e..e28fb7478f 100644 --- a/pype/settings/entities/enum_entity.py +++ b/pype/settings/entities/enum_entity.py @@ -133,12 +133,9 @@ class AppsEnumEntity(BaseEnumEntity): if enabled_entity and not enabled_entity.value: continue - _group_label = variant_entity["label"].value - if not _group_label: - _group_label = group_label variant_label = variant_entity["variant_label"].value - full_label = "{} {}".format(_group_label, variant_label) + full_label = "{} {}".format(group_label, variant_label) enum_items.append({variant_name: full_label}) valid_keys.add(variant_name) return enum_items, valid_keys