From e1b6c88d30f086f337e9cc6547f395b2b97eed77 Mon Sep 17 00:00:00 2001 From: Ben Souchet Date: Wed, 11 Sep 2024 14:11:25 +0200 Subject: [PATCH] Kitsu Review Preview: Add ability to disable the resize (normalize) --- .../plugins/publish/integrate_kitsu_review.py | 6 +++++- .../defaults/project_settings/kitsu.json | 4 ++++ .../projects_schema/schema_project_kitsu.json | 18 ++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/openpype/modules/kitsu/plugins/publish/integrate_kitsu_review.py b/openpype/modules/kitsu/plugins/publish/integrate_kitsu_review.py index bbed4a30243..eb9aba5ea30 100644 --- a/openpype/modules/kitsu/plugins/publish/integrate_kitsu_review.py +++ b/openpype/modules/kitsu/plugins/publish/integrate_kitsu_review.py @@ -12,6 +12,9 @@ class IntegrateKitsuReview(pyblish.api.InstancePlugin): optional = True def process(self, instance): + if not getattr(self, 'enabled', True): + return + # Check comment has been created comment_id = instance.data.get("kitsu_comment", {}).get("id") if not comment_id: @@ -30,6 +33,7 @@ def process(self, instance): self.log.debug("Found review at: {}".format(review_path)) gazu.task.add_preview( - task_id, comment_id, review_path, normalize_movie=True + task_id, comment_id, review_path, + normalize_movie=getattr(self, 'normalize', True) ) self.log.info("Review upload on comment") diff --git a/openpype/settings/defaults/project_settings/kitsu.json b/openpype/settings/defaults/project_settings/kitsu.json index 59a36d8b97d..9ee2760a22c 100644 --- a/openpype/settings/defaults/project_settings/kitsu.json +++ b/openpype/settings/defaults/project_settings/kitsu.json @@ -16,6 +16,10 @@ "enabled": false, "comment_template": "{comment}\n\n| | |\n|--|--|\n| version| `{version}` |\n| family | `{family}` |\n| name | `{name}` |" } + }, + "IntegrateKitsuReview": { + "enabled": true, + "normalize": true } } } diff --git a/openpype/settings/entities/schemas/projects_schema/schema_project_kitsu.json b/openpype/settings/entities/schemas/projects_schema/schema_project_kitsu.json index 8aeed00542e..eb62c225a03 100644 --- a/openpype/settings/entities/schemas/projects_schema/schema_project_kitsu.json +++ b/openpype/settings/entities/schemas/projects_schema/schema_project_kitsu.json @@ -136,6 +136,24 @@ ] } ] + }, + { + "type": "dict", + "collapsible": true, + "key": "IntegrateKitsuReview", + "label": "Integrate Kitsu Review", + "children": [ + { + "type": "boolean", + "key": "enabled", + "label": "Enabled" + }, + { + "type": "boolean", + "key": "normalize", + "label": "Normalize" + } + ] } ] }