From 89ee780d79d12cebdc1f70480f8d562cd2cfee9d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 09:54:52 +0100 Subject: [PATCH 01/12] raw json cares about value types --- pype/settings/entities/input_entities.py | 21 +++++++++++++++++++-- pype/settings/entities/schemas/README.md | 10 +++++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/pype/settings/entities/input_entities.py b/pype/settings/entities/input_entities.py index c26cb249a6..40d1595f5a 100644 --- a/pype/settings/entities/input_entities.py +++ b/pype/settings/entities/input_entities.py @@ -380,13 +380,30 @@ class RawJsonEntity(InputEntity): def _item_initalization(self): # Schema must define if valid value is dict or list - self.valid_value_types = (list, dict) - self.value_on_not_set = {} + is_list = self.schema_data.get("is_list", False) + if is_list: + valid_value_types = (list, ) + value_on_not_set = [] + else: + valid_value_types = (dict, ) + value_on_not_set = {} + + self._is_list = is_list + self.valid_value_types = valid_value_types + self.value_on_not_set = value_on_not_set self.default_metadata = {} self.studio_override_metadata = {} self.project_override_metadata = {} + @property + def is_list(self): + return self._is_list + + @property + def is_dict(self): + return not self._is_list + def set(self, value): self._validate_value_type(value) diff --git a/pype/settings/entities/schemas/README.md b/pype/settings/entities/schemas/README.md index 80125d4b1b..e92ba8918f 100644 --- a/pype/settings/entities/schemas/README.md +++ b/pype/settings/entities/schemas/README.md @@ -235,13 +235,17 @@ ### raw-json - a little bit enhanced text input for raw json - has validations of json format - - empty value is invalid value, always must be at least `{}` of `[]` - + - empty value is invalid value, always must be json serializable + - valid value types are list `[]` and dictionary `{}` +- schema also defines valid value type + - by default it is dictionary + - to be able use list it is required to define `is_list` to `true` ``` { "type": "raw-json", "key": "profiles", - "label": "Extract Review profiles" + "label": "Extract Review profiles", + "is_list": true } ``` From 0c23cf0c19c9c9408b4f02800f6a33de336b7e2e Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 09:55:27 +0100 Subject: [PATCH 02/12] fixed list items in schemas --- .../schemas/projects_schema/schemas/schema_maya_publish.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json b/pype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json index bb0e162c04..623658b7a2 100644 --- a/pype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json +++ b/pype/settings/entities/schemas/projects_schema/schemas/schema_maya_publish.json @@ -274,7 +274,8 @@ { "type": "raw-json", "key": "bake_attributes", - "label": "Bake Attributes" + "label": "Bake Attributes", + "is_list": true } ] }, From 9f04cd627cf41b587fd23a628900cbb5bc96eb29 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 09:55:46 +0100 Subject: [PATCH 03/12] raw json widget also validate value types --- .../tools/settings/settings/widgets/item_widgets.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/pype/tools/settings/settings/widgets/item_widgets.py b/pype/tools/settings/settings/widgets/item_widgets.py index 7cfcd84488..ef4b98e1d0 100644 --- a/pype/tools/settings/settings/widgets/item_widgets.py +++ b/pype/tools/settings/settings/widgets/item_widgets.py @@ -366,7 +366,7 @@ class NumberWidget(InputWidget): class RawJsonInput(QtWidgets.QPlainTextEdit): tab_length = 4 - def __init__(self, *args, **kwargs): + def __init__(self, valid_type, *args, **kwargs): super(RawJsonInput, self).__init__(*args, **kwargs) self.setObjectName("RawJsonInput") self.setTabStopDistance( @@ -374,6 +374,7 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): self.font() ).horizontalAdvance(" ") * self.tab_length ) + self.valid_type = valid_type def sizeHint(self): document = self.document() @@ -403,8 +404,8 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): def has_invalid_value(self): try: - self.json_value() - return False + value = self.json_value() + return not isinstance(value, self.valid_type) except Exception: return True @@ -415,7 +416,11 @@ class RawJsonInput(QtWidgets.QPlainTextEdit): class RawJsonWidget(InputWidget): def _add_inputs_to_layout(self): - self.input_field = RawJsonInput(self.content_widget) + if self.entity.is_list: + valid_type = list + else: + valid_type = dict + self.input_field = RawJsonInput(valid_type, self.content_widget) self.input_field.setSizePolicy( QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.MinimumExpanding From f4a3f43088623ad7809d61181a72a5226fdae4cb Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 10:21:28 +0100 Subject: [PATCH 04/12] application arguments are separated --- .../host_settings/template_host_variant.json | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 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 244b9c1f56..53652fd192 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 @@ -43,8 +43,36 @@ "key": "executables", "label": "Executables", "multiplatform": "{multiplatform}", - "multipath": "{multipath_executables}", - "with_arguments": true + "multipath": "{multipath_executables}" + }, + { + "type":"separator" + }, + { + "type": "dict", + "key": "arguments", + "label": "Arguments", + "use_label_wrap": false, + "children": [ + { + "key": "windows", + "label": "Windows", + "type": "list", + "object_type": "text" + }, + { + "key": "linux", + "label": "Linux", + "type": "list", + "object_type": "text" + }, + { + "key": "darwin", + "label": "MacOS", + "type": "list", + "object_type": "text" + } + ] }, { "key": "environment", From ea75b495a0b8256099bee3b070659cdcf1c40d38 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 10:51:38 +0100 Subject: [PATCH 05/12] removed with_arguments key from path schema --- pype/settings/entities/input_entities.py | 9 ++----- pype/settings/entities/item_entities.py | 15 +++-------- .../settings/settings/widgets/item_widgets.py | 27 +++---------------- 3 files changed, 9 insertions(+), 42 deletions(-) diff --git a/pype/settings/entities/input_entities.py b/pype/settings/entities/input_entities.py index c26cb249a6..1afeb9f311 100644 --- a/pype/settings/entities/input_entities.py +++ b/pype/settings/entities/input_entities.py @@ -366,13 +366,8 @@ class PathInput(InputEntity): schema_types = ["path-input"] def _item_initalization(self): - self.with_arguments = self.schema_data.get("with_arguments", False) - if self.with_arguments: - self.valid_value_types = (list, ) - self.value_on_not_set = ["", ""] - else: - self.valid_value_types = (STRING_TYPE, ) - self.value_on_not_set = "" + self.valid_value_types = (STRING_TYPE, ) + self.value_on_not_set = "" class RawJsonEntity(InputEntity): diff --git a/pype/settings/entities/item_entities.py b/pype/settings/entities/item_entities.py index 11e43e4fa6..42374c350c 100644 --- a/pype/settings/entities/item_entities.py +++ b/pype/settings/entities/item_entities.py @@ -53,15 +53,13 @@ class PathEntity(ItemEntity): self.multiplatform = self.schema_data.get("multiplatform", False) self.multipath = self.schema_data.get("multipath", False) - self.with_arguments = self.schema_data.get("with_arguments", False) # Create child object if not self.multiplatform and not self.multipath: valid_value_types = (STRING_TYPE, ) item_schema = { "type": "path-input", - "key": self.key, - "with_arguments": self.with_arguments + "key": self.key } elif not self.multiplatform: @@ -69,10 +67,7 @@ class PathEntity(ItemEntity): item_schema = { "type": "list", "key": self.key, - "object_type": { - "type": "path-input", - "with_arguments": self.with_arguments - } + "object_type": "path-input" } else: @@ -91,13 +86,9 @@ class PathEntity(ItemEntity): } if self.multipath: child_item["type"] = "list" - child_item["object_type"] = { - "type": "path-input", - "with_arguments": self.with_arguments - } + child_item["object_type"] = "path-input" else: child_item["type"] = "path-input" - child_item["with_arguments"] = self.with_arguments item_schema["children"].append(child_item) diff --git a/pype/tools/settings/settings/widgets/item_widgets.py b/pype/tools/settings/settings/widgets/item_widgets.py index 7cfcd84488..d7d6b8ab34 100644 --- a/pype/tools/settings/settings/widgets/item_widgets.py +++ b/pype/tools/settings/settings/widgets/item_widgets.py @@ -623,40 +623,21 @@ class PathWidget(BaseWidget): class PathInputWidget(InputWidget): def _add_inputs_to_layout(self): self.input_field = QtWidgets.QLineEdit(self.content_widget) - self.args_input_field = None - if self.entity.with_arguments: - self.input_field.setPlaceholderText("Executable path") - self.args_input_field = QtWidgets.QLineEdit(self) - self.args_input_field.setPlaceholderText("Arguments") + self.input_field.setPlaceholderText("Executable path") self.setFocusProxy(self.input_field) - self.content_layout.addWidget(self.input_field, 8) + self.content_layout.addWidget(self.input_field) self.input_field.textChanged.connect(self._on_value_change) - if self.args_input_field: - self.content_layout.addWidget(self.args_input_field, 2) - self.args_input_field.textChanged.connect(self._on_value_change) - def _on_entity_change(self): if self.entity.value != self.input_value(): self.set_entity_value() def set_entity_value(self): - value = self.entity.value - args = "" - if isinstance(value, list): - value, args = value - self.input_field.setText(value) - if self.args_input_field: - self.args_input_field.setText(args) + self.input_field.setText(self.entity.value) def input_value(self): - path_value = self.input_field.text() - if self.entity.with_arguments: - value = [path_value, self.args_input_field.text()] - else: - value = path_value - return value + return self.input_field.text() def _on_value_change(self): if self.ignore_input_changes: From 8b86b0634c555fddc2f7fd02c9626471b2ec52fa Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 10:52:25 +0100 Subject: [PATCH 06/12] fixed SystemSettings initialization in project settings root --- pype/settings/entities/root_entities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/settings/entities/root_entities.py b/pype/settings/entities/root_entities.py index b4dc667826..d1f86666c7 100644 --- a/pype/settings/entities/root_entities.py +++ b/pype/settings/entities/root_entities.py @@ -596,7 +596,7 @@ class ProjectSettings(RootEntity): def system_settings_entity(self): output = self._system_settings_entity if output is None: - output = SystemSettings() + output = SystemSettings(set_studio_state=False) self._system_settings_entity = output if self.override_state is OverrideState.DEFAULTS: From d46f09615aa7871d26b1699ac07bdeb869c8d399 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 10:52:38 +0100 Subject: [PATCH 07/12] changed order of platforms --- .../host_settings/template_host_variant.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 53652fd192..ba009cf094 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 @@ -61,14 +61,14 @@ "object_type": "text" }, { - "key": "linux", - "label": "Linux", + "key": "darwin", + "label": "MacOS", "type": "list", "object_type": "text" }, { - "key": "darwin", - "label": "MacOS", + "key": "linux", + "label": "Linux", "type": "list", "object_type": "text" } From bf5dce7ff7205f000b8c38b3b9ab652d1fe71996 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 10:52:48 +0100 Subject: [PATCH 08/12] resaved executables and arguments --- .../system_settings/applications.json | 555 +++++++++++------- 1 file changed, 354 insertions(+), 201 deletions(-) diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index b78d23f6ff..4a13cf78f6 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -37,19 +37,18 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Autodesk\\Maya2020\\bin\\maya.exe", - "" - ] + "C:\\Program Files\\Autodesk\\Maya2020\\bin\\maya.exe" ], "darwin": [], "linux": [ - [ - "/usr/autodesk/maya2020/bin/maya", - "" - ] + "/usr/autodesk/maya2020/bin/maya" ] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "MAYA_VERSION": "2020", "__environment_keys__": { @@ -66,19 +65,18 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Autodesk\\Maya2019\\bin\\maya.exe", - "" - ] + "C:\\Program Files\\Autodesk\\Maya2019\\bin\\maya.exe" ], "darwin": [], "linux": [ - [ - "/usr/autodesk/maya2019/bin/maya", - "" - ] + "/usr/autodesk/maya2019/bin/maya" ] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "MAYA_VERSION": "2019", "__environment_keys__": { @@ -95,19 +93,18 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Autodesk\\Maya2017\\bin\\maya.exe", - "" - ] + "C:\\Program Files\\Autodesk\\Maya2018\\bin\\maya.exe" ], "darwin": [], "linux": [ - [ - "/usr/autodesk/maya2018/bin/maya", - "" - ] + "/usr/autodesk/maya2018/bin/maya" ] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "MAYA_VERSION": "2018", "__environment_keys__": { @@ -159,14 +156,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Autodesk\\Maya2020\\bin\\mayabatch.exe", - "" - ] + "C:\\Program Files\\Autodesk\\Maya2020\\bin\\mayabatch.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "MAYA_VERSION": "2020", "__environment_keys__": { @@ -183,14 +182,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Autodesk\\Maya2019\\bin\\mayabatch.exe", - "" - ] + "C:\\Program Files\\Autodesk\\Maya2019\\bin\\mayabatch.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "MAYA_VERSION": "2019", "__environment_keys__": { @@ -207,14 +208,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Autodesk\\Maya2018\\bin\\mayabatch.exe", - "" - ] + "C:\\Program Files\\Autodesk\\Maya2018\\bin\\mayabatch.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "MAYA_VERSION": "2018", "__environment_keys__": { @@ -257,19 +260,18 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe", - "" - ] + "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.2v3Nuke12.2", - "" - ] + "/usr/local/Nuke12.2v3Nuke12.2" ] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "nuke_12.2": [] @@ -283,19 +285,18 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe", - "" - ] + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.0v1/Nuke12.0", - "" - ] + "/usr/local/Nuke12.0v1/Nuke12.0" ] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "nuke_12.0": [] @@ -309,19 +310,18 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe", - "" - ] + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke11.3v5/Nuke11.3", - "" - ] + "/usr/local/Nuke11.3v5/Nuke11.3" ] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "nuke_11.3": [] @@ -335,14 +335,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe", - "" - ] + "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "nuke_11.2": [] @@ -382,17 +384,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe", - "--nukex" - ] + "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.2v3Nuke12.2", - "--nukex" - ] + "/usr/local/Nuke12.2v3Nuke12.2" + ] + }, + "arguments": { + "windows": [ + "--nukex" + ], + "darwin": [ + "--nukex" + ], + "linux": [ + "--nukex" ] }, "environment": { @@ -408,17 +415,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe", - "--nukex" - ] + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.0v1/Nuke12.0", - "--nukex" - ] + "/usr/local/Nuke12.0v1/Nuke12.0" + ] + }, + "arguments": { + "windows": [ + "--nukex" + ], + "darwin": [ + "--nukex" + ], + "linux": [ + "--nukex" ] }, "environment": { @@ -434,17 +446,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe", - "--nukex" - ] + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke11.3v5/Nuke11.3", - "--nukex" - ] + "/usr/local/Nuke11.3v5/Nuke11.3" + ] + }, + "arguments": { + "windows": [ + "--nukex" + ], + "darwin": [ + "--nukex" + ], + "linux": [ + "--nukex" ] }, "environment": { @@ -460,14 +477,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe", - "--nukex" - ] + "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [ + "--nukex" + ], + "darwin": [ + "--nukex" + ], + "linux": [ + "--nukex" + ] + }, "environment": { "__environment_keys__": { "nukex_11.2": [] @@ -509,17 +534,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe", - "--studio" - ] + "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.2v3Nuke12.2", - "--studio" - ] + "/usr/local/Nuke12.2v3Nuke12.2" + ] + }, + "arguments": { + "windows": [ + "--studio" + ], + "darwin": [ + "--studio" + ], + "linux": [ + "--studio" ] }, "environment": { @@ -535,17 +565,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe", - "--studio" - ] + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.0v1/Nuke12.0", - "--studio" - ] + "/usr/local/Nuke12.0v1/Nuke12.0" + ] + }, + "arguments": { + "windows": [ + "--studio" + ], + "darwin": [ + "--studio" + ], + "linux": [ + "--studio" ] }, "environment": { @@ -561,17 +596,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe", - "--studio" - ] + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke11.3v5/Nuke11.3", - "--studio" - ] + "/usr/local/Nuke11.3v5/Nuke11.3" + ] + }, + "arguments": { + "windows": [ + "--studio" + ], + "darwin": [ + "--studio" + ], + "linux": [ + "--studio" ] }, "environment": { @@ -590,6 +630,17 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [ + "--studio" + ], + "darwin": [ + "--studio" + ], + "linux": [ + "--studio" + ] + }, "environment": { "__environment_keys__": { "nukestudio_11.2": [] @@ -631,17 +682,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe", - "--hiero" - ] + "C:\\Program Files\\Nuke12.2v3\\Nuke12.2.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.2v3Nuke12.2", - "--hiero" - ] + "/usr/local/Nuke12.2v3Nuke12.2" + ] + }, + "arguments": { + "windows": [ + "--hiero" + ], + "darwin": [ + "--hiero" + ], + "linux": [ + "--hiero" ] }, "environment": { @@ -657,17 +713,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe", - "--hiero" - ] + "C:\\Program Files\\Nuke12.0v1\\Nuke12.0.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke12.0v1/Nuke12.0", - "--hiero" - ] + "/usr/local/Nuke12.0v1/Nuke12.0" + ] + }, + "arguments": { + "windows": [ + "--hiero" + ], + "darwin": [ + "--hiero" + ], + "linux": [ + "--hiero" ] }, "environment": { @@ -683,17 +744,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe", - "--hiero" - ] + "C:\\Program Files\\Nuke11.3v1\\Nuke11.3.exe" ], "darwin": [], "linux": [ - [ - "/usr/local/Nuke11.3v5/Nuke11.3", - "--hiero" - ] + "/usr/local/Nuke11.3v5/Nuke11.3" + ] + }, + "arguments": { + "windows": [ + "--hiero" + ], + "darwin": [ + "--hiero" + ], + "linux": [ + "--hiero" ] }, "environment": { @@ -709,14 +775,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe", - "--hiero" - ] + "C:\\Program Files\\Nuke11.2v2\\Nuke11.2.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [ + "--hiero" + ], + "darwin": [ + "--hiero" + ], + "linux": [ + "--hiero" + ] + }, "environment": { "__environment_keys__": { "hiero_11.2": [] @@ -775,6 +849,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "fusion_16": [] @@ -788,14 +867,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Blackmagic Design\\Fusion 9\\Fusion.exe", - "" - ] + "C:\\Program Files\\Blackmagic Design\\Fusion 9\\Fusion.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "fusion_9": [] @@ -869,14 +950,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:/Program Files/Blackmagic Design/DaVinci Resolve/Resolve.exe", - "" - ] + "C:/Program Files/Blackmagic Design/DaVinci Resolve/Resolve.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "resolve_16": [] @@ -919,6 +1002,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "houdini_18": [] @@ -935,6 +1023,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "houdini_17": [] @@ -971,14 +1064,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Blender Foundation\\Blender 2.90\\blender.exe", - "--python-use-system-env" - ] + "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": [] @@ -992,14 +1093,22 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Blender Foundation\\Blender 2.83\\blender.exe", - "--python-use-system-env" - ] + "C:\\Program Files\\Blender Foundation\\Blender 2.83\\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.83": [] @@ -1034,6 +1143,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "harmony_20": [] @@ -1048,13 +1162,15 @@ "executables": { "windows": [], "darwin": [ - [ - "/Applications/Toon Boom Harmony 17 Premium/Harmony Premium.app/Contents/MacOS/Harmony Premium", - "" - ] + "/Applications/Toon Boom Harmony 17 Premium/Harmony Premium.app/Contents/MacOS/Harmony Premium" ], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "harmony_17": [] @@ -1084,18 +1200,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\TVPaint Developpement\\TVPaint Animation 11 (64bits)\\TVPaint Animation 11 (64bits).exe", - "" - ], - [ - "C:\\Program Files\\TVPaint Developpement\\TVPaint Animation 11 Pro (64bits) (DEMO)\\TVPaint Animation 11 Pro (64bits) (DEMO).exe", - "" - ] + "C:\\Program Files\\TVPaint Developpement\\TVPaint Animation 11 (64bits)\\TVPaint Animation 11 (64bits).exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "tvpaint_Animation 11 (64bits)": [] @@ -1109,14 +1223,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files (x86)\\TVPaint Developpement\\TVPaint Animation 11 (32bits)\\TVPaint Animation 11 (32bits).exe", - "" - ] + "C:\\Program Files (x86)\\TVPaint Developpement\\TVPaint Animation 11 (32bits)\\TVPaint Animation 11 (32bits).exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "tvpaint_Animation 11 (32bits)": [] @@ -1152,14 +1268,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Adobe\\Adobe Photoshop 2020\\Photoshop.exe", - "" - ] + "C:\\Program Files\\Adobe\\Adobe Photoshop 2020\\Photoshop.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "photoshop_2020": [] @@ -1173,14 +1291,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Adobe\\Adobe Photoshop 2021\\Photoshop.exe", - "" - ] + "C:\\Program Files\\Adobe\\Adobe Photoshop 2021\\Photoshop.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "photoshop_2021": [] @@ -1216,14 +1336,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Adobe\\Adobe After Effects 2020\\Support Files\\AfterFX.exe", - "" - ] + "" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "aftereffects_2020": [] @@ -1237,14 +1359,16 @@ "icon": "", "executables": { "windows": [ - [ - "C:\\Program Files\\Adobe\\Adobe After Effects 2021\\Support Files\\AfterFX.exe", - "" - ] + "C:\\Program Files\\Adobe\\Adobe After Effects 2021\\Support Files\\AfterFX.exe" ], "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "aftereffects_2021": [] @@ -1272,10 +1396,12 @@ "label": "", "variant_label": "Local", "icon": "{}/app_icons/celaction_local.png", - "executables": [ - "", - "" - ], + "executables": "", + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "celation_Local": [] @@ -1287,10 +1413,12 @@ "label": "", "variant_label": "Pulblish", "icon": "", - "executables": [ - "", - "" - ], + "executables": "", + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "celation_Publish": [] @@ -1327,6 +1455,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "unreal_4.24": [] @@ -1353,6 +1486,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "python_Python 3.7": [] @@ -1369,6 +1507,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "python_Python 2.7": [] @@ -1385,6 +1528,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "terminal_Terminal": [] @@ -1414,6 +1562,11 @@ "darwin": [], "linux": [] }, + "arguments": { + "windows": [], + "darwin": [], + "linux": [] + }, "environment": { "__environment_keys__": { "djvview_1.1": [] @@ -1422,4 +1575,4 @@ } } } -} \ No newline at end of file +} From a844b966ac817c61672f3e63a27ce9b286d1fe5d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 11:15:15 +0100 Subject: [PATCH 09/12] changed how arguments are prepared for launch context --- pype/lib/applications.py | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 0b1f45f2f1..abaecf1e9c 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -210,32 +210,16 @@ class ApplicationTool: class ApplicationExecutable: def __init__(self, executable): - default_launch_args = [] - executable_path = None - if isinstance(executable, str): - executable_path = executable - - elif isinstance(executable, list): - for arg in executable: - if arg: - if executable_path is None: - executable_path = arg - else: - default_launch_args.append(arg) - - self.executable_path = executable_path - self.default_launch_args = default_launch_args - - def __iter__(self): - yield self._realpath() - for arg in self.default_launch_args: - yield arg + self.executable_path = executable def __str__(self): return self.executable_path + def __repr__(self): + return "<{}> {}".format(self.__class__.__name__, self.executable_path) + def as_args(self): - return list(self) + return [self.executable_path] def _realpath(self): """Check if path is valid executable path.""" @@ -293,11 +277,19 @@ class Application: 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): @@ -503,6 +495,7 @@ class ApplicationLaunchContext: # subprocess.Popen launch arguments (first argument in constructor) self.launch_args = executable.as_args() + self.launch_args.extend(application.arguments) # Handle launch environemtns env = self.data.pop("env", None) From 15677f56fca5b085ac766485571a65e8d607eebf Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 11:15:34 +0100 Subject: [PATCH 10/12] fixed local settings --- pype/tools/settings/local_settings/apps_widget.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/tools/settings/local_settings/apps_widget.py b/pype/tools/settings/local_settings/apps_widget.py index d63cd6a834..bc27a3c1c4 100644 --- a/pype/tools/settings/local_settings/apps_widget.py +++ b/pype/tools/settings/local_settings/apps_widget.py @@ -56,7 +56,7 @@ class AppVariantWidget(QtWidgets.QWidget): for item in studio_executables: path_widget = QtWidgets.QLineEdit(content_widget) - path_widget.setText(item.value[0]) + path_widget.setText(item.value) path_widget.setEnabled(False) content_layout.addWidget(path_widget) From d3515e6015dbc2c7305edc55926f140b6f573d34 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Mon, 22 Mar 2021 11:25:22 +0100 Subject: [PATCH 11/12] hound fix --- pype/settings/entities/item_entities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/settings/entities/item_entities.py b/pype/settings/entities/item_entities.py index 42374c350c..ebaacb193e 100644 --- a/pype/settings/entities/item_entities.py +++ b/pype/settings/entities/item_entities.py @@ -67,7 +67,7 @@ class PathEntity(ItemEntity): item_schema = { "type": "list", "key": self.key, - "object_type": "path-input" + "object_type": "path-input" } else: From 0ae39b54b3c37336dffc743dfc30d16c0184f82b Mon Sep 17 00:00:00 2001 From: Milan Kolar Date: Mon, 22 Mar 2021 12:18:41 +0100 Subject: [PATCH 12/12] add nukex to python2 vendor prehook --- pype/hooks/pre_python2_vendor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pype/hooks/pre_python2_vendor.py b/pype/hooks/pre_python2_vendor.py index 070e671db0..6f34e44132 100644 --- a/pype/hooks/pre_python2_vendor.py +++ b/pype/hooks/pre_python2_vendor.py @@ -6,7 +6,7 @@ class PrePython2Vendor(PreLaunchHook): """Prepend python 2 dependencies for py2 hosts.""" # WARNING This hook will probably be deprecated in Pype 3 - kept for test order = 10 - app_groups = ["hiero", "nuke"] + app_groups = ["hiero", "nuke", "nukex"] def execute(self): # Prepare vendor dir path