From 0de70c1d9267c6b5880aa7f3cca6f46b8ddd1511 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Thu, 28 Jan 2021 18:57:27 +0100 Subject: [PATCH] resolve: wip update container fix ls(), rename SequenceLoader to TimelineItemLoader --- pype/hosts/resolve/__init__.py | 4 ++-- pype/hosts/resolve/api/pipeline.py | 2 +- pype/hosts/resolve/api/plugin.py | 2 +- .../plugins/load/{load_sequence.py => load_clip.py} | 9 +++++---- 4 files changed, 9 insertions(+), 8 deletions(-) rename pype/hosts/resolve/plugins/load/{load_sequence.py => load_clip.py} (95%) diff --git a/pype/hosts/resolve/__init__.py b/pype/hosts/resolve/__init__.py index e1e81a4b71..0e01645cb8 100644 --- a/pype/hosts/resolve/__init__.py +++ b/pype/hosts/resolve/__init__.py @@ -44,7 +44,7 @@ from .api.menu import launch_pype_menu from .api.plugin import ( ClipLoader, - SequenceLoader, + TimelineItemLoader, Creator, PublishClip ) @@ -104,7 +104,7 @@ __all__ = [ # plugin "ClipLoader", - "SequenceLoader", + "TimelineItemLoader", "Creator", "PublishClip", diff --git a/pype/hosts/resolve/api/pipeline.py b/pype/hosts/resolve/api/pipeline.py index 14eb0d4a76..c46c9c07a8 100644 --- a/pype/hosts/resolve/api/pipeline.py +++ b/pype/hosts/resolve/api/pipeline.py @@ -175,7 +175,7 @@ def parse_container(timeline_item, validate=True): container = {key: data[key] for key in required} - container["objectName"] = timeline_item.name() + container["objectName"] = timeline_item.GetName() # Store reference to the node object container["_timeline_item"] = timeline_item diff --git a/pype/hosts/resolve/api/plugin.py b/pype/hosts/resolve/api/plugin.py index 3322d17350..f0c774397b 100644 --- a/pype/hosts/resolve/api/plugin.py +++ b/pype/hosts/resolve/api/plugin.py @@ -412,7 +412,7 @@ class ClipLoader: return timeline_item -class SequenceLoader(api.Loader): +class TimelineItemLoader(api.Loader): """A basic SequenceLoader for Resolve This will implement the basic behavior for a loader to inherit from that diff --git a/pype/hosts/resolve/plugins/load/load_sequence.py b/pype/hosts/resolve/plugins/load/load_clip.py similarity index 95% rename from pype/hosts/resolve/plugins/load/load_sequence.py rename to pype/hosts/resolve/plugins/load/load_clip.py index 735f60dcff..0a92293660 100644 --- a/pype/hosts/resolve/plugins/load/load_sequence.py +++ b/pype/hosts/resolve/plugins/load/load_clip.py @@ -2,7 +2,7 @@ from avalon import io, api from pype.hosts import resolve -class LoadClip(resolve.SequenceLoader): +class LoadClip(resolve.TimelineItemLoader): """Load a subset to timeline as clip Place clip to timeline on its asset origin timings collected @@ -83,7 +83,7 @@ class LoadClip(resolve.SequenceLoader): # load clip to timeline and get main variables name = container['name'] namespace = container['namespace'] - timeline_item = resolve.lib.get_pype_track_item_by_name(namespace) + timeline_item = resolve.get_pype_timeline_item_by_name(namespace) version = io.find_one({ "type": "version", "_id": representation["parent"] @@ -92,8 +92,9 @@ class LoadClip(resolve.SequenceLoader): version_name = version.get("name", None) colorspace = version_data.get("colorspace", None) object_name = "{}_{}".format(name, namespace) - file = api.get_representation_path(representation).replace("\\", "/") - + file = api.get_representation_path(representation) + print(timeline_item) + print(file) # TODO: implement update # # reconnect media to new path # track_item.source().reconnectMedia(file)