Skip to content

Commit

Permalink
make sure there is default fps numerator value when fps is not in fol…
Browse files Browse the repository at this point in the history
…der_entity attribute
  • Loading branch information
moonyuet committed Jul 15, 2024
1 parent d4ea453 commit 7bbd6fd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
31 changes: 16 additions & 15 deletions client/ayon_unreal/api/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,29 +607,30 @@ def generate_sequence(h, h_dir):
folder_path,
fields={"id", "attrib.fps"}
)

start_frames = []
end_frames = []
if folder_entity:
unreal.log("Found folder entity data: {}".format(folder_entity))

elements = list(ayon_api.get_folders(
project_name,
parent_ids=[folder_entity["id"]],
fields={"id", "attrib.clipIn", "attrib.clipOut"}
))
for e in elements:
start_frames.append(e["attrib"].get("clipIn"))
end_frames.append(e["attrib"].get("clipOut"))

elements.extend(ayon_api.get_folders(
elements = list(ayon_api.get_folders(
project_name,
parent_ids=[e["id"]],
parent_ids=[folder_entity["id"]],
fields={"id", "attrib.clipIn", "attrib.clipOut"}
))
for e in elements:
start_frames.append(e["attrib"].get("clipIn"))
end_frames.append(e["attrib"].get("clipOut"))

elements.extend(ayon_api.get_folders(
project_name,
parent_ids=[e["id"]],
fields={"id", "attrib.clipIn", "attrib.clipOut"}
))

min_frame = min(start_frames)
max_frame = max(end_frames)
min_frame = min(start_frames, default=sequence.get_playback_start())
max_frame = max(end_frames, default=sequence.get_playback_end())

fps = folder_entity["attrib"].get("fps")
fps = folder_entity["attrib"].get("fps") or 30.0

sequence.set_display_rate(
unreal.FrameRate(fps, 1.0))
Expand Down
2 changes: 1 addition & 1 deletion client/ayon_unreal/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# -*- coding: utf-8 -*-
"""Package declaring unreal addon version."""
__version__ = "0.2.0"
__version__ = "0.2.2-dev.1"
2 changes: 1 addition & 1 deletion package.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "unreal"
title = "Unreal"
version = "0.2.1-dev.1"
version = "0.2.2-dev.1"

client_dir = "ayon_unreal"

Expand Down

0 comments on commit 7bbd6fd

Please sign in to comment.