Skip to content

Conversation

@jakubjezek001
Copy link
Member

@jakubjezek001 jakubjezek001 commented Oct 30, 2025

Changelog Description

Batchgroup product publishing workflow.

Additional info

in progress

TODO scope

  • Creator on demand option in Creator dialogue
  • The collector should be ready for shot-based batch group workfile products.
  • The validator should check if access to a future folder is open.
  • The extractor should create a batch group workfile so that it is ready to be integrated as a file/folder.
  • The post-integrator plugin should load shot-related products into the batch group workfile.
    • If an existing version of the workfile is available, then update it and save it as a new version.
    • Load shot-related products.
    • Need to make sure to update the file/folder checksum after it is loaded.

Testing notes:

  1. work in progress

closes #67

@jakubjezek001 jakubjezek001 self-assigned this Oct 30, 2025
@jakubjezek001 jakubjezek001 added sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition labels Oct 30, 2025
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.
@antirotor antirotor requested a review from Copilot November 3, 2025 08:56
Copy link

Copilot AI left a 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
Copy link

Copilot AI Nov 3, 2025

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.

Copilot uses AI. Check for mistakes.
]

# add nodes into batch group
return ayfapi.create_batch_group_conent(
Copy link

Copilot AI Nov 3, 2025

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.

Suggested change
return ayfapi.create_batch_group_conent(
return ayfapi.create_batch_group_content(

Copilot uses AI. Check for mistakes.
batch_group,
write_pref_data
):
# get write file node properties > OrederDict because order does matter
Copy link

Copilot AI Nov 3, 2025

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'.

Suggested change
# get write file node properties > OrederDict because order does matter
# get write file node properties > OrderedDict because order does matter

Copilot uses AI. Check for mistakes.
batchgroup_name = folder_path.replace("/", "_")

batch_data = {
"shematic_reels": [
Copy link

Copilot AI Nov 3, 2025

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'.

Suggested change
"shematic_reels": [
"schematic_reels": [

Copilot uses AI. Check for mistakes.

return bgroup

def _get_anamoty_data_with_current_task(self, instance, task_data):
Copy link

Copilot AI Nov 3, 2025

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.

Copilot uses AI. Check for mistakes.
Comment on lines 5 to 7
from copy import deepcopy


Copy link

Copilot AI Nov 3, 2025

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.

Suggested change
from copy import deepcopy

Copilot uses AI. Check for mistakes.
Comment on lines +20 to +25
creator_identifier = instance.data["creator_identifier"]

if creator_identifier != "io.ayon.creators.flame.batchgroup":
# only interested in flame batchgroup
return

Copy link

Copilot AI Nov 3, 2025

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.

Suggested change
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"]

Copilot uses AI. Check for mistakes.
f"{sub_instance_data['productName']}"
)
),
"families": ["batchgroup"]
Copy link

Copilot AI Nov 3, 2025

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.

Copilot uses AI. Check for mistakes.
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.
@jakubjezek001 jakubjezek001 changed the title Adds batchgroup publishing workflow Adds batchgroup publishing workflow - mvp Nov 11, 2025
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

YN-0022_publishing batch as workfile to files

2 participants