fix(nuke): improving loaders

This commit is contained in:
Jakub Jezek 2020-02-28 17:43:41 +01:00
parent 391861da41
commit 81662d4edd
No known key found for this signature in database
GPG key ID: C4B96E101D2A47F3
2 changed files with 11 additions and 4 deletions

View file

@ -112,6 +112,7 @@ class LoadMov(api.Loader):
)
version = context['version']
version_data = version.get("data", {})
repr_id = context["representation"]["_id"]
orig_first = version_data.get("frameStart")
orig_last = version_data.get("frameEnd")
@ -120,12 +121,16 @@ class LoadMov(api.Loader):
first = orig_first - diff
last = orig_last - diff
handle_start = version_data.get("handleStart")
handle_end = version_data.get("handleEnd")
handle_start = version_data.get("handleStart", 0)
handle_end = version_data.get("handleEnd", 0)
colorspace = version_data.get("colorspace")
repr_cont = context["representation"]["context"]
self.log.debug(
"Representation id `{}` ".format(repr_id))
context["representation"]["_id"]
# create handles offset (only to last, because of mov)
last += handle_start + handle_end
# offset should be with handles so it match orig frame range
@ -138,7 +143,6 @@ class LoadMov(api.Loader):
file = self.fname
if not file:
repr_id = context["representation"]["_id"]
self.log.warning(
"Representation id `{}` is failing to load".format(repr_id))
return

View file

@ -86,8 +86,11 @@ class LoadSequence(api.Loader):
version = context['version']
version_data = version.get("data", {})
repr_id = context["representation"]["_id"]
self.log.info("version_data: {}\n".format(version_data))
self.log.debug(
"Representation id `{}` ".format(repr_id))
self.first_frame = int(nuke.root()["first_frame"].getValue())
self.handle_start = version_data.get("handleStart", 0)