From 71f918f2cb72137f8a473175ab8d8fb87bbd8bfd Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Jun 2021 23:54:11 +0200 Subject: [PATCH 1/3] remove project overrides from project settings on new project creation --- openpype/lib/avalon_context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/openpype/lib/avalon_context.py b/openpype/lib/avalon_context.py index c4217cc6d5b..9695e1e89a8 100644 --- a/openpype/lib/avalon_context.py +++ b/openpype/lib/avalon_context.py @@ -91,6 +91,10 @@ def create_project( # and Anatomy try: project_settings_entity = ProjectSettings(project_name) + # Remove project overrides will set all anatomy values to defaults + # - anatomy will still be overriden + project_anatomy = project_settings_entity["project_anatomy"] + project_anatomy.remove_from_project_override() project_settings_entity.save() except SaveWarningExc as exc: print(str(exc)) From 2dc55ccfdd00231f1d5845814451039fb8f656df Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 3 Jun 2021 23:56:32 +0200 Subject: [PATCH 2/3] changed comment --- openpype/lib/avalon_context.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openpype/lib/avalon_context.py b/openpype/lib/avalon_context.py index 9695e1e89a8..642292759d3 100644 --- a/openpype/lib/avalon_context.py +++ b/openpype/lib/avalon_context.py @@ -91,8 +91,9 @@ def create_project( # and Anatomy try: project_settings_entity = ProjectSettings(project_name) - # Remove project overrides will set all anatomy values to defaults - # - anatomy will still be overriden + # Trigger remove project overrides + # - will set all anatomy values to defaults + # - project's anatomy will still be overriden project_anatomy = project_settings_entity["project_anatomy"] project_anatomy.remove_from_project_override() project_settings_entity.save() From 3d66b080cfbdf4fd9e93ae98b704949c3a6adf60 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Jun 2021 00:38:33 +0200 Subject: [PATCH 3/3] fixed core issue of missing applications in new project --- openpype/lib/avalon_context.py | 5 ----- openpype/settings/handlers.py | 11 ++++++++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/openpype/lib/avalon_context.py b/openpype/lib/avalon_context.py index 642292759d3..c4217cc6d5b 100644 --- a/openpype/lib/avalon_context.py +++ b/openpype/lib/avalon_context.py @@ -91,11 +91,6 @@ def create_project( # and Anatomy try: project_settings_entity = ProjectSettings(project_name) - # Trigger remove project overrides - # - will set all anatomy values to defaults - # - project's anatomy will still be overriden - project_anatomy = project_settings_entity["project_anatomy"] - project_anatomy.remove_from_project_override() project_settings_entity.save() except SaveWarningExc as exc: print(str(exc)) diff --git a/openpype/settings/handlers.py b/openpype/settings/handlers.py index 65ec7291d39..288fc768017 100644 --- a/openpype/settings/handlers.py +++ b/openpype/settings/handlers.py @@ -590,16 +590,21 @@ def project_doc_to_anatomy_data(self, project_doc): attributes[key] = value project_doc_config = project_doc.get("config") or {} + app_names = set() - if "apps" in project_doc_config: - for app_item in project_doc_config.pop("apps"): + if not project_doc_config or "apps" not in project_doc_config: + set_applications = False + else: + set_applications = True + for app_item in project_doc_config["apps"]: if not app_item: continue app_name = app_item.get("name") if app_name: app_names.add(app_name) - attributes["applications"] = list(app_names) + if set_applications: + attributes["applications"] = list(app_names) output = {"attributes": attributes} for key in self.anatomy_keys: