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

Commit

Permalink
feature/OP-7692_Folder_Batch_publishing_tool
Browse files Browse the repository at this point in the history
  • Loading branch information
Braden Jennings committed Feb 7, 2024
1 parent 06b060c commit 4f41067
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions openpype/hosts/batchpublisher/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,12 @@ def get_product_items(self, directory):
filepath_parts = filepath.split(".")
filepath_parts[-2] = "#" * len(filepath_parts[-2])
# Replace the file path with the version with star in it
filepath = ".".join(filepath_parts)
frames = self._get_frames_for_filepath(filepath)
frame_start = frames[0]
frame_end = frames[-1]
_filepath = ".".join(filepath_parts)
frames = self._get_frames_for_filepath(_filepath)
if frames:
filepath = _filepath
frame_start = frames[0]
frame_end = frames[-1]
# Do not add ingest file path, if it's already been added
if filepath in product_items:
continue
Expand Down Expand Up @@ -277,10 +279,12 @@ def get_product_items(self, directory):
filepath_parts = filepath.split(".")
filepath_parts[-2] = "*"
# Replace the file path with the version with star in it
filepath = ".".join(filepath_parts)
frames = self._get_frames_for_filepath(filepath)
frame_start = frames[0]
frame_end = frames[-1]
_filepath = ".".join(filepath_parts)
frames = self._get_frames_for_filepath(_filepath)
if frames:
filepath = _filepath
frame_start = frames[0]
frame_end = frames[-1]
# Do not add ingest file path, if it's already been added
if filepath in product_items:
continue
Expand Down Expand Up @@ -371,6 +375,9 @@ def _get_frames_for_filepath(self, filepath):
frames = list()
for _filepath in glob.glob(filepath):
filepath_parts = _filepath.split(".")
frame = int(filepath_parts[-2])
try:
frame = int(filepath_parts[-2])
except Exception:
continue
frames.append(frame)
return sorted(frames)

0 comments on commit 4f41067

Please sign in to comment.