flame: turn double negative logic to readable code

This commit is contained in:
Jakub Jezek 2022-09-15 13:11:42 +02:00
parent c97602341f
commit ed29c38cdc
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -1,7 +1,6 @@
import os
import re
import tempfile
from pprint import pformat
from copy import deepcopy
import pyblish.api
@ -90,7 +89,7 @@ class ExtractSubsetResources(openpype.api.Extractor):
handle_end = instance.data["handleEnd"]
handles = max(handle_start, handle_end)
include_handles = instance.data.get("includeHandles")
not_retimed_handles = instance.data.get("notRetimedHandles")
retimed_handles = instance.data.get("retimedHandles")
# get media source range with handles
source_start_handles = instance.data["sourceStartH"]
@ -98,15 +97,7 @@ class ExtractSubsetResources(openpype.api.Extractor):
# retime if needed
if r_speed != 1.0:
if not_retimed_handles:
# handles are not retimed
source_end_handles = (
source_start_handles
+ (r_source_dur - 1)
+ handle_start
+ handle_end
)
else:
if retimed_handles:
# handles are retimed
source_start_handles = (
instance.data["sourceStart"] - r_handle_start)
@ -117,11 +108,20 @@ class ExtractSubsetResources(openpype.api.Extractor):
+ r_handle_end
)
else:
# handles are not retimed
source_end_handles = (
source_start_handles
+ (r_source_dur - 1)
+ handle_start
+ handle_end
)
# get frame range with handles for representation range
frame_start_handle = frame_start - handle_start
repre_frame_start = frame_start_handle
if include_handles:
if r_speed == 1.0 or not_retimed_handles:
if r_speed == 1.0 or not retimed_handles:
frame_start_handle = frame_start
else:
frame_start_handle = (