Skip to content

Commit

Permalink
Refactor timeline naming logic for editorial package
Browse files Browse the repository at this point in the history
- Refactored timeline name creation based on folder path
- Added metadata clearing for timeline clips
  • Loading branch information
jakubjezek001 committed Aug 8, 2024
1 parent 74bba1d commit 8cf50d0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion client/ayon_resolve/plugins/load/load_editorial_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ def load(self, context, name, namespace, data):
# create versioned bin for editorial package
version_name = context["version"]["name"]
loaded_bin = lib.create_bin(f"{folder_path}/{name}/{version_name}")
loaded_timeline_name = f"{name}_{version_name}_timeline"

# make timeline unique name based on folder path
folder_path_name = folder_path.replace("/", "_").lstrip("_")
loaded_timeline_name = (
f"{folder_path_name}_{name}_{version_name}_timeline")
import_options = {
"timelineName": loaded_timeline_name,
"importSourceClips": True,
Expand Down Expand Up @@ -75,6 +79,9 @@ def load(self, context, name, namespace, data):
print("Timeline imported: ", timeline)

def update(self, container, context):
timeline_mp_clip = container["_item"]
timeline_mp_clip.SetMetadata(lib.pype_tag_name, "")

self.load(
context,
context["product"]["name"],
Expand Down

0 comments on commit 8cf50d0

Please sign in to comment.