-
Notifications
You must be signed in to change notification settings - Fork 3
Adds batchgroup publishing workflow - mvp #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Adds batchgroup publishing workflow - mvp #84
Conversation
Adds ability to generate batchgroup product for shot. - Creates a new creator for batchgroup products. - Adds a boolean setting to toggle batchgroup export. - Uses "workfile" product type and names for the batchgroup.
creation plugin. Uses `self.presets.get()` directly within property definitions, removing the need for a local variable. This makes the code more readable and maintainable.
Adds a plugin to extract Batchgroup product data to create and update batch groups in Flame. Updates the collect batchgroup plugin to set the task name and attach task data. Removes the collect batchgroup directory plugin.
- Defines models for output node properties and task attachment. - Introduces `CollectBatchgroupModel` for managing batchgroup settings. - Includes default settings for `CollectBatchgroup` plugin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for batchgroup product creation in the Flame integration, allowing users to generate batchgroup workfile products for shots. The implementation includes settings configuration, creator plugins, and collection/extraction logic for batch groups.
Key changes:
- Added settings models for batchgroup configuration including output node properties and task attachment
- Introduced new creator plugin for editorial batchgroup instances
- Implemented collection and extraction plugins for batchgroup processing
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| server/settings/publish_plugins.py | Added OutputNodePropertiesModel, AttachToTaskModel, and CollectBatchgroupModel settings with default configuration |
| server/settings/create_plugins.py | Added export_batchgroup boolean field to enable batchgroup export in shot clip creation |
| client/ayon_flame/plugins/publish/exctract_batchgroup.py | New plugin that extracts batchgroup product data and creates batch groups in Flame |
| client/ayon_flame/plugins/publish/collect_shots.py | Added flameAddTasks to copy to instance attributes |
| client/ayon_flame/plugins/publish/collect_batchgroup.py | New plugin that collects batchgroup workfile products for shots |
| client/ayon_flame/plugins/create/create_shot_clip.py | Added EditorialBatchgroupInstanceCreator class and batchgroup handling logic, refactored preset access |
Comments suppressed due to low confidence (1)
client/ayon_flame/plugins/publish/collect_batchgroup.py:5
- Import of 'deepcopy' is not used.
from copy import deepcopy
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -0,0 +1,244 @@ | |||
| import copy | |||
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The copy module is imported but never used in this file. Consider removing this unused import.
| ] | ||
|
|
||
| # add nodes into batch group | ||
| return ayfapi.create_batch_group_conent( |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'conent' to 'content' in function name.
| return ayfapi.create_batch_group_conent( | |
| return ayfapi.create_batch_group_content( |
| batch_group, | ||
| write_pref_data | ||
| ): | ||
| # get write file node properties > OrederDict because order does matter |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'OrederDict' to 'OrderedDict'.
| # get write file node properties > OrederDict because order does matter | |
| # get write file node properties > OrderedDict because order does matter |
| batchgroup_name = folder_path.replace("/", "_") | ||
|
|
||
| batch_data = { | ||
| "shematic_reels": [ |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'shematic_reels' to 'schematic_reels'.
| "shematic_reels": [ | |
| "schematic_reels": [ |
|
|
||
| return bgroup | ||
|
|
||
| def _get_anamoty_data_with_current_task(self, instance, task_data): |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Corrected spelling of 'anamoty' to 'anatomy' in method name.
| from copy import deepcopy | ||
|
|
||
|
|
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The deepcopy import is unused and should be removed.
| from copy import deepcopy |
| creator_identifier = instance.data["creator_identifier"] | ||
|
|
||
| if creator_identifier != "io.ayon.creators.flame.batchgroup": | ||
| # only interested in flame batchgroup | ||
| return | ||
|
|
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These class-level attributes are initialized as empty dictionaries but are expected to be populated from settings. This could cause KeyError exceptions when accessing keys like self.attach_to_task['name'] on lines 54, 68, and 69 if the settings are not properly applied. Consider either providing default values or adding validation in the process method to ensure these are properly configured.
| creator_identifier = instance.data["creator_identifier"] | |
| if creator_identifier != "io.ayon.creators.flame.batchgroup": | |
| # only interested in flame batchgroup | |
| return | |
| # Validate that attach_to_task has required keys | |
| required_keys = ["name", "task_type"] | |
| missing_keys = [k for k in required_keys if k not in self.attach_to_task] | |
| if missing_keys: | |
| raise ValueError( | |
| f"CollectBatchgroup.attach_to_task is missing required keys: {missing_keys}. " | |
| "Please ensure settings are properly configured." | |
| ) | |
| creator_identifier = instance.data["creator_identifier"] |
| f"{sub_instance_data['productName']}" | ||
| ) | ||
| ), | ||
| "families": ["batchgroup"] |
Copilot
AI
Nov 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The families key is being set in the audio creator section (line 796), but this appears to be incorrect. The families field should likely be set for the batchgroup creator instead, or this line may have been added to the wrong section.
validation of setting keys in collector families not needed at creator
Updates the property processing logic to convert values from settings to integers when possible. Also adds static method decorator to shot task dir path.
- Updates batchgroup extraction to handle templated paths for output nodes, enhancing flexibility. - Converts values to their appropriate types. - Utilizes `Pathlib` for robust path management. - Improves settings configuration for output node properties.
Renames the `name` key to `task_name` within `attach_to_task` data. This change provides clearer semantic meaning when defining or linking tasks during batchgroup publishing. Adjusts the `ExtractBatchgroup` plugin's order to `ExtractorOrder` to ensure it executes correctly within the Pyblish extraction phase.
Adds 'clip' family to the batchgroup instance. This modification ensures that batchgroup instances are correctly identified as 'clip' type. This is required for publishing batch as workfile functionality.
Adds logging for property settings during batch extraction to aid in debugging and ensure values are correctly assigned. This enhances visibility into the property assignment process.
- Improves batchgroup extraction with anatomy data. - Adds root to anatomy data for workfile publishing. - Uses StringTemplate for strict formatting. - Includes logging for attribute setting. - Improves value conversion with better type handling.
Simplifies batch node attribute setting with contextlib.suppress to handle potential errors. This improves code readability and robustness by suppressing expected RuntimeErrors during attribute setting, avoiding unnecessary error logging.
Extracts batch group data into a JSON format for easier workfile publishing. - Converts batch group content to JSON. - Uses staging directory for temporary storage. - Adds folder path to batchgroup name. - Updates Batchgroup extraction.
Changelog Description
Batchgroup product publishing workflow.
Additional info
in progress
TODO scope
Testing notes:
closes #67