-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #515 from ynput/feature/AY-4802_resolve-editorial-…
…load-editorial-exchange-package Resolve: loading editorial package as timeline
- Loading branch information
Showing
7 changed files
with
244 additions
and
51 deletions.
There are no files selected for viewing
170 changes: 150 additions & 20 deletions
170
...ts/resolve/RESOLVE_API_v18.5.1-build6.txt → ...ts/resolve/RESOLVE_API_v19.0B-build20.txt
Large diffs are not rendered by default.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
client/ayon_core/hosts/resolve/plugins/load/load_editorial_package.py
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
from pathlib import Path | ||
|
||
from ayon_core.pipeline import ( | ||
load, | ||
get_representation_path, | ||
) | ||
|
||
from ayon_core.hosts.resolve.api import lib | ||
|
||
|
||
class LoadEditorialPackage(load.LoaderPlugin): | ||
"""Load editorial package to timeline. | ||
Loading timeline from OTIO file included media sources | ||
and timeline structure. | ||
""" | ||
|
||
product_types = {"editorial_pkg"} | ||
|
||
representations = {"*"} | ||
extensions = {"otio"} | ||
|
||
label = "Load as Timeline" | ||
order = -10 | ||
icon = "ei.align-left" | ||
color = "orange" | ||
|
||
def load(self, context, name, namespace, data): | ||
files = get_representation_path(context["representation"]) | ||
|
||
search_folder_path = Path(files).parent / "resources" | ||
|
||
project = lib.get_current_project() | ||
media_pool = project.GetMediaPool() | ||
|
||
# create versioned bin for editorial package | ||
version_name = context["version"]["name"] | ||
bin_name = f"{name}_{version_name}" | ||
lib.create_bin(bin_name) | ||
|
||
import_options = { | ||
"timelineName": "Editorial Package Timeline", | ||
"importSourceClips": True, | ||
"sourceClipsPath": search_folder_path.as_posix(), | ||
} | ||
|
||
timeline = media_pool.ImportTimelineFromFile(files, import_options) | ||
print("Timeline imported: ", timeline) | ||
|
||
def update(self, container, context): | ||
# TODO: implement update method in future | ||
pass |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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