From 93c771eaf0ec1f90eea72a14469b9e6a6e995a33 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 10:52:57 +0100 Subject: [PATCH 01/27] variant template expect 3 keys app_name app_variant and app_variant_label --- .../system_schema/host_settings/template_host_variant.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ba009cf094..c809891b30 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 @@ -7,8 +7,8 @@ }, { "type": "dict", - "key": "{host_name}_{host_version}", - "label": "{host_version}", + "key": "{app_name}_{app_variant}", + "label": "{app_variant_label}", "collapsible": true, "checkbox_key": "enabled", "children": [ @@ -78,7 +78,7 @@ "key": "environment", "label": "Environment", "type": "raw-json", - "env_group_key": "{host_name}_{host_version}" + "env_group_key": "{app_name}_{app_variant}" } ] } From 34b227612196f44e18f8536a2239e3eed4e891b0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 10:55:58 +0100 Subject: [PATCH 02/27] all aplications are passing new keys to variants --- .../host_settings/schema_aftereffects.json | 10 ++++---- .../host_settings/schema_blender.json | 10 ++++---- .../host_settings/schema_celaction.json | 10 ++++---- .../host_settings/schema_djv.json | 5 ++-- .../host_settings/schema_fusion.json | 10 ++++---- .../host_settings/schema_harmony.json | 10 ++++---- .../host_settings/schema_houdini.json | 10 ++++---- .../host_settings/schema_maya.json | 15 +++++++----- .../host_settings/schema_mayabatch.json | 15 +++++++----- .../host_settings/schema_photoshop.json | 10 ++++---- .../host_settings/schema_resolve.json | 5 ++-- .../host_settings/schema_shell.json | 15 +++++++----- .../host_settings/schema_tvpaint.json | 10 ++++---- .../host_settings/schema_unreal.json | 5 ++-- .../host_settings/template_nuke.json | 24 +++++++++---------- 15 files changed, 96 insertions(+), 68 deletions(-) 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 4304c65445..6e1ba352fc 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "2020", - "host_name": "aftereffects" + "app_variant_label": "2020", + "app_variant": "2020", + "app_name": "aftereffects" }, { - "host_version": "2021", - "host_name": "aftereffects" + "app_variant_label": "2021", + "app_variant": "2021", + "app_name": "aftereffects" } ] } 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 5d8cb45da8..725a0685b6 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "2.90", - "host_name": "blender" + "app_variant_label": "2.83", + "app_variant": "2_83", + "app_name": "blender" }, { - "host_version": "2.83", - "host_name": "blender" + "app_variant_label": "2.90", + "app_variant": "2_90", + "app_name": "blender" } ] } 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 ab3f0f3f15..6fa596808d 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 @@ -29,14 +29,16 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "Local", - "host_name": "celation", + "app_variant_label": "Local", + "app_variant": "Local", + "app_name": "celation", "multiplatform": false, "multipath_executables": false }, { - "host_version": "Publish", - "host_name": "celation", + "app_variant_label": "Publish", + "app_variant": "Publish", + "app_name": "celation", "multiplatform": false, "multipath_executables": false } 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 02c90a92ad..8bbdb7ea9b 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 @@ -28,8 +28,9 @@ "type": "schema_template", "name": "template_host_variant", "template_data": { - "host_version": "1.1", - "host_name": "djvview" + "app_variant_label": "1.1", + "app_variant": "1_1", + "app_name": "djvview" } } ] 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 1c1b7653d9..d693c39ffe 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "16", - "host_name": "fusion" + "app_variant_label": "16", + "app_variant": "16", + "app_name": "fusion" }, { - "host_version": "9", - "host_name": "fusion" + "app_variant_label": "9", + "app_variant": "9", + "app_name": "fusion" } ] } 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 b0abf35bfa..8ad07c95ba 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "20", - "host_name": "harmony" + "app_variant_label": "20", + "app_variant": "20", + "app_name": "harmony" }, { - "host_version": "17", - "host_name": "harmony" + "app_variant_label": "17", + "app_variant": "17", + "app_name": "harmony" } ] } 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 cc0cd54cf2..399261528b 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "18", - "host_name": "houdini" + "app_variant_label": "18", + "app_variant": "18", + "app_name": "houdini" }, { - "host_version": "17", - "host_name": "houdini" + "app_variant_label": "17", + "app_variant": "17", + "app_name": "houdini" } ] } 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 84782cb3d8..d8396b16cb 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 @@ -29,16 +29,19 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "2020", - "host_name": "maya" + "app_variant_label": "2020", + "app_variant": "2020", + "app_name": "maya" }, { - "host_version": "2019", - "host_name": "maya" + "app_variant_label": "2019", + "app_variant": "2019", + "app_name": "maya" }, { - "host_version": "2018", - "host_name": "maya" + "app_variant_label": "2018", + "app_variant": "2018", + "app_name": "maya" } ] } 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 dbd850dcd6..af7cc3d301 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 @@ -29,16 +29,19 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "2020", - "host_name": "mayabatch" + "app_variant_label": "2020", + "app_variant": "2020", + "app_name": "mayabatch" }, { - "host_version": "2019", - "host_name": "mayabatch" + "app_variant_label": "2019", + "app_variant": "2019", + "app_name": "mayabatch" }, { - "host_version": "2018", - "host_name": "mayabatch" + "app_variant_label": "2018", + "app_variant": "2018", + "app_name": "mayabatch" } ] } 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 136eb16888..a8e3574aa3 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "2020", - "host_name": "photoshop" + "app_variant_label": "2020", + "app_variant": "2020", + "app_name": "photoshop" }, { - "host_version": "2021", - "host_name": "photoshop" + "app_variant_label": "2021", + "app_variant": "2021", + "app_name": "photoshop" } ] } 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 2d11e1def4..052a935410 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 @@ -29,8 +29,9 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "16", - "host_name": "resolve" + "app_variant_label": "16", + "app_variant": "16", + "app_name": "resolve" } ] } 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 4fdbd65c24..f72450aa08 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 @@ -25,16 +25,19 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "Python 3.7", - "host_name": "python" + "app_variant": "python_3_7", + "app_variant_label": "Python 3.7", + "app_name": "python" }, { - "host_version": "Python 2.7", - "host_name": "python" + "app_variant": "python_2_7", + "app_variant_label": "Python 2.7", + "app_name": "python" }, { - "host_version": "Terminal", - "host_name": "terminal" + "app_variant": "terminal", + "app_variant_label": "Terminal", + "app_name": "terminal" } ] } 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 1c88d12cab..a569ec0503 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 @@ -29,12 +29,14 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "Animation 11 (64bits)", - "host_name": "tvpaint" + "app_variant_label": "Animation 11 (64bits)", + "app_variant": "animation_11_64bit", + "app_name": "tvpaint" }, { - "host_version": "Animation 11 (32bits)", - "host_name": "tvpaint" + "app_variant_label": "Animation 11 (32bits)", + "app_variant": "animation_11_32bit", + "app_name": "tvpaint" } ] } 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 d7065ad3ff..b23a21b0fd 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 @@ -29,8 +29,9 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "4.24", - "host_name": "unreal" + "app_variant": "4_24", + "app_variant_label": "4.24", + "app_name": "unreal" } ] } 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 01c3be726a..d32f87949d 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 @@ -30,24 +30,24 @@ "name": "template_host_variant", "template_data": [ { - "host_version": "12.2", - "host_name": "{nuke_type}", - "multipath_executables": true + "app_variant": "12_2", + "app_variant_label": "12.2", + "app_name": "{nuke_type}" }, { - "host_version": "12.0", - "host_name": "{nuke_type}", - "multipath_executables": true + "app_variant": "12_0", + "app_variant_label": "12.0", + "app_name": "{nuke_type}" }, { - "host_version": "11.3", - "host_name": "{nuke_type}", - "multipath_executables": true + "app_variant": "11_3", + "app_variant_label": "11.3", + "app_name": "{nuke_type}" }, { - "host_version": "11.2", - "host_name": "{nuke_type}", - "multipath_executables": true + "app_variant": "11_2", + "app_variant_label": "11.2", + "app_name": "{nuke_type}" } ] } From 6b2ababb62f71a59532aea29f756562775ac97d8 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 10:56:13 +0100 Subject: [PATCH 03/27] resaved keys in defaults --- .../system_settings/applications.json | 156 +++++++++--------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index 4a13cf78f6..436ef62342 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -253,7 +253,7 @@ } }, "variants": { - "nuke_12.2": { + "nuke_12_2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -274,11 +274,11 @@ }, "environment": { "__environment_keys__": { - "nuke_12.2": [] + "nuke_12_2": [] } } }, - "nuke_12.0": { + "nuke_12_0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -299,11 +299,11 @@ }, "environment": { "__environment_keys__": { - "nuke_12.0": [] + "nuke_12_0": [] } } }, - "nuke_11.3": { + "nuke_11_3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -324,11 +324,11 @@ }, "environment": { "__environment_keys__": { - "nuke_11.3": [] + "nuke_11_3": [] } } }, - "nuke_11.2": { + "nuke_11_2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -347,7 +347,7 @@ }, "environment": { "__environment_keys__": { - "nuke_11.2": [] + "nuke_11_2": [] } } } @@ -377,7 +377,7 @@ } }, "variants": { - "nukex_12.2": { + "nukex_12_2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -404,11 +404,11 @@ }, "environment": { "__environment_keys__": { - "nukex_12.2": [] + "nukex_12_2": [] } } }, - "nukex_12.0": { + "nukex_12_0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -435,11 +435,11 @@ }, "environment": { "__environment_keys__": { - "nukex_12.0": [] + "nukex_12_0": [] } } }, - "nukex_11.3": { + "nukex_11_3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -466,11 +466,11 @@ }, "environment": { "__environment_keys__": { - "nukex_11.3": [] + "nukex_11_3": [] } } }, - "nukex_11.2": { + "nukex_11_2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -495,7 +495,7 @@ }, "environment": { "__environment_keys__": { - "nukex_11.2": [] + "nukex_11_2": [] } } } @@ -527,7 +527,7 @@ } }, "variants": { - "nukestudio_12.2": { + "nukestudio_12_2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -554,11 +554,11 @@ }, "environment": { "__environment_keys__": { - "nukestudio_12.2": [] + "nukestudio_12_2": [] } } }, - "nukestudio_12.0": { + "nukestudio_12_0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -585,11 +585,11 @@ }, "environment": { "__environment_keys__": { - "nukestudio_12.0": [] + "nukestudio_12_0": [] } } }, - "nukestudio_11.3": { + "nukestudio_11_3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -616,11 +616,11 @@ }, "environment": { "__environment_keys__": { - "nukestudio_11.3": [] + "nukestudio_11_3": [] } } }, - "nukestudio_11.2": { + "nukestudio_11_2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -643,7 +643,7 @@ }, "environment": { "__environment_keys__": { - "nukestudio_11.2": [] + "nukestudio_11_2": [] } } } @@ -675,7 +675,7 @@ } }, "variants": { - "hiero_12.2": { + "hiero_12_2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -702,11 +702,11 @@ }, "environment": { "__environment_keys__": { - "hiero_12.2": [] + "hiero_12_2": [] } } }, - "hiero_12.0": { + "hiero_12_0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -733,11 +733,11 @@ }, "environment": { "__environment_keys__": { - "hiero_12.0": [] + "hiero_12_0": [] } } }, - "hiero_11.3": { + "hiero_11_3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -764,11 +764,11 @@ }, "environment": { "__environment_keys__": { - "hiero_11.3": [] + "hiero_11_3": [] } } }, - "hiero_11.2": { + "hiero_11_2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -793,7 +793,7 @@ }, "environment": { "__environment_keys__": { - "hiero_11.2": [] + "hiero_11_2": [] } } } @@ -1057,36 +1057,7 @@ } }, "variants": { - "blender_2.90": { - "enabled": true, - "label": "", - "variant_label": "2.90", - "icon": "", - "executables": { - "windows": [ - "C:\\Program Files\\Blender Foundation\\Blender 2.90\\blender.exe" - ], - "darwin": [], - "linux": [] - }, - "arguments": { - "windows": [ - "--python-use-system-env" - ], - "darwin": [ - "--python-use-system-env" - ], - "linux": [ - "--python-use-system-env" - ] - }, - "environment": { - "__environment_keys__": { - "blender_2.90": [] - } - } - }, - "blender_2.83": { + "blender_2_83": { "enabled": true, "label": "", "variant_label": "2.83", @@ -1111,7 +1082,36 @@ }, "environment": { "__environment_keys__": { - "blender_2.83": [] + "blender_2_83": [] + } + } + }, + "blender_2_90": { + "enabled": true, + "label": "", + "variant_label": "2.90", + "icon": "", + "executables": { + "windows": [ + "C:\\Program Files\\Blender Foundation\\Blender 2.90\\blender.exe" + ], + "darwin": [], + "linux": [] + }, + "arguments": { + "windows": [ + "--python-use-system-env" + ], + "darwin": [ + "--python-use-system-env" + ], + "linux": [ + "--python-use-system-env" + ] + }, + "environment": { + "__environment_keys__": { + "blender_2_90": [] } } } @@ -1193,7 +1193,7 @@ } }, "variants": { - "tvpaint_Animation 11 (64bits)": { + "tvpaint_animation_11_64bit": { "enabled": true, "label": "", "variant_label": "11 (64bits)", @@ -1212,11 +1212,11 @@ }, "environment": { "__environment_keys__": { - "tvpaint_Animation 11 (64bits)": [] + "tvpaint_animation_11_64bit": [] } } }, - "tvpaint_Animation 11 (32bits)": { + "tvpaint_animation_11_32bit": { "enabled": true, "label": "", "variant_label": "11 (32bits)", @@ -1235,7 +1235,7 @@ }, "environment": { "__environment_keys__": { - "tvpaint_Animation 11 (32bits)": [] + "tvpaint_animation_11_32bit": [] } } } @@ -1445,7 +1445,7 @@ } }, "variants": { - "unreal_4.24": { + "unreal_4_24": { "enabled": true, "label": "", "variant_label": "4.24", @@ -1462,7 +1462,7 @@ }, "environment": { "__environment_keys__": { - "unreal_4.24": [] + "unreal_4_24": [] } } } @@ -1476,7 +1476,7 @@ } }, "variants": { - "python_Python 3.7": { + "python_python_3_7": { "enabled": true, "label": "Python", "variant_label": "3.7", @@ -1493,11 +1493,11 @@ }, "environment": { "__environment_keys__": { - "python_Python 3.7": [] + "python_python_3_7": [] } } }, - "python_Python 2.7": { + "python_python_2_7": { "enabled": true, "label": "Python", "variant_label": "2.7", @@ -1514,11 +1514,11 @@ }, "environment": { "__environment_keys__": { - "python_Python 2.7": [] + "python_python_2_7": [] } } }, - "terminal_Terminal": { + "terminal_terminal": { "enabled": true, "label": "Terminal", "variant_label": "", @@ -1535,7 +1535,7 @@ }, "environment": { "__environment_keys__": { - "terminal_Terminal": [] + "terminal_terminal": [] } } } @@ -1552,7 +1552,7 @@ } }, "variants": { - "djvview_1.1": { + "djvview_1_1": { "enabled": true, "label": "", "variant_label": "1.1", @@ -1569,10 +1569,10 @@ }, "environment": { "__environment_keys__": { - "djvview_1.1": [] + "djvview_1_1": [] } } } } } -} +} \ No newline at end of file From d55d133b7987aee1963fafb47df65e8d38b16e46 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:06:42 +0100 Subject: [PATCH 04/27] replaced dots in default tools --- pype/settings/defaults/system_settings/tools.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/settings/defaults/system_settings/tools.json b/pype/settings/defaults/system_settings/tools.json index af5772705c..fce847fb55 100644 --- a/pype/settings/defaults/system_settings/tools.json +++ b/pype/settings/defaults/system_settings/tools.json @@ -36,18 +36,18 @@ } }, "variants": { - "mtoa_3.2": { + "mtoa_3_2": { "MTOA_VERSION": "3.2", "__environment_keys__": { - "mtoa_3.2": [ + "mtoa_3_2": [ "MTOA_VERSION" ] } }, - "mtoa_3.1": { + "mtoa_3_1": { "MTOA_VERSION": "3.1", "__environment_keys__": { - "mtoa_3.1": [ + "mtoa_3_1": [ "MTOA_VERSION" ] } From 1ba1cf9acace5200f6d95fd4be37380cb8177121 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:27:30 +0100 Subject: [PATCH 05/27] nuke shortcuts have valid keys --- pype/settings/defaults/project_settings/nuke.json | 10 +++++----- .../schemas/projects_schema/schema_project_nuke.json | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/pype/settings/defaults/project_settings/nuke.json b/pype/settings/defaults/project_settings/nuke.json index f808f9caa5..d727a6ba1e 100644 --- a/pype/settings/defaults/project_settings/nuke.json +++ b/pype/settings/defaults/project_settings/nuke.json @@ -1,11 +1,11 @@ { "menu": { "Pype": { - "Create...": "ctrl+shift+alt+c", - "Publish...": "ctrl+alt+p", - "Load...": "ctrl+alt+l", - "Manage...": "ctrl+alt+m", - "Build Workfile": "ctrl+alt+b" + "create": "ctrl+shift+alt+c", + "publish": "ctrl+alt+p", + "load": "ctrl+alt+l", + "manage": "ctrl+alt+m", + "build_workfile": "ctrl+alt+b" } }, "create": { diff --git a/pype/settings/entities/schemas/projects_schema/schema_project_nuke.json b/pype/settings/entities/schemas/projects_schema/schema_project_nuke.json index 90e068ba33..3fe01cad09 100644 --- a/pype/settings/entities/schemas/projects_schema/schema_project_nuke.json +++ b/pype/settings/entities/schemas/projects_schema/schema_project_nuke.json @@ -20,27 +20,27 @@ "children": [ { "type": "text", - "key": "Create...", + "key": "create", "label": "Create..." }, { "type": "text", - "key": "Publish...", + "key": "publish", "label": "Publish..." }, { "type": "text", - "key": "Load...", + "key": "load", "label": "Load..." }, { "type": "text", - "key": "Manage...", + "key": "manage", "label": "Manage..." }, { "type": "text", - "key": "Build Workfile", + "key": "build_workfile", "label": "Build Workfile" } ] From 220454aa542a9006e60f48be4e8f9ddf2bea7d53 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:27:54 +0100 Subject: [PATCH 06/27] added key -> label mapping to nuke shortcut implementation --- pype/hosts/nuke/api/menu.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pype/hosts/nuke/api/menu.py b/pype/hosts/nuke/api/menu.py index 9ff1dc251a..3f97cc228a 100644 --- a/pype/hosts/nuke/api/menu.py +++ b/pype/hosts/nuke/api/menu.py @@ -85,6 +85,13 @@ def add_shortcuts_from_presets(): nuke_presets = get_current_project_settings()["nuke"] if nuke_presets.get("menu"): + menu_label_mapping = { + "manage": "Manage...", + "create": "Create...", + "load": "Load...", + "build_workfile": "Build Workfile", + "publish": "Publish..." + } for menu_name, menuitems in nuke_presets.get("menu").items(): menu = menubar.findItem(menu_name) for mitem_name, shortcut in menuitems.items(): @@ -92,7 +99,8 @@ def add_shortcuts_from_presets(): shortcut, mitem_name )) try: - menuitem = menu.findItem(mitem_name) + item_label = menu_label_mapping[mitem_name] + menuitem = menu.findItem(item_label) menuitem.setShortcut(shortcut) except AttributeError as e: log.error(e) From 96a80438e08115f6a8cc7ca5e57c5b7f97912a11 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:28:28 +0100 Subject: [PATCH 07/27] defined allowed key symbols and regex in constants --- pype/settings/constants.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pype/settings/constants.py b/pype/settings/constants.py index ce19ad3f93..f6077e826e 100644 --- a/pype/settings/constants.py +++ b/pype/settings/constants.py @@ -1,3 +1,6 @@ +import re + + # Metadata keys for work with studio and project overrides M_OVERRIDEN_KEY = "__overriden_keys__" # Metadata key for storing information about environments @@ -19,6 +22,10 @@ LOCAL_SETTING_KEY = "local_settings" DEFAULT_PROJECT_KEY = "__default_project__" +KEY_ALLOWED_SYMBOLS = "a-zA-Z0-9-_ " +KEY_REGEX = re.compile(r"^[{}]+$".format(KEY_ALLOWED_SYMBOLS)) + + __all__ = ( "M_OVERRIDEN_KEY", "M_ENVIRONMENT_KEY", @@ -29,5 +36,10 @@ __all__ = ( "SYSTEM_SETTINGS_KEY", "PROJECT_SETTINGS_KEY", "PROJECT_ANATOMY_KEY", - "LOCAL_SETTING_KEY" + "LOCAL_SETTING_KEY", + + "DEFAULT_PROJECT_KEY", + + "KEY_ALLOWED_SYMBOLS", + "KEY_REGEX" ) From 7f39cf5dd492e0c6c5ea583343ee1c4a7cf65f09 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:28:48 +0100 Subject: [PATCH 08/27] implemented exception InvalidKeySymbols --- pype/settings/entities/exceptions.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pype/settings/entities/exceptions.py b/pype/settings/entities/exceptions.py index 2c3b262ff1..f86d08ab5f 100644 --- a/pype/settings/entities/exceptions.py +++ b/pype/settings/entities/exceptions.py @@ -1,3 +1,6 @@ +from pype.settings.constants import KEY_ALLOWED_SYMBOLS + + class DefaultsNotDefined(Exception): def __init__(self, obj): msg = "Default values for object are not set. {}".format(obj.path) @@ -34,6 +37,14 @@ class RequiredKeyModified(KeyError): super(RequiredKeyModified, self).__init__(msg.format(entity_path, key)) +class InvalidKeySymbols(KeyError): + def __init__(self, entity_path, key): + msg = "{} - Invalid key \"{}\". Allowed symbols are {}" + super(InvalidKeySymbols, self).__init__( + msg.format(entity_path, key, KEY_ALLOWED_SYMBOLS) + ) + + class SchemaError(Exception): pass From 01d066025380e7eeb112fa31fa4e799af0cfe4a5 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:29:12 +0100 Subject: [PATCH 09/27] immutable dict is validating keys with allowed symbols --- pype/settings/entities/dict_immutable_keys_entity.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pype/settings/entities/dict_immutable_keys_entity.py b/pype/settings/entities/dict_immutable_keys_entity.py index 92a36b7dca..270e635736 100644 --- a/pype/settings/entities/dict_immutable_keys_entity.py +++ b/pype/settings/entities/dict_immutable_keys_entity.py @@ -7,7 +7,8 @@ from .lib import ( ) from pype.settings.constants import ( METADATA_KEYS, - M_OVERRIDEN_KEY + M_OVERRIDEN_KEY, + KEY_REGEX ) from . import ( BaseItemEntity, @@ -17,7 +18,8 @@ from . import ( ) from .exceptions import ( SchemaDuplicatedKeys, - EntitySchemaError + EntitySchemaError, + InvalidKeySymbols ) @@ -88,6 +90,10 @@ class DictImmutableKeysEntity(ItemEntity): else: raise SchemaDuplicatedKeys(self, child_entity.key) + for key in self.keys(): + if not KEY_REGEX.match(key): + raise InvalidKeySymbols(self.path, key) + if self.checkbox_key: checkbox_child = self.non_gui_children.get(self.checkbox_key) if not checkbox_child: From 48a300cfc312bc228172b0ab7f5a55cd54f202ca Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:29:56 +0100 Subject: [PATCH 10/27] mutable dictionary validate keys on change and tries to fix them on load --- pype/settings/entities/__init__.py | 2 ++ .../entities/dict_mutable_keys_entity.py | 25 ++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/pype/settings/entities/__init__.py b/pype/settings/entities/__init__.py index 1cb4be62e7..2ff911e7d4 100644 --- a/pype/settings/entities/__init__.py +++ b/pype/settings/entities/__init__.py @@ -58,6 +58,7 @@ from .exceptions import ( DefaultsNotDefined, StudioDefaultsNotDefined, InvalidValueType, + InvalidKeySymbols, SchemaMissingFileInfo, SchemeGroupHierarchyBug, SchemaDuplicatedKeys, @@ -114,6 +115,7 @@ __all__ = ( "DefaultsNotDefined", "StudioDefaultsNotDefined", "InvalidValueType", + "InvalidKeySymbols", "SchemaMissingFileInfo", "SchemeGroupHierarchyBug", "SchemaDuplicatedKeys", diff --git a/pype/settings/entities/dict_mutable_keys_entity.py b/pype/settings/entities/dict_mutable_keys_entity.py index 7005d346c1..12a18ad612 100644 --- a/pype/settings/entities/dict_mutable_keys_entity.py +++ b/pype/settings/entities/dict_mutable_keys_entity.py @@ -1,3 +1,4 @@ +import re import copy from .lib import ( @@ -7,6 +8,7 @@ from .lib import ( from . import EndpointEntity from .exceptions import ( DefaultsNotDefined, + InvalidKeySymbols, StudioDefaultsNotDefined, RequiredKeyModified, EntitySchemaError @@ -14,7 +16,9 @@ from .exceptions import ( from pype.settings.constants import ( METADATA_KEYS, M_DYNAMIC_KEY_LABEL, - M_ENVIRONMENT_KEY + M_ENVIRONMENT_KEY, + KEY_REGEX, + KEY_ALLOWED_SYMBOLS ) @@ -92,6 +96,9 @@ class DictMutableKeysEntity(EndpointEntity): # TODO Check for value type if is Settings entity? child_obj = self.children_by_key.get(key) if not child_obj: + if not KEY_REGEX.match(key): + raise InvalidKeySymbols(self.path, key) + child_obj = self.add_key(key) child_obj.set(value) @@ -102,6 +109,10 @@ class DictMutableKeysEntity(EndpointEntity): if new_key == old_key: return + + if not KEY_REGEX.match(new_key): + raise InvalidKeySymbols(self.path, new_key) + self.children_by_key[new_key] = self.children_by_key.pop(old_key) self._on_key_label_change() @@ -116,6 +127,9 @@ class DictMutableKeysEntity(EndpointEntity): if key in self.children_by_key: self.pop(key) + if not KEY_REGEX.match(key): + raise InvalidKeySymbols(self.path, key) + if self.value_is_env_group: item_schema = copy.deepcopy(self.item_schema) item_schema["env_group_key"] = key @@ -325,6 +339,15 @@ class DictMutableKeysEntity(EndpointEntity): children_label_by_id = {} metadata_labels = metadata.get(M_DYNAMIC_KEY_LABEL) or {} for _key, _value in new_value.items(): + if not KEY_REGEX.match(_key): + # Replace invalid characters with underscore + # - this is safety to not break already existing settings + _key = re.sub( + r"[^{}]+".format(KEY_ALLOWED_SYMBOLS), + "_", + _key + ) + child_entity = self._add_key(_key) child_entity.update_default_value(_value) if using_project_overrides: From f5e9096fdcfd142f447de6ea4563efe4d2054fa2 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:38:42 +0100 Subject: [PATCH 11/27] added key validation to roots entity --- pype/settings/entities/root_entities.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pype/settings/entities/root_entities.py b/pype/settings/entities/root_entities.py index 82885e8479..2d33689697 100644 --- a/pype/settings/entities/root_entities.py +++ b/pype/settings/entities/root_entities.py @@ -13,11 +13,15 @@ from .lib import ( get_studio_settings_schema, get_project_settings_schema ) -from .exceptions import EntitySchemaError +from .exceptions import ( + EntitySchemaError, + InvalidKeySymbols +) from pype.settings.constants import ( SYSTEM_SETTINGS_KEY, PROJECT_SETTINGS_KEY, - PROJECT_ANATOMY_KEY + PROJECT_ANATOMY_KEY, + KEY_REGEX ) from pype.settings.lib import ( @@ -153,6 +157,10 @@ class RootEntity(BaseItemEntity): raise EntitySchemaError(self, reason) child_entity.schema_validations() + for key in self.non_gui_children.keys(): + if not KEY_REGEX.match(key): + raise InvalidKeySymbols(self.path, key) + def get_entity_from_path(self, path): """Return system settings entity.""" raise NotImplementedError(( From 2567fee07284019d3445295ad2ae5e34b358343a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 13:52:15 +0100 Subject: [PATCH 12/27] added key validations to modifiable dict widget --- .../settings/widgets/dict_mutable_widget.py | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/pype/tools/settings/settings/widgets/dict_mutable_widget.py b/pype/tools/settings/settings/widgets/dict_mutable_widget.py index 0cb051082e..c55af7a774 100644 --- a/pype/tools/settings/settings/widgets/dict_mutable_widget.py +++ b/pype/tools/settings/settings/widgets/dict_mutable_widget.py @@ -12,6 +12,7 @@ from .lib import ( BTN_FIXED_SIZE, CHILD_OFFSET ) +from pype.settings.constants import KEY_REGEX def create_add_btn(parent): @@ -37,6 +38,7 @@ class ModifiableDictEmptyItem(QtWidgets.QWidget): self.collapsible_key = entity_widget.entity.collapsible_key self.is_duplicated = False + self.key_is_valid = False if self.collapsible_key: self.create_collapsible_ui() @@ -86,6 +88,9 @@ class ModifiableDictEmptyItem(QtWidgets.QWidget): if self.is_duplicated: return + if not self.key_is_valid: + return + key = self.key_input.text() if key: label = self.key_label_input.text() @@ -95,9 +100,10 @@ class ModifiableDictEmptyItem(QtWidgets.QWidget): def _on_key_change(self): key = self.key_input.text() + self.key_is_valid = KEY_REGEX.match(key) self.is_duplicated = self.entity_widget.is_key_duplicated(key) key_input_state = "" - if self.is_duplicated: + if self.is_duplicated or not self.key_is_valid: key_input_state = "invalid" elif key != "": key_input_state = "modified" @@ -157,6 +163,7 @@ class ModifiableDictItem(QtWidgets.QWidget): self.ignore_input_changes = entity_widget.ignore_input_changes self.is_key_duplicated = False + self.key_is_valid = False self.is_required = False self.origin_key = None @@ -382,6 +389,11 @@ class ModifiableDictItem(QtWidgets.QWidget): def _on_key_change(self): key = self.key_value() + self.key_is_valid = KEY_REGEX.match(key) + if not self.key_is_valid: + self.update_style() + return + is_key_duplicated = self.entity_widget.validate_key_duplication( self.temp_key, key, self ) @@ -458,6 +470,7 @@ class ModifiableDictItem(QtWidgets.QWidget): self.is_key_duplicated or self.key_value() == "" or self.child_invalid + or not self.key_is_valid ) @property @@ -473,7 +486,11 @@ class ModifiableDictItem(QtWidgets.QWidget): def update_style(self): key_input_state = "" - if self.is_key_duplicated or self.key_value() == "": + if ( + self.is_key_duplicated + or self.key_value() == "" + or not self.key_is_valid + ): key_input_state = "invalid" elif self.is_key_modified(): key_input_state = "modified" From 994238a63812031655deb51020dc319016b3398f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 14:11:03 +0100 Subject: [PATCH 13/27] better key validation --- .../settings/settings/widgets/dict_mutable_widget.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/pype/tools/settings/settings/widgets/dict_mutable_widget.py b/pype/tools/settings/settings/widgets/dict_mutable_widget.py index c55af7a774..e704dd40ee 100644 --- a/pype/tools/settings/settings/widgets/dict_mutable_widget.py +++ b/pype/tools/settings/settings/widgets/dict_mutable_widget.py @@ -341,7 +341,7 @@ class ModifiableDictItem(QtWidgets.QWidget): else: self._on_focus_lose() - if not self.is_key_duplicated: + if not self.is_key_duplicated and self.key_is_valid: self.entity_widget.change_key(self.key_value(), self) def set_key_label(self, key, label): @@ -390,15 +390,11 @@ class ModifiableDictItem(QtWidgets.QWidget): def _on_key_change(self): key = self.key_value() self.key_is_valid = KEY_REGEX.match(key) - if not self.key_is_valid: - self.update_style() - return - is_key_duplicated = self.entity_widget.validate_key_duplication( self.temp_key, key, self ) self.temp_key = key - if is_key_duplicated: + if is_key_duplicated or not self.key_is_valid: return if key: From 9a0070e5a123def51d3b0a079587b737a5cd1a71 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 14:20:29 +0100 Subject: [PATCH 14/27] fixed modifiable dict collapsible key widget --- pype/tools/settings/settings/widgets/dict_mutable_widget.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pype/tools/settings/settings/widgets/dict_mutable_widget.py b/pype/tools/settings/settings/widgets/dict_mutable_widget.py index e704dd40ee..e44ffdf35a 100644 --- a/pype/tools/settings/settings/widgets/dict_mutable_widget.py +++ b/pype/tools/settings/settings/widgets/dict_mutable_widget.py @@ -765,15 +765,17 @@ class DictMutableKeysWidget(BaseWidget): old_key_items.append(input_field) if duplicated_items: - widget.set_is_key_duplicated(True) for input_field in duplicated_items: input_field.set_is_key_duplicated(True) + widget.set_is_key_duplicated(True) else: widget.set_is_key_duplicated(False) if len(old_key_items) == 1: for input_field in old_key_items: input_field.set_is_key_duplicated(False) + input_field.set_key(old_key) + input_field.update_key_label() self.trigger_hierarchical_style_update() return bool(duplicated_items) From 6eb792144ba7ba1a240330fe4e93eb4442e9a41f Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 17:57:58 +0100 Subject: [PATCH 15/27] removed celaction publish variant --- .../system_schema/host_settings/schema_celaction.json | 7 ------- 1 file changed, 7 deletions(-) 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 6fa596808d..c5fe824f94 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 @@ -34,13 +34,6 @@ "app_name": "celation", "multiplatform": false, "multipath_executables": false - }, - { - "app_variant_label": "Publish", - "app_variant": "Publish", - "app_name": "celation", - "multiplatform": false, - "multipath_executables": false } ] } From 07fb6379263e1916a21f6d1b8b2fdea05bbc7e95 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 17:58:40 +0100 Subject: [PATCH 16/27] dashes are used as version serparators instead of underscore on apps --- .../system_settings/applications.json | 113 ++++++++---------- .../host_settings/schema_blender.json | 4 +- .../host_settings/schema_djv.json | 2 +- .../host_settings/schema_shell.json | 4 +- .../host_settings/schema_tvpaint.json | 4 +- .../host_settings/schema_unreal.json | 2 +- .../host_settings/template_nuke.json | 8 +- 7 files changed, 60 insertions(+), 77 deletions(-) diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index 436ef62342..90e30c8a51 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -253,7 +253,7 @@ } }, "variants": { - "nuke_12_2": { + "nuke_12-2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -274,11 +274,11 @@ }, "environment": { "__environment_keys__": { - "nuke_12_2": [] + "nuke_12-2": [] } } }, - "nuke_12_0": { + "nuke_12-0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -299,11 +299,11 @@ }, "environment": { "__environment_keys__": { - "nuke_12_0": [] + "nuke_12-0": [] } } }, - "nuke_11_3": { + "nuke_11-3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -324,11 +324,11 @@ }, "environment": { "__environment_keys__": { - "nuke_11_3": [] + "nuke_11-3": [] } } }, - "nuke_11_2": { + "nuke_11-2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -347,7 +347,7 @@ }, "environment": { "__environment_keys__": { - "nuke_11_2": [] + "nuke_11-2": [] } } } @@ -377,7 +377,7 @@ } }, "variants": { - "nukex_12_2": { + "nukex_12-2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -404,11 +404,11 @@ }, "environment": { "__environment_keys__": { - "nukex_12_2": [] + "nukex_12-2": [] } } }, - "nukex_12_0": { + "nukex_12-0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -435,11 +435,11 @@ }, "environment": { "__environment_keys__": { - "nukex_12_0": [] + "nukex_12-0": [] } } }, - "nukex_11_3": { + "nukex_11-3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -466,11 +466,11 @@ }, "environment": { "__environment_keys__": { - "nukex_11_3": [] + "nukex_11-3": [] } } }, - "nukex_11_2": { + "nukex_11-2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -495,7 +495,7 @@ }, "environment": { "__environment_keys__": { - "nukex_11_2": [] + "nukex_11-2": [] } } } @@ -527,7 +527,7 @@ } }, "variants": { - "nukestudio_12_2": { + "nukestudio_12-2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -554,11 +554,11 @@ }, "environment": { "__environment_keys__": { - "nukestudio_12_2": [] + "nukestudio_12-2": [] } } }, - "nukestudio_12_0": { + "nukestudio_12-0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -585,11 +585,11 @@ }, "environment": { "__environment_keys__": { - "nukestudio_12_0": [] + "nukestudio_12-0": [] } } }, - "nukestudio_11_3": { + "nukestudio_11-3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -616,11 +616,11 @@ }, "environment": { "__environment_keys__": { - "nukestudio_11_3": [] + "nukestudio_11-3": [] } } }, - "nukestudio_11_2": { + "nukestudio_11-2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -643,7 +643,7 @@ }, "environment": { "__environment_keys__": { - "nukestudio_11_2": [] + "nukestudio_11-2": [] } } } @@ -675,7 +675,7 @@ } }, "variants": { - "hiero_12_2": { + "hiero_12-2": { "enabled": true, "label": "", "variant_label": "12.2", @@ -702,11 +702,11 @@ }, "environment": { "__environment_keys__": { - "hiero_12_2": [] + "hiero_12-2": [] } } }, - "hiero_12_0": { + "hiero_12-0": { "enabled": true, "label": "", "variant_label": "12.0", @@ -733,11 +733,11 @@ }, "environment": { "__environment_keys__": { - "hiero_12_0": [] + "hiero_12-0": [] } } }, - "hiero_11_3": { + "hiero_11-3": { "enabled": true, "label": "", "variant_label": "11.3", @@ -764,11 +764,11 @@ }, "environment": { "__environment_keys__": { - "hiero_11_3": [] + "hiero_11-3": [] } } }, - "hiero_11_2": { + "hiero_11-2": { "enabled": true, "label": "", "variant_label": "11.2", @@ -793,7 +793,7 @@ }, "environment": { "__environment_keys__": { - "hiero_11_2": [] + "hiero_11-2": [] } } } @@ -1057,7 +1057,7 @@ } }, "variants": { - "blender_2_83": { + "blender_2-83": { "enabled": true, "label": "", "variant_label": "2.83", @@ -1082,11 +1082,11 @@ }, "environment": { "__environment_keys__": { - "blender_2_83": [] + "blender_2-83": [] } } }, - "blender_2_90": { + "blender_2-90": { "enabled": true, "label": "", "variant_label": "2.90", @@ -1111,7 +1111,7 @@ }, "environment": { "__environment_keys__": { - "blender_2_90": [] + "blender_2-90": [] } } } @@ -1193,7 +1193,7 @@ } }, "variants": { - "tvpaint_animation_11_64bit": { + "tvpaint_animation_11-64bits": { "enabled": true, "label": "", "variant_label": "11 (64bits)", @@ -1212,11 +1212,11 @@ }, "environment": { "__environment_keys__": { - "tvpaint_animation_11_64bit": [] + "tvpaint_animation_11-64bits": [] } } }, - "tvpaint_animation_11_32bit": { + "tvpaint_animation_11-32bits": { "enabled": true, "label": "", "variant_label": "11 (32bits)", @@ -1235,7 +1235,7 @@ }, "environment": { "__environment_keys__": { - "tvpaint_animation_11_32bit": [] + "tvpaint_animation_11-32bits": [] } } } @@ -1407,23 +1407,6 @@ "celation_Local": [] } } - }, - "celation_Publish": { - "enabled": true, - "label": "", - "variant_label": "Pulblish", - "icon": "", - "executables": "", - "arguments": { - "windows": [], - "darwin": [], - "linux": [] - }, - "environment": { - "__environment_keys__": { - "celation_Publish": [] - } - } } } }, @@ -1445,7 +1428,7 @@ } }, "variants": { - "unreal_4_24": { + "unreal_4-24": { "enabled": true, "label": "", "variant_label": "4.24", @@ -1462,7 +1445,7 @@ }, "environment": { "__environment_keys__": { - "unreal_4_24": [] + "unreal_4-24": [] } } } @@ -1476,7 +1459,7 @@ } }, "variants": { - "python_python_3_7": { + "python_python_3-7": { "enabled": true, "label": "Python", "variant_label": "3.7", @@ -1493,11 +1476,11 @@ }, "environment": { "__environment_keys__": { - "python_python_3_7": [] + "python_python_3-7": [] } } }, - "python_python_2_7": { + "python_python_2-7": { "enabled": true, "label": "Python", "variant_label": "2.7", @@ -1514,7 +1497,7 @@ }, "environment": { "__environment_keys__": { - "python_python_2_7": [] + "python_python_2-7": [] } } }, @@ -1552,7 +1535,7 @@ } }, "variants": { - "djvview_1_1": { + "djvview_1-1": { "enabled": true, "label": "", "variant_label": "1.1", @@ -1569,7 +1552,7 @@ }, "environment": { "__environment_keys__": { - "djvview_1_1": [] + "djvview_1-1": [] } } } 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 725a0685b6..5030f8280f 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 @@ -30,12 +30,12 @@ "template_data": [ { "app_variant_label": "2.83", - "app_variant": "2_83", + "app_variant": "2-83", "app_name": "blender" }, { "app_variant_label": "2.90", - "app_variant": "2_90", + "app_variant": "2-90", "app_name": "blender" } ] 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 8bbdb7ea9b..3f3af3585a 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 @@ -29,7 +29,7 @@ "name": "template_host_variant", "template_data": { "app_variant_label": "1.1", - "app_variant": "1_1", + "app_variant": "1-1", "app_name": "djvview" } } 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 f72450aa08..3288fe2ffb 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 @@ -25,12 +25,12 @@ "name": "template_host_variant", "template_data": [ { - "app_variant": "python_3_7", + "app_variant": "python_3-7", "app_variant_label": "Python 3.7", "app_name": "python" }, { - "app_variant": "python_2_7", + "app_variant": "python_2-7", "app_variant_label": "Python 2.7", "app_name": "python" }, 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 a569ec0503..a3cc6188ac 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 @@ -30,12 +30,12 @@ "template_data": [ { "app_variant_label": "Animation 11 (64bits)", - "app_variant": "animation_11_64bit", + "app_variant": "animation_11-64bits", "app_name": "tvpaint" }, { "app_variant_label": "Animation 11 (32bits)", - "app_variant": "animation_11_32bit", + "app_variant": "animation_11-32bits", "app_name": "tvpaint" } ] 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 b23a21b0fd..c79f08b71a 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 @@ -29,7 +29,7 @@ "name": "template_host_variant", "template_data": [ { - "app_variant": "4_24", + "app_variant": "4-24", "app_variant_label": "4.24", "app_name": "unreal" } 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 d32f87949d..c86c2aef61 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 @@ -30,22 +30,22 @@ "name": "template_host_variant", "template_data": [ { - "app_variant": "12_2", + "app_variant": "12-2", "app_variant_label": "12.2", "app_name": "{nuke_type}" }, { - "app_variant": "12_0", + "app_variant": "12-0", "app_variant_label": "12.0", "app_name": "{nuke_type}" }, { - "app_variant": "11_3", + "app_variant": "11-3", "app_variant_label": "11.3", "app_name": "{nuke_type}" }, { - "app_variant": "11_2", + "app_variant": "11-2", "app_variant_label": "11.2", "app_name": "{nuke_type}" } From 2fbe5d816558e7e995bc3ade8a09bb244e898c35 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 19:40:51 +0100 Subject: [PATCH 17/27] tools are dynamic dictionaries --- .../schemas/system_schema/schema_tools.json | 52 +++++++++---------- .../tool_settings/schema_arnold.json | 29 ----------- .../tool_settings/schema_vray.json | 29 ----------- .../tool_settings/schema_yeti.json | 29 ----------- .../tool_settings/template_tool_variant.json | 11 ---- 5 files changed, 25 insertions(+), 125 deletions(-) delete mode 100644 pype/settings/entities/schemas/system_schema/tool_settings/schema_arnold.json delete mode 100644 pype/settings/entities/schemas/system_schema/tool_settings/schema_vray.json delete mode 100644 pype/settings/entities/schemas/system_schema/tool_settings/schema_yeti.json delete mode 100644 pype/settings/entities/schemas/system_schema/tool_settings/template_tool_variant.json diff --git a/pype/settings/entities/schemas/system_schema/schema_tools.json b/pype/settings/entities/schemas/system_schema/schema_tools.json index 2c04abc47c..188d2fc8e8 100644 --- a/pype/settings/entities/schemas/system_schema/schema_tools.json +++ b/pype/settings/entities/schemas/system_schema/schema_tools.json @@ -1,37 +1,35 @@ { - "key": "tools", "type": "dict", - "label": "Tools", + "key": "tools", "collapsible": true, "is_file": true, "children": [ { - "type": "schema", - "name": "schema_arnold" - }, - { - "type": "schema", - "name": "schema_vray" - }, - { - "type": "schema", - "name": "schema_yeti" - }, - { - "type": "dict", - "key": "other", - "children": [ - { - "type": "schema_template", - "name": "template_tool_variant", - "template_data": [ - { - "tool_name": "othertools", - "tool_label": "Other Tools and Plugins" + "type": "dict-modifiable", + "label": "Tools", + "key": "tool_groups", + "collapsible_key": true, + "object_type": { + "type": "dict", + "children": [ + { + "key": "environment", + "label": "Environments", + "type": "raw-json" + }, + { + "type": "separator" + }, + { + "type": "dict-modifiable", + "key": "variants", + "label": "Variants", + "object_type": { + "type": "raw-json" } - ] - } - ] + } + ] + } } ] } diff --git a/pype/settings/entities/schemas/system_schema/tool_settings/schema_arnold.json b/pype/settings/entities/schemas/system_schema/tool_settings/schema_arnold.json deleted file mode 100644 index db2be09c83..0000000000 --- a/pype/settings/entities/schemas/system_schema/tool_settings/schema_arnold.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "dict", - "key": "mtoa", - "label": "Autodesk Arnold", - "collapsible": true, - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "key": "environment", - "label": "Environment (mtoa)", - "type": "raw-json", - "env_group_key": "mtoa" - }, - { - "type": "schema_template", - "name": "template_tool_variant", - "template_data": [ - { - "tool_label": "Arnold Versions" - } - ] - } - ] -} diff --git a/pype/settings/entities/schemas/system_schema/tool_settings/schema_vray.json b/pype/settings/entities/schemas/system_schema/tool_settings/schema_vray.json deleted file mode 100644 index 295b3ccac3..0000000000 --- a/pype/settings/entities/schemas/system_schema/tool_settings/schema_vray.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "dict", - "key": "vray", - "label": "Chaos Group Vray", - "collapsible": true, - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "key": "environment", - "label": "Environment", - "type": "raw-json", - "env_group_key": "vray" - }, - { - "type": "schema_template", - "name": "template_tool_variant", - "template_data": [ - { - "tool_label": "Vray Versions" - } - ] - } - ] -} diff --git a/pype/settings/entities/schemas/system_schema/tool_settings/schema_yeti.json b/pype/settings/entities/schemas/system_schema/tool_settings/schema_yeti.json deleted file mode 100644 index 34bb09da8d..0000000000 --- a/pype/settings/entities/schemas/system_schema/tool_settings/schema_yeti.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "type": "dict", - "key": "yeti", - "label": "Pergrine Labs Yeti", - "collapsible": true, - "checkbox_key": "enabled", - "children": [ - { - "type": "boolean", - "key": "enabled", - "label": "Enabled" - }, - { - "key": "environment", - "label": "Environment", - "type": "raw-json", - "env_group_key": "yeti" - }, - { - "type": "schema_template", - "name": "template_tool_variant", - "template_data": [ - { - "tool_label": "Yeti Versions" - } - ] - } - ] -} diff --git a/pype/settings/entities/schemas/system_schema/tool_settings/template_tool_variant.json b/pype/settings/entities/schemas/system_schema/tool_settings/template_tool_variant.json deleted file mode 100644 index b0ba63469c..0000000000 --- a/pype/settings/entities/schemas/system_schema/tool_settings/template_tool_variant.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "type": "dict-modifiable", - "key": "variants", - "label": "{tool_label}", - "value_is_env_group": true, - "object_type": { - "type": "raw-json" - } - } -] From ddd5cbb13624360064fa19d7f50b9e6bf89e0387 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 19:42:06 +0100 Subject: [PATCH 18/27] changed exception type on root entity --- pype/settings/entities/root_entities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/settings/entities/root_entities.py b/pype/settings/entities/root_entities.py index 2d33689697..e7cb098c67 100644 --- a/pype/settings/entities/root_entities.py +++ b/pype/settings/entities/root_entities.py @@ -14,7 +14,7 @@ from .lib import ( get_project_settings_schema ) from .exceptions import ( - EntitySchemaError, + SchemaError, InvalidKeySymbols ) from pype.settings.constants import ( @@ -154,7 +154,7 @@ class RootEntity(BaseItemEntity): "Root entity \"{}\" has child with `is_group`" " attribute set to True but root can't save overrides." ).format(self.__class__.__name__) - raise EntitySchemaError(self, reason) + raise SchemaError(reason) child_entity.schema_validations() for key in self.non_gui_children.keys(): From c24ba96bea143802537979dbd2bcd9ada74dd0df Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 19:42:26 +0100 Subject: [PATCH 19/27] added schema validation on object_type key in mutable dict item --- pype/settings/entities/dict_mutable_keys_entity.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pype/settings/entities/dict_mutable_keys_entity.py b/pype/settings/entities/dict_mutable_keys_entity.py index 12a18ad612..b465171734 100644 --- a/pype/settings/entities/dict_mutable_keys_entity.py +++ b/pype/settings/entities/dict_mutable_keys_entity.py @@ -202,7 +202,7 @@ class DictMutableKeysEntity(EndpointEntity): self.schema_data.get("highlight_content") or False ) - object_type = self.schema_data["object_type"] + object_type = self.schema_data.get("object_type") or {} if not isinstance(object_type, dict): # Backwards compatibility object_type = { @@ -226,6 +226,12 @@ class DictMutableKeysEntity(EndpointEntity): def schema_validations(self): super(DictMutableKeysEntity, self).schema_validations() + if not self.schema_data.get("object_type"): + reason = ( + "Modifiable dictionary must have specified `object_type`." + ) + raise EntitySchemaError(self, reason) + # TODO Ability to store labels should be defined with different key if self.collapsible_key and not self.file_item: reason = ( From 9582d9ffdfb703e5bc35199c9c2baa3893c223a6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 19:42:38 +0100 Subject: [PATCH 20/27] resaved tools --- .../defaults/system_settings/tools.json | 113 +++++++----------- 1 file changed, 42 insertions(+), 71 deletions(-) diff --git a/pype/settings/defaults/system_settings/tools.json b/pype/settings/defaults/system_settings/tools.json index fce847fb55..4c9a90993f 100644 --- a/pype/settings/defaults/system_settings/tools.json +++ b/pype/settings/defaults/system_settings/tools.json @@ -1,78 +1,49 @@ { - "mtoa": { - "enabled": true, - "environment": { - "MTOA": "{PYPE_STUDIO_SOFTWARE}/arnold/mtoa_{MAYA_VERSION}_{MTOA_VERSION}", - "MAYA_RENDER_DESC_PATH": "{MTOA}", - "MAYA_MODULE_PATH": "{MTOA}", - "ARNOLD_PLUGIN_PATH": "{MTOA}/shaders", - "MTOA_EXTENSIONS_PATH": { - "darwin": "{MTOA}/extensions", - "linux": "{MTOA}/extensions", - "windows": "{MTOA}/extensions" + "tool_groups": { + "mtoa": { + "environment": { + "MTOA": "{PYPE_STUDIO_SOFTWARE}/arnold/mtoa_{MAYA_VERSION}_{MTOA_VERSION}", + "MAYA_RENDER_DESC_PATH": "{MTOA}", + "MAYA_MODULE_PATH": "{MTOA}", + "ARNOLD_PLUGIN_PATH": "{MTOA}/shaders", + "MTOA_EXTENSIONS_PATH": { + "darwin": "{MTOA}/extensions", + "linux": "{MTOA}/extensions", + "windows": "{MTOA}/extensions" + }, + "MTOA_EXTENSIONS": { + "darwin": "{MTOA}/extensions", + "linux": "{MTOA}/extensions", + "windows": "{MTOA}/extensions" + }, + "DYLD_LIBRARY_PATH": { + "darwin": "{MTOA}/bin" + }, + "PATH": { + "windows": "{PATH};{MTOA}/bin" + } }, - "MTOA_EXTENSIONS": { - "darwin": "{MTOA}/extensions", - "linux": "{MTOA}/extensions", - "windows": "{MTOA}/extensions" - }, - "DYLD_LIBRARY_PATH": { - "darwin": "{MTOA}/bin" - }, - "PATH": { - "windows": "{PATH};{MTOA}/bin" - }, - "__environment_keys__": { - "mtoa": [ - "MTOA", - "MAYA_RENDER_DESC_PATH", - "MAYA_MODULE_PATH", - "ARNOLD_PLUGIN_PATH", - "MTOA_EXTENSIONS_PATH", - "MTOA_EXTENSIONS", - "DYLD_LIBRARY_PATH", - "PATH" - ] + "variants": { + "mtoa_3-2": { + "MTOA_VERSION": "3.2" + }, + "mtoa_3-1": { + "MTOA_VERSION": "3.1" + } } }, - "variants": { - "mtoa_3_2": { - "MTOA_VERSION": "3.2", - "__environment_keys__": { - "mtoa_3_2": [ - "MTOA_VERSION" - ] - } - }, - "mtoa_3_1": { - "MTOA_VERSION": "3.1", - "__environment_keys__": { - "mtoa_3_1": [ - "MTOA_VERSION" - ] - } - } + "vray": { + "environment": {}, + "variants": {} + }, + "yeti": { + "environment": {}, + "variants": {} + }, + "__dynamic_keys_labels__": { + "mtoa": "Autodesk Arnold", + "yeti": "Pergrine Labs Yeti", + "vray": "Chaos Group Vray" } - }, - "vray": { - "enabled": true, - "environment": { - "__environment_keys__": { - "vray": [] - } - }, - "variants": {} - }, - "yeti": { - "enabled": true, - "environment": { - "__environment_keys__": { - "yeti": [] - } - }, - "variants": {} - }, - "other": { - "variants": {} } } \ No newline at end of file From 76bcca4c44aaada832304769d514dba5ed219209 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 19:42:53 +0100 Subject: [PATCH 21/27] changed how tools are used --- pype/lib/applications.py | 23 +++++++++-------------- pype/settings/entities/enum_entity.py | 12 +++++------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index abaecf1e9c..d62c5deff7 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -138,20 +138,16 @@ class ApplicationManager: app_group, app_name, host_name, app_data, self ) - tools_definitions = settings["tools"] + tools_definitions = settings["tools"]["tool_groups"] for tool_group_name, tool_group_data in tools_definitions.items(): - enabled = tool_group_data.get("enabled", True) tool_variants = tool_group_data.get("variants") or {} for tool_name, tool_data in tool_variants.items(): - if tool_name in self.tools: + tool = ApplicationTool(tool_name, tool_group_name) + if tool.full_name in self.tools: self.log.warning(( "Duplicated tool name in settings \"{}\"" - ).format(tool_name)) - - _enabled = tool_data.get("enabled", enabled) - self.tools[tool_name] = ApplicationTool( - tool_name, tool_group_name, _enabled - ) + ).format(tool.full_name)) + self.tools[tool.full_name] = tool def launch(self, app_name, **data): """Launch procedure. @@ -196,16 +192,15 @@ class ApplicationTool: Args: tool_name (str): Name of the tool. group_name (str): Name of group which wraps tool. - enabled (bool): Is tool enabled by studio. """ - def __init__(self, tool_name, group_name, enabled): + def __init__(self, tool_name, group_name): self.name = tool_name self.group_name = group_name - self.enabled = enabled - def __bool__(self): - return self.enabled + @property + def full_name(self): + return "/".join((self.group_name, self.name)) class ApplicationExecutable: diff --git a/pype/settings/entities/enum_entity.py b/pype/settings/entities/enum_entity.py index f06ec97f4b..ca0d5dec21 100644 --- a/pype/settings/entities/enum_entity.py +++ b/pype/settings/entities/enum_entity.py @@ -170,14 +170,12 @@ class ToolsEnumEntity(BaseEnumEntity): valid_keys = set() enum_items = [] - for tool_group in system_settings_entity["tools"].values(): - enabled_entity = tool_group.get("enabled") - if enabled_entity and not enabled_entity.value: - continue - + tools_entity = system_settings_entity["tools"] + for group_name, tool_group in tools_entity["tool_groups"].items(): for variant_name in tool_group["variants"].keys(): - enum_items.append({variant_name: variant_name}) - valid_keys.add(variant_name) + tool_name = "/".join((group_name, variant_name)) + enum_items.append({tool_name: tool_name}) + valid_keys.add(tool_name) return enum_items, valid_keys def set_override_state(self, *args, **kwargs): From e3c44925d48f4c8f1843a57116d429973f97bfa6 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 25 Mar 2021 19:50:18 +0100 Subject: [PATCH 22/27] fix tool name in create update attriutes action --- .../event_handlers_user/action_create_cust_attrs.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pype/modules/ftrack/event_handlers_user/action_create_cust_attrs.py b/pype/modules/ftrack/event_handlers_user/action_create_cust_attrs.py index ae040fd630..8ff0cade7b 100644 --- a/pype/modules/ftrack/event_handlers_user/action_create_cust_attrs.py +++ b/pype/modules/ftrack/event_handlers_user/action_create_cust_attrs.py @@ -400,11 +400,10 @@ class CustomAttributes(BaseAction): def tools_attribute(self, event): tools_data = [] - for tool_name, tool in self.app_manager.tools.items(): - if tool.enabled: - tools_data.append({ - tool_name: tool_name - }) + for tool_name in self.app_manager.tools.keys(): + tools_data.append({ + tool_name: tool_name + }) # Make sure there is at least one item if not tools_data: From 5d610145c6fe1b28f756bec7439a2ec620e699c1 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 26 Mar 2021 11:32:20 +0100 Subject: [PATCH 23/27] fix houdini defaults --- pype/settings/defaults/system_settings/applications.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index 1c080aa613..ea910e125d 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -992,7 +992,7 @@ } }, "variants": { - "houdini_18.5": { + "houdini_18-5": { "enabled": true, "label": "", "variant_label": "18.5", @@ -1011,7 +1011,7 @@ }, "environment": { "__environment_keys__": { - "houdini_18.5": [] + "houdini_18-5": [] } } }, From 8b4f462af9d999024479a565d7ff9518b95d04ae Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 26 Mar 2021 11:33:30 +0100 Subject: [PATCH 24/27] removed "mtoa" from mtoa variants --- pype/settings/defaults/system_settings/tools.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pype/settings/defaults/system_settings/tools.json b/pype/settings/defaults/system_settings/tools.json index 4c9a90993f..215139468c 100644 --- a/pype/settings/defaults/system_settings/tools.json +++ b/pype/settings/defaults/system_settings/tools.json @@ -24,10 +24,10 @@ } }, "variants": { - "mtoa_3-2": { + "3-2": { "MTOA_VERSION": "3.2" }, - "mtoa_3-1": { + "3-1": { "MTOA_VERSION": "3.1" } } @@ -42,8 +42,8 @@ }, "__dynamic_keys_labels__": { "mtoa": "Autodesk Arnold", - "yeti": "Pergrine Labs Yeti", - "vray": "Chaos Group Vray" + "vray": "Chaos Group Vray", + "yeti": "Pergrine Labs Yeti" } } } \ No newline at end of file From 227e1aee1b44604aa253f86ece078ddf2ee7016a Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 26 Mar 2021 12:41:45 +0100 Subject: [PATCH 25/27] enhanced labels of tools in enum items --- pype/settings/entities/enum_entity.py | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/pype/settings/entities/enum_entity.py b/pype/settings/entities/enum_entity.py index ca0d5dec21..8588cbb47c 100644 --- a/pype/settings/entities/enum_entity.py +++ b/pype/settings/entities/enum_entity.py @@ -172,9 +172,23 @@ class ToolsEnumEntity(BaseEnumEntity): enum_items = [] tools_entity = system_settings_entity["tools"] for group_name, tool_group in tools_entity["tool_groups"].items(): - for variant_name in tool_group["variants"].keys(): + group_label = None + if hasattr(tool_group, "get_key_label"): + group_label = tool_group.get_key_label(group_name) + + for variant_name, variant in tool_group["variants"].items(): + variant_label = None + if hasattr(variant, "get_key_label"): + variant_label = variant.get_key_label(variant_name) + + tool_label = None + if group_label and variant_label: + tool_label = " ".join((group_label, variant_label)) + tool_name = "/".join((group_name, variant_name)) - enum_items.append({tool_name: tool_name}) + if not tool_label: + tool_label = tool_name + enum_items.append({tool_name: tool_label}) valid_keys.add(tool_name) return enum_items, valid_keys From 604847758033753b6441555fb2ce4e0398384f3b Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 26 Mar 2021 12:49:08 +0100 Subject: [PATCH 26/27] removed variants label and variants are as collapsible keys --- pype/settings/defaults/system_settings/tools.json | 4 ++++ .../settings/entities/schemas/system_schema/schema_tools.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pype/settings/defaults/system_settings/tools.json b/pype/settings/defaults/system_settings/tools.json index 215139468c..214bfc95e5 100644 --- a/pype/settings/defaults/system_settings/tools.json +++ b/pype/settings/defaults/system_settings/tools.json @@ -29,6 +29,10 @@ }, "3-1": { "MTOA_VERSION": "3.1" + }, + "__dynamic_keys_labels__": { + "3-2": "3.2", + "3-1": "3.2" } } }, diff --git a/pype/settings/entities/schemas/system_schema/schema_tools.json b/pype/settings/entities/schemas/system_schema/schema_tools.json index 188d2fc8e8..2346bef36d 100644 --- a/pype/settings/entities/schemas/system_schema/schema_tools.json +++ b/pype/settings/entities/schemas/system_schema/schema_tools.json @@ -23,7 +23,7 @@ { "type": "dict-modifiable", "key": "variants", - "label": "Variants", + "collapsible_key": true, "object_type": { "type": "raw-json" } From d9c263be39d10cbd09900e04adb2f44f7d523155 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 26 Mar 2021 12:49:25 +0100 Subject: [PATCH 27/27] fixed tools labels getting --- pype/settings/entities/enum_entity.py | 28 ++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/pype/settings/entities/enum_entity.py b/pype/settings/entities/enum_entity.py index 8588cbb47c..c486de397e 100644 --- a/pype/settings/entities/enum_entity.py +++ b/pype/settings/entities/enum_entity.py @@ -170,24 +170,30 @@ class ToolsEnumEntity(BaseEnumEntity): valid_keys = set() enum_items = [] - tools_entity = system_settings_entity["tools"] - for group_name, tool_group in tools_entity["tool_groups"].items(): + tool_groups_entity = system_settings_entity["tools"]["tool_groups"] + for group_name, tool_group in tool_groups_entity.items(): + # Try to get group label from entity group_label = None - if hasattr(tool_group, "get_key_label"): - group_label = tool_group.get_key_label(group_name) + if hasattr(tool_groups_entity, "get_key_label"): + group_label = tool_groups_entity.get_key_label(group_name) - for variant_name, variant in tool_group["variants"].items(): + variants_entity = tool_group["variants"] + for variant_name in variants_entity.keys(): + # Prepare tool name (used as value) + tool_name = "/".join((group_name, variant_name)) + + # Try to get variant label from entity variant_label = None - if hasattr(variant, "get_key_label"): - variant_label = variant.get_key_label(variant_name) + if hasattr(variants_entity, "get_key_label"): + variant_label = variants_entity.get_key_label(variant_name) - tool_label = None + # Tool label that will be shown + # - use tool name itself if labels are not filled if group_label and variant_label: tool_label = " ".join((group_label, variant_label)) - - tool_name = "/".join((group_name, variant_name)) - if not tool_label: + else: tool_label = tool_name + enum_items.append({tool_name: tool_label}) valid_keys.add(tool_name) return enum_items, valid_keys