From cc84c2551709d94123466f920d1bae9bde5326f4 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 10 Dec 2024 16:07:58 +0200 Subject: [PATCH 1/7] add descriptions to various settings and update names of some settings --- server/settings/editorial_creators.py | 44 +++++++++++++++++++-------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index 00d2123..e68c16c 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -7,13 +7,13 @@ class ClipNameTokenizerItem(BaseSettingsModel): _layout = "compact" - name: str = SettingsField("", title="Tokenizer name") - regex: str = SettingsField("", title="Tokenizer regex") + name: str = SettingsField("", title="Token name") + regex: str = SettingsField("", title="Token regex") class ShotAddTasksItem(BaseSettingsModel): _layout = "compact" - name: str = SettingsField('', title="Key") + name: str = SettingsField('', title="Task Name") task_type: str = SettingsField( title="Task type", enum_resolver=task_types_enum @@ -21,6 +21,14 @@ class ShotAddTasksItem(BaseSettingsModel): class ShotRenameSubmodel(BaseSettingsModel): + """Shot Rename Info + + When enabled, any discovered shots will be renamed based on the `shot rename template`. + + The template supports both the available + [template keys](https://ayon.ynput.io/docs/admin_settings_project_anatomy#available-template-keys) + and tokens defined in the `Clip Name Tokenizer`. + """ enabled: bool = True shot_rename_template: str = SettingsField( "", @@ -56,15 +64,23 @@ class TokenToParentConvertorItem(BaseSettingsModel): class ShotHierarchySubmodel(BaseSettingsModel): + """Shot Hierarchy Info + + Shot Hierarchy defines the folder path where the shot will be added. + It uses the `Folder path template` to compute this path. + The `Folder path template` supports tokens defined in the `folder path template tokens` setting. + + - Each token in the `Folder path template` represents a folder in the hierarchy. + - Each token can leverage tokens defined in the `Clip Name Tokenizer`. + """ enabled: bool = True parents_path: str = SettingsField( "", - title="Parents path template", - description="Using keys from \"Token to parent convertor\" or tokens directly" # noqa + title="Folder path template" ) parents: list[TokenToParentConvertorItem] = SettingsField( default_factory=TokenToParentConvertorItem, - title="Token to parent convertor" + title="Folder path template tokens" ) @@ -94,12 +110,13 @@ class EditorialSimpleCreatorPlugin(BaseSettingsModel): ) clip_name_tokenizer: list[ClipNameTokenizerItem] = SettingsField( default_factory=ClipNameTokenizerItem, - description=( - "Using Regex expression to create tokens. \nThose can be used" - " later in \"Shot rename\" creator \nor \"Shot hierarchy\"." - "\n\nTokens should be decorated with \"_\" on each side" - ) - ) + description="""Clip Name Tokenizer Info. + + Use Regex expression to create tokens. + Those can be used later in `Shot rename` creator or `Shot hierarchy`. + Tokens should be enclosed by `_` on each side. + """ + ) shot_rename: ShotRenameSubmodel = SettingsField( title="Shot Rename", default_factory=ShotRenameSubmodel @@ -110,7 +127,8 @@ class EditorialSimpleCreatorPlugin(BaseSettingsModel): ) shot_add_tasks: list[ShotAddTasksItem] = SettingsField( title="Add tasks to shot", - default_factory=ShotAddTasksItem + default_factory=ShotAddTasksItem, + description="The following list of tasks will be added to each created shot." ) product_type_presets: list[ProductTypePresetItem] = SettingsField( default_factory=list From ee51f74982ec879d36ec7572a7972f318ddb055d Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 10 Dec 2024 16:09:42 +0200 Subject: [PATCH 2/7] Re arrange `TokenToParentConvertorItem` --- server/settings/editorial_creators.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index e68c16c..4b6c837 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -47,20 +47,21 @@ class ShotRenameSubmodel(BaseSettingsModel): class TokenToParentConvertorItem(BaseSettingsModel): _layout = "compact" # TODO - was 'type' must be renamed in code to `parent_type` - parent_type: str = SettingsField( - "Project", - enum_resolver=lambda: parent_type_enum - ) name: str = SettingsField( "", - title="Parent token name", + title="Token name", description="Unique name used in `Parent path template`" ) value: str = SettingsField( "", - title="Parent token value", + title="Token value", description="Template where any text, Anatomy keys and Tokens could be used" # noqa ) + parent_type: str = SettingsField( + "Project", + title="Folder Type", + enum_resolver=lambda: parent_type_enum + ) class ShotHierarchySubmodel(BaseSettingsModel): From b41fd0dc4046ba5ee397de5eb52bea66565aa3e8 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 10 Dec 2024 16:10:57 +0200 Subject: [PATCH 3/7] tweak doc string of `ShotHierarchySubmodel` --- server/settings/editorial_creators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index 4b6c837..19e2a89 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -67,8 +67,8 @@ class TokenToParentConvertorItem(BaseSettingsModel): class ShotHierarchySubmodel(BaseSettingsModel): """Shot Hierarchy Info - Shot Hierarchy defines the folder path where the shot will be added. - It uses the `Folder path template` to compute this path. + Shot Hierarchy defines the folder path where each shot will be added. + It uses the `Folder path template` to compute each path. The `Folder path template` supports tokens defined in the `folder path template tokens` setting. - Each token in the `Folder path template` represents a folder in the hierarchy. From cfc6f5a8dace9cb496c1b9880f12c335b71ef264 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 10 Dec 2024 16:24:34 +0200 Subject: [PATCH 4/7] update doc string of `ShotHierarchySubmodel` --- server/settings/editorial_creators.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index 19e2a89..bbd29f9 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -72,7 +72,9 @@ class ShotHierarchySubmodel(BaseSettingsModel): The `Folder path template` supports tokens defined in the `folder path template tokens` setting. - Each token in the `Folder path template` represents a folder in the hierarchy. - - Each token can leverage tokens defined in the `Clip Name Tokenizer`. + - Each token's value supports both the available + [template keys](https://ayon.ynput.io/docs/admin_settings_project_anatomy#available-template-keys) + and tokens defined in the `Clip Name Tokenizer`. """ enabled: bool = True parents_path: str = SettingsField( From 0c9ec9ce5f5489c8cd769c5f1505dac66512f22b Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 10 Dec 2024 16:48:41 +0200 Subject: [PATCH 5/7] Tweak description of `clip_name_tokenizer` --- server/settings/editorial_creators.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index bbd29f9..7599d8d 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -115,9 +115,9 @@ class EditorialSimpleCreatorPlugin(BaseSettingsModel): default_factory=ClipNameTokenizerItem, description="""Clip Name Tokenizer Info. - Use Regex expression to create tokens. - Those can be used later in `Shot rename` creator or `Shot hierarchy`. - Tokens should be enclosed by `_` on each side. + Use regex expressions to create tokens. + These tokens will be used later in the `Shot rename` creator or `Shot hierarchy`. + Each token must be enclosed by underscores (`_`). """ ) shot_rename: ShotRenameSubmodel = SettingsField( From 7af043509a5a3c2e274a352e448f7496d4cd1cba Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Tue, 10 Dec 2024 19:56:13 +0200 Subject: [PATCH 6/7] Use better UILabel --- client/ayon_traypublisher/plugins/create/create_editorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/ayon_traypublisher/plugins/create/create_editorial.py b/client/ayon_traypublisher/plugins/create/create_editorial.py index 1f68b4d..eacfa91 100644 --- a/client/ayon_traypublisher/plugins/create/create_editorial.py +++ b/client/ayon_traypublisher/plugins/create/create_editorial.py @@ -869,7 +869,7 @@ def get_pre_create_attr_defs(self): label="Timeline offset" ), UISeparatorDef(), - UILabelDef("Clip instance attributes"), + UILabelDef("Add products for each discovered shot"), UISeparatorDef() ] # add variants swithers From e9c45e0833d271b512d8ee85c382c1b83600fe76 Mon Sep 17 00:00:00 2001 From: MustafaJafar Date: Wed, 11 Dec 2024 22:36:20 +0200 Subject: [PATCH 7/7] apply changes from code reviews --- server/settings/editorial_creators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/settings/editorial_creators.py b/server/settings/editorial_creators.py index 7599d8d..690e402 100644 --- a/server/settings/editorial_creators.py +++ b/server/settings/editorial_creators.py @@ -13,7 +13,7 @@ class ClipNameTokenizerItem(BaseSettingsModel): class ShotAddTasksItem(BaseSettingsModel): _layout = "compact" - name: str = SettingsField('', title="Task Name") + name: str = SettingsField('', title="Task name") task_type: str = SettingsField( title="Task type", enum_resolver=task_types_enum @@ -27,7 +27,7 @@ class ShotRenameSubmodel(BaseSettingsModel): The template supports both the available [template keys](https://ayon.ynput.io/docs/admin_settings_project_anatomy#available-template-keys) - and tokens defined in the `Clip Name Tokenizer`. + and tokens defined under `Clip Name Tokenizer`. """ enabled: bool = True shot_rename_template: str = SettingsField( @@ -50,7 +50,7 @@ class TokenToParentConvertorItem(BaseSettingsModel): name: str = SettingsField( "", title="Token name", - description="Unique name used in `Parent path template`" + description="Unique name used in `Folder path template tokens`" ) value: str = SettingsField( "", @@ -74,7 +74,7 @@ class ShotHierarchySubmodel(BaseSettingsModel): - Each token in the `Folder path template` represents a folder in the hierarchy. - Each token's value supports both the available [template keys](https://ayon.ynput.io/docs/admin_settings_project_anatomy#available-template-keys) - and tokens defined in the `Clip Name Tokenizer`. + and tokens defined under `Clip Name Tokenizer`. """ enabled: bool = True parents_path: str = SettingsField(