mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
General: Avoid fallback if value is 0 for handle start/end (#5652)
* Change defaults for handleStart so if it returns 0 it doesn't fallback to the context data * Update get fallbacks for the rest of arguments * Create context variable to shorten lines * Add step to TimeData object
This commit is contained in:
parent
71a1365216
commit
ca1492c839
1 changed files with 11 additions and 10 deletions
|
|
@ -107,17 +107,18 @@ def get_time_data_from_instance_or_context(instance):
|
|||
TimeData: dataclass holding time information.
|
||||
|
||||
"""
|
||||
context = instance.context
|
||||
return TimeData(
|
||||
start=(instance.data.get("frameStart") or
|
||||
instance.context.data.get("frameStart")),
|
||||
end=(instance.data.get("frameEnd") or
|
||||
instance.context.data.get("frameEnd")),
|
||||
fps=(instance.data.get("fps") or
|
||||
instance.context.data.get("fps")),
|
||||
handle_start=(instance.data.get("handleStart") or
|
||||
instance.context.data.get("handleStart")), # noqa: E501
|
||||
handle_end=(instance.data.get("handleEnd") or
|
||||
instance.context.data.get("handleEnd"))
|
||||
start=instance.data.get("frameStart", context.data.get("frameStart")),
|
||||
end=instance.data.get("frameEnd", context.data.get("frameEnd")),
|
||||
fps=instance.data.get("fps", context.data.get("fps")),
|
||||
step=instance.data.get("byFrameStep", instance.data.get("step", 1)),
|
||||
handle_start=instance.data.get(
|
||||
"handleStart", context.data.get("handleStart")
|
||||
),
|
||||
handle_end=instance.data.get(
|
||||
"handleEnd", context.data.get("handleEnd")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue