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

Commit

Permalink
Merge pull request #3940 from Tilix4/fx_kitsu_module
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolar authored Oct 17, 2022
2 parents ec206be + 4aec32a commit c4c09ec
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions openpype/modules/kitsu/utils/update_op_with_zou.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,9 @@ def update_op_assets(
item_data["frameStart"] = frame_in
# Frames duration, fallback on 0
try:
frames_duration = int(item_data.pop("nb_frames", 0))
# NOTE nb_frames is stored directly in item
# because of zou's legacy design
frames_duration = int(item.get("nb_frames", 0))
except (TypeError, ValueError):
frames_duration = 0
# Frame out, fallback on frame_in + duration or project's value or 1001
Expand Down Expand Up @@ -170,7 +172,7 @@ def update_op_assets(
# Substitute item type for general classification (assets or shots)
if item_type in ["Asset", "AssetType"]:
entity_root_asset_name = "Assets"
elif item_type in ["Episode", "Sequence"]:
elif item_type in ["Episode", "Sequence", "Shot"]:
entity_root_asset_name = "Shots"

# Root parent folder if exist
Expand Down Expand Up @@ -276,11 +278,13 @@ def write_project_to_op(project: dict, dbcon: AvalonMongoDB) -> UpdateOne:

match_res = re.match(r"(\d+)x(\d+)", project["resolution"])
if match_res:
project_data['resolutionWidth'] = int(match_res.group(1))
project_data['resolutionHeight'] = int(match_res.group(2))
project_data["resolutionWidth"] = int(match_res.group(1))
project_data["resolutionHeight"] = int(match_res.group(2))
else:
log.warning(f"\'{project['resolution']}\' does not match the expected"
" format for the resolution, for example: 1920x1080")
log.warning(
f"'{project['resolution']}' does not match the expected"
" format for the resolution, for example: 1920x1080"
)

return UpdateOne(
{"_id": project_doc["_id"]},
Expand Down

0 comments on commit c4c09ec

Please sign in to comment.