generated from ynput/ayon-addon-template
-
Notifications
You must be signed in to change notification settings - Fork 3
YN-0073 Enable on-demand rendering for unlinked media segments #102
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
Draft
jakubjezek001
wants to merge
30
commits into
develop
Choose a base branch
from
enhncement/YN-0073_on_demand_rendering_clips_with_no_linked_media
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
YN-0073 Enable on-demand rendering for unlinked media segments #102
jakubjezek001
wants to merge
30
commits into
develop
from
enhncement/YN-0073_on_demand_rendering_clips_with_no_linked_media
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Restructures ExtractProductResources settings to separate missing media link export presets from additional representation exports. Includes conversion function to migrate legacy settings from version 1.3.0 to the new nested structure under additional_representation_export.
Reorganize plugin to use dedicated setting attributes instead of generic lists. Split processing into separate methods for missing media links, thumbnails, and additional representations. Rename 'active' field to 'enabled' in export presets and move thumbnail configuration from default_presets to dedicated thumbnail_preset setting.
Implement early return when thumbnail preset is disabled or not set. Add placeholder for thumbnail generation logic that should be refactored from additional_representation_export_process.
Refactor `process` method to extract all clip-related data into a separate `get_clip_data` method that returns a dictionary. Update all processing methods to accept and use this shared clip data, eliminating duplicate data extraction code.
…ips_with_no_linked_media
Only render missing media when clip path is not present, and update clip_data with the result of the rendering process.
Extract preset processing logic into separate method and simplify preset configuration handling. Remove export_presets from clip_data and process presets directly from settings. Add type hints and improve import ordering. Mark clip abstraction task as complete.
- Replace .format() calls with f-strings for regular strings - Use %-style formatting for logging statements (best practice) - Collapse multi-line string formatting for readability - Simplify docstrings by removing unnecessary blank lines - Change elif to or for cleaner conditional logic
- Add comprehensive type hints and docstrings to get_clip_data method - Document return dictionary structure with all keys and types - Check 'enabled' flag instead of 'active' in preset filtering - Remove unused 'activated_preset' variable from _should_skip - Add Raises section to _process_preset_export docstring - Reformat _process_preset_export signature for readability - Remove redundant local variable extractions in export methods
Replace os.path operations with pathlib.Path equivalents for more idiomatic Python. Add existence check when listing directory contents and use mkdir with exist_ok flag for safer directory creation.
Move clip data retrieval to collect_shots plugin and cache it in instance data, eliminating redundant API calls in downstream plugins. Consolidate staging directory creation and improve file handling logic for export presets.
Refactors exported file processing code from `_process_preset_export` into a new `_process_exported_files` method to improve code organization and readability. Also fixes a syntax error where a colon was missing after an if statement.
Extract extension from preset config at the start of processing rather than passing entire preset_config to _process_exported_files. Add safety checks for optional preset fields and validate frame range data exists before adding to representation.
The representation data was being created but not added to the instance's representations list, causing it to be lost.
- Use correct thumbnail_preset instead of missing_media_link_export_preset - Extract segment from clip_data for unlinked media handling - Refactor colorspace logic into _get_imageio_colorspace method - Add convert_unlinked_segment_to_clip to handle segments without linked media by exporting and re-importing them - Only import clip when clip_path is available
…ips_with_no_linked_media
Initialize error_message, segment_name, and fpath as empty strings and populate error_message instead of overwriting segment_name when validation fails. Separate error messages from segment name in clip data Initialize separate `error_message` and `segment_name` fields in clip data dictionary, and populate error messages in the dedicated field instead of overwriting the segment name.
- Remove the unused import ayon_flame.api as ayfapi - Merge parent editorial data into instance data earlier in the process - Remove the duplicate merge block at the end of the method
This ensures parent instance data is available before removing reviewable source and review data from the instance.
…dering_clips_with_no_linked_media' into enhncement/YN-0073_on_demand_rendering_clips_with_no_linked_media
- Persist parent shot creator attributes as shotCreatorAttrs on the collected clip - Extend shot collection to include creator_attributes - Use shotCreatorAttrs to supply frameStart, clipIn, and clipOut when missing in extraction
Add fallback logic to calculate retiming attributes directly from segment data when no clip path exists. Unlinked segments lack OTIO references, so compute speed, handles, and source range using segment's source_in, source_out, and record_duration values.
- Return and reuse exporting_clip to avoid redundant imports - Fix unlinked segment conversion using temp library duplication - Only clear representations if additional presets are enabled - Use extension directly for representation name consistency - Add debug logging for instance representations - Handle missing parsed_comment_attrs gracefully - Ensure Path objects are used consistently for clip_path
- Convert clip_path to POSIX string format for cross-platform compatibility - Remove deletion of exporting_clip to preserve the clip after export
…ips_with_no_linked_media
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changelog Description
This enhancement enables Flame to publish clips without linked media by implementing on-demand media rendering. Previously, clips with unlinked segments failed during the publishing workflow. The system now detects missing media paths and automatically renders the segment content using configurable export presets, allowing seamless publishing of both linked and unlinked media types. This resolves workflow bottlenecks where artists need to publish segments that exist only in Flame's timeline without source media.
The settings schema has been restructured for improved clarity, separating missing media handling, thumbnail generation, and additional representation exports into distinct configuration sections. This modular approach provides better control over export pipelines and makes preset management more intuitive.
Links:
Additional info
Core Changes:
The
extract_product_resources.pyplugin now follows a detection-and-render pattern:Clip Data Extraction - The new
get_clip_data()method centralizes all clip attribute extraction, returning a comprehensive dictionary containing segment metadata, frame ranges, handles, and retiming information. This data structure is reused across all export preset processors.Missing Media Detection - When
clip_data["clip_path"]isNone, the plugin automatically triggersmissing_media_link_export_preset_process(), which uses the newconvert_unlinked_segment_to_clip()method. This method:PyExporterPyClipobjectclip_data["clip_path"]with the rendered media pathModular Preset Processing - Three specialized processors handle different export scenarios:
missing_media_link_export_preset_process()- Renders unlinked segmentsthumbnail_preset_process()- Generates thumbnail representationsadditional_representation_export_process()- Handles custom export presetsSettings Schema Refactor - Migrated from flat
export_presets_mappinglist to nested structure:missing_media_link_export_preset- Dedicated config for unlinked media renderingthumbnail_preset- Isolated thumbnail generation settingsadditional_representation_export- Contains legacy export presets mappingA conversion function
_convert_collect_shots_plugins_1_3_1()ensures backward compatibility with existing studio configurations.Technical Implementation:
The refactored code introduces several helper methods that improve maintainability:
_process_preset_export()- Unified export logic handling both linked and unlinked clips_process_exported_files()- Normalizes file discovery and nested folder handling_create_representation_data()- Standardizes representation dictionary construction_get_imageio_colorspace()- Extracts and remaps colorspace informationError handling now validates clip data availability early in the process, raising
PublishErrorwhen segment attributes cannot be retrieved. TheclipDatais now stored on the instance during collection, eliminating redundant API calls to Flame during extraction.Testing notes:
Unlinked Media Test:
Linked Media Test:
Settings Validation:
missing_media_link_export_presetXML preset and colorspaceBackward Compatibility:
export_presets_mappingcorrectly