Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
General: Avoid fallback if value is 0 for handle start/end (#5652)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fabiaserra authored Oct 9, 2023
1 parent 71a1365 commit ca1492c
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions openpype/pipeline/farm/pyblish_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
)
)


Expand Down

0 comments on commit ca1492c

Please sign in to comment.