Skip to content
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

Resolve: avoiding clips without mediapoolitems #92

Merged
merged 8 commits into from
Mar 18, 2024
3 changes: 3 additions & 0 deletions client/ayon_core/hosts/resolve/api/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,6 +409,9 @@ def get_current_timeline_items(
}
# get track item object and its color
for clip_index, ti in enumerate(_clips[track_index]):
if not ti.GetMediaPoolItem():
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
continue

jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
data = _data.copy()
data["clip"] = {
"item": ti,
Expand Down
11 changes: 11 additions & 0 deletions client/ayon_core/hosts/resolve/api/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
LoaderPlugin,
Anatomy
)
from ayon_core.pipeline.load import LoadError
jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved

from . import lib
from .menu import load_stylesheet
Expand Down Expand Up @@ -405,6 +406,11 @@ def load(self, files):
files,
self.active_bin
)

assert media_pool_item, LoadError(
"Cannot create media pool item for files: `{}`".format(files)
)

jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
_clip_property = media_pool_item.GetClipProperty
source_in = int(_clip_property("Start"))
source_out = int(_clip_property("End"))
Expand Down Expand Up @@ -475,6 +481,11 @@ def update(self, timeline_item, files):
files,
self.active_bin
)

assert media_pool_item, LoadError(
"Cannot create media pool item for files: `{}`".format(files)
)

jakubjezek001 marked this conversation as resolved.
Show resolved Hide resolved
_clip_property = media_pool_item.GetClipProperty

source_in = int(_clip_property("Start"))
Expand Down