From 10fc40821bcc2d157e6629e134d98d878395da31 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 23 Sep 2024 16:46:53 +0200 Subject: [PATCH 1/2] Add task toggle and name pattern adjustments for Flame plugins - Added a task toggle feature to mark tasks for product parent usage - Adjusted name patterns in extract product resources plugin --- .../plugins/publish/collect_timeline_instances.py | 3 +++ .../plugins/publish/extract_product_resources.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/ayon_flame/plugins/publish/collect_timeline_instances.py b/client/ayon_flame/plugins/publish/collect_timeline_instances.py index 8afcb08..dc13b93 100644 --- a/client/ayon_flame/plugins/publish/collect_timeline_instances.py +++ b/client/ayon_flame/plugins/publish/collect_timeline_instances.py @@ -30,6 +30,9 @@ class CollectTimelineInstances(pyblish.api.ContextPlugin): # settings xml_preset_attrs_from_comments = [] + + # TODO: add to own plugin for Flame + # TODO: toggle for marking task which should be used for product parent add_tasks = [] def process(self, context): diff --git a/client/ayon_flame/plugins/publish/extract_product_resources.py b/client/ayon_flame/plugins/publish/extract_product_resources.py index c7d7da9..3947967 100644 --- a/client/ayon_flame/plugins/publish/extract_product_resources.py +++ b/client/ayon_flame/plugins/publish/extract_product_resources.py @@ -223,7 +223,7 @@ def process(self, instance): ) exporting_clip = None - name_patern_xml = "_{}.".format( + name_pattern_xml = "_{}.".format( unique_name) if export_type == "Sequence Publish": @@ -235,7 +235,7 @@ def process(self, instance): exporting_clip, segment_name, s_track_name) # change name pattern - name_patern_xml = ( + name_pattern_xml = ( "__{}.").format( unique_name) @@ -258,7 +258,7 @@ def process(self, instance): # enum position low start from 0 "frameIndex": 0, "startFrame": repre_frame_start, - "namePattern": name_patern_xml + "namePattern": name_pattern_xml }) if parsed_comment_attrs: @@ -440,7 +440,7 @@ def _should_skip(self, preset_config, clip_path, unique_name): ) ) - # skip if not activated presete + # skip if not activated presets if not activated_preset: return True From 6aa938487f0e49d7c4ebdb3bfc269c986e585d29 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Mon, 23 Sep 2024 16:48:21 +0200 Subject: [PATCH 2/2] Fixing and enhancing settings - adding descriptions - correct order of preset attributes - adding section divider - adding expanded layout to hooks section --- server/settings/main.py | 1 + server/settings/publish_plugins.py | 112 ++++++++++++++++++++++------- 2 files changed, 86 insertions(+), 27 deletions(-) diff --git a/server/settings/main.py b/server/settings/main.py index 1ae300f..ccc3c19 100644 --- a/server/settings/main.py +++ b/server/settings/main.py @@ -15,6 +15,7 @@ class InstallOpenTimelineIOToFlameModel(BaseSettingsModel): # hooks configurations class FlameHooksModel(BaseSettingsModel): + _layout = "expanded" InstallOpenTimelineIOToFlame: InstallOpenTimelineIOToFlameModel = \ SettingsField( default_factory=InstallOpenTimelineIOToFlameModel, diff --git a/server/settings/publish_plugins.py b/server/settings/publish_plugins.py index b34083b..6e56da3 100644 --- a/server/settings/publish_plugins.py +++ b/server/settings/publish_plugins.py @@ -49,55 +49,113 @@ class ExportPresetsMappingModel(BaseSettingsModel): name: str = SettingsField( ..., - title="Name" - ) - active: bool = SettingsField(True, title="Is active") - export_type: str = SettingsField( - "File Sequence", - title="Eport clip type", - enum_resolver=lambda: ["Movie", "File Sequence", "Sequence Publish"] + title="Name", + description=( + "Used to identify the preset. It can also be part of the " + "output file name via the `outputName` anatomy template token. " + "It serves as a unique representation name." + ), + ) + active: bool = SettingsField( + True, + title="Is active", + section="Filtering properties", + description=( + "If the preset is active, it will be used during the export " + "process." + ), ) - ext: str = SettingsField("exr", title="Output extension") - xml_preset_file: str = SettingsField( - "OpenEXR (16-bit fp DWAA).xml", - title="XML preset file (with ext)" + filter_path_regex: str = SettingsField( + ".*", + title="Activate by search pattern", + description=( + "If the clip's media resource path matches the input regex " + "pattern, the preset will be used." + ), + ) + ext: str = SettingsField( + "exr", + title="Output extension", + section="Output file properties", + description=( + "The output file extension for the published " + "representation." + ), ) colorspace_out: str = SettingsField( "ACES - ACEScg", - title="Output color (imageio)" + title="Output color (imageio)", + description=( + "Specifies the colorspace data to be stored in the " + "representation. This is used downstream in the publishing " + "process or by loading plugins." + ), + ) + export_type: str = SettingsField( + "File Sequence", + title="Export clip type", + enum_resolver=lambda: ["Movie", "File Sequence", "Sequence Publish"], + description="The type of XML preset to be used for export.", + section="XML preset properties", ) - # TODO remove when resolved or v3 is not a thing anymore - # NOTE next 4 attributes were grouped under 'other_parameters' but that - # created inconsistency with v3 settings and harder conversion handling - # - it can be moved back but keep in mind that it must be handled in v3 - # conversion script too xml_preset_dir: str = SettingsField( "", - title="XML preset directory" + title="XML preset directory", + description=( + "The absolute directory path where the XML preset is stored. " + "If left empty, built-in directories are used, either shared " + "or installed presets folder." + ), + ) + xml_preset_file: str = SettingsField( + "OpenEXR (16-bit fp DWAA).xml", + title="XML preset file (with ext)", + description="The name of the XML preset file with its extension.", ) parsed_comment_attrs: bool = SettingsField( True, - title="Parsed comment attributes" + title="Distribute parsed comment attributes to XML preset", + description=( + "If enabled, previously collected clip comment attributes " + "will be distributed to the XML preset. This can affect the " + "resulting resolution of the exported media." + ), ) representation_add_range: bool = SettingsField( True, - title="Add range to representation name" + title="Add range to representation name", + description=( + "Adds frame range-related attributes to the publishing " + "representation data for downstream use in the publishing process." + ), + section="Representation properties", ) representation_tags: list[str] = SettingsField( default_factory=list, - title="Representation tags" + title="Representation tags", + description=( + "Adds tags to the representation data for downstream use in " + "the publishing process. For example, marking the representation " + "as reviewable." + ), ) load_to_batch_group: bool = SettingsField( True, - title="Load to batch group reel" + title="Load to batch group reel", + description=( + "If enabled, the representation will be loaded to the batch " + "group reel after publishing (connected to IntegrateBatchGroup)." + ), + section="Batch group properties", ) batch_group_loader_name: str = SettingsField( "LoadClipBatch", - title="Use loader name" - ) - filter_path_regex: str = SettingsField( - ".*", - title="Regex in clip path" + title="Use loader name", + description=( + "Defines which loader plugin should be used for loading the " + "representation after publishing (connected to " + "IntegrateBatchGroup)." + ), )