Merge branch 'develop' into feature/AY-7125_advanced-editorial-publish-to-ayon-38

This commit is contained in:
Jakub Ježek 2025-01-09 12:02:57 +01:00 committed by GitHub
commit 301e9ce462
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 44 additions and 43 deletions

View file

@ -117,10 +117,7 @@ class HostDirmap(ABC):
It checks if Site Sync is enabled and user chose to use local It checks if Site Sync is enabled and user chose to use local
site, in that case configuration in Local Settings takes precedence site, in that case configuration in Local Settings takes precedence
""" """
mapping_sett = self.project_settings[self.host_name].get("dirmap", {})
dirmap_label = "{}-dirmap".format(self.host_name)
mapping_sett = self.project_settings[self.host_name].get(dirmap_label,
{})
local_mapping = self._get_local_sync_dirmap() local_mapping = self._get_local_sync_dirmap()
mapping_enabled = mapping_sett.get("enabled") or bool(local_mapping) mapping_enabled = mapping_sett.get("enabled") or bool(local_mapping)
if not mapping_enabled: if not mapping_enabled:

View file

@ -561,9 +561,6 @@ class FormattingPart:
""" """
key = self._template_base key = self._template_base
if key in result.really_used_values:
result.add_output(result.really_used_values[key])
return result
# ensure key is properly formed [({})] properly closed. # ensure key is properly formed [({})] properly closed.
if not self.validate_key_is_matched(key): if not self.validate_key_is_matched(key):

View file

@ -585,9 +585,6 @@ def version_up_current_workfile():
"""Function to increment and save workfile """Function to increment and save workfile
""" """
host = registered_host() host = registered_host()
if not host.has_unsaved_changes():
print("No unsaved changes, skipping file save..")
return
project_name = get_current_project_name() project_name = get_current_project_name()
folder_path = get_current_folder_path() folder_path = get_current_folder_path()

View file

@ -717,6 +717,7 @@ def get_instance_staging_dir(instance):
instance.data.update({ instance.data.update({
"stagingDir": staging_dir_path, "stagingDir": staging_dir_path,
"stagingDir_persistent": staging_dir_info.persistent, "stagingDir_persistent": staging_dir_info.persistent,
"stagingDir_custom": staging_dir_info.custom
}) })
return staging_dir_path return staging_dir_path

View file

@ -12,6 +12,7 @@ from .tempdir import get_temp_dir
class StagingDir: class StagingDir:
directory: str directory: str
persistent: bool persistent: bool
custom: bool # Whether the staging dir is a custom staging dir
def get_staging_dir_config( def get_staging_dir_config(
@ -204,7 +205,8 @@ def get_staging_dir_info(
dir_template = staging_dir_config["template"]["directory"] dir_template = staging_dir_config["template"]["directory"]
return StagingDir( return StagingDir(
dir_template.format_strict(ctx_data), dir_template.format_strict(ctx_data),
staging_dir_config["persistence"], persistent=staging_dir_config["persistence"],
custom=True
) )
# no config found but force an output # no config found but force an output
@ -216,7 +218,8 @@ def get_staging_dir_info(
prefix=prefix, prefix=prefix,
suffix=suffix, suffix=suffix,
), ),
False, persistent=False,
custom=False
) )
return None return None

View file

@ -178,7 +178,10 @@ class CollectOtioSubsetResources(
repre = self._create_representation( repre = self._create_representation(
frame_start, frame_end, collection=collection) frame_start, frame_end, collection=collection)
if "review" in instance.data["families"]: if (
not instance.data.get("otioReviewClips")
and "review" in instance.data["families"]
):
review_repre = self._create_representation( review_repre = self._create_representation(
frame_start, frame_end, collection=collection, frame_start, frame_end, collection=collection,
delete=True, review=True) delete=True, review=True)
@ -197,7 +200,10 @@ class CollectOtioSubsetResources(
repre = self._create_representation( repre = self._create_representation(
frame_start, frame_end, file=filename, trim=_trim) frame_start, frame_end, file=filename, trim=_trim)
if "review" in instance.data["families"]: if (
not instance.data.get("otioReviewClips")
and "review" in instance.data["families"]
):
review_repre = self._create_representation( review_repre = self._create_representation(
frame_start, frame_end, frame_start, frame_end,
file=filename, delete=True, review=True) file=filename, delete=True, review=True)

View file

@ -265,7 +265,7 @@ class ActionDelegate(QtWidgets.QStyledItemDelegate):
if index.data(FORCE_NOT_OPEN_WORKFILE_ROLE): if index.data(FORCE_NOT_OPEN_WORKFILE_ROLE):
rect = QtCore.QRectF( rect = QtCore.QRectF(
option.rect.x(), option.rect.height(), 5, 5) option.rect.x(), option.rect.y() + option.rect.height(), 5, 5)
painter.setPen(QtCore.Qt.NoPen) painter.setPen(QtCore.Qt.NoPen)
painter.setBrush(QtGui.QColor(200, 0, 0)) painter.setBrush(QtGui.QColor(200, 0, 0))
painter.drawEllipse(rect) painter.drawEllipse(rect)

View file

@ -103,17 +103,17 @@ def test_image_sequence_with_embedded_tc_and_handles_out_of_range():
# 10 head black handles generated from gap (991-1000) # 10 head black handles generated from gap (991-1000)
"/path/to/ffmpeg -t 0.4166666666666667 -r 24.0 -f lavfi -i " "/path/to/ffmpeg -t 0.4166666666666667 -r 24.0 -f lavfi -i "
"color=c=black:s=1280x720 -tune stillimage -start_number 991 " "color=c=black:s=1280x720 -tune stillimage -start_number 991 "
"C:/result/output.%03d.jpg", "C:/result/output.%04d.jpg",
# 10 tail black handles generated from gap (1102-1111) # 10 tail black handles generated from gap (1102-1111)
"/path/to/ffmpeg -t 0.4166666666666667 -r 24.0 -f lavfi -i " "/path/to/ffmpeg -t 0.4166666666666667 -r 24.0 -f lavfi -i "
"color=c=black:s=1280x720 -tune stillimage -start_number 1102 " "color=c=black:s=1280x720 -tune stillimage -start_number 1102 "
"C:/result/output.%03d.jpg", "C:/result/output.%04d.jpg",
# Report from source exr (1001-1101) with enforce framerate # Report from source exr (1001-1101) with enforce framerate
"/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i " "/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i "
f"C:\\exr_embedded_tc{os.sep}output.%04d.exr -start_number 1001 " f"C:\\exr_embedded_tc{os.sep}output.%04d.exr -start_number 1001 "
"C:/result/output.%03d.jpg" "C:/result/output.%04d.jpg"
] ]
assert calls == expected assert calls == expected
@ -131,11 +131,11 @@ def test_image_sequence_and_handles_out_of_range():
expected = [ expected = [
# 5 head black frames generated from gap (991-995) # 5 head black frames generated from gap (991-995)
"/path/to/ffmpeg -t 0.2 -r 25.0 -f lavfi -i color=c=black:s=1280x720" "/path/to/ffmpeg -t 0.2 -r 25.0 -f lavfi -i color=c=black:s=1280x720"
" -tune stillimage -start_number 991 C:/result/output.%03d.jpg", " -tune stillimage -start_number 991 C:/result/output.%04d.jpg",
# 9 tail back frames generated from gap (1097-1105) # 9 tail back frames generated from gap (1097-1105)
"/path/to/ffmpeg -t 0.36 -r 25.0 -f lavfi -i color=c=black:s=1280x720" "/path/to/ffmpeg -t 0.36 -r 25.0 -f lavfi -i color=c=black:s=1280x720"
" -tune stillimage -start_number 1097 C:/result/output.%03d.jpg", " -tune stillimage -start_number 1097 C:/result/output.%04d.jpg",
# Report from source tiff (996-1096) # Report from source tiff (996-1096)
# 996-1000 = additional 5 head frames # 996-1000 = additional 5 head frames
@ -143,7 +143,7 @@ def test_image_sequence_and_handles_out_of_range():
# 1096-1096 = additional 1 tail frames # 1096-1096 = additional 1 tail frames
"/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i " "/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i "
f"C:\\tif_seq{os.sep}output.%04d.tif -start_number 996" f"C:\\tif_seq{os.sep}output.%04d.tif -start_number 996"
f" C:/result/output.%03d.jpg" f" C:/result/output.%04d.jpg"
] ]
assert calls == expected assert calls == expected
@ -164,7 +164,7 @@ def test_movie_with_embedded_tc_no_gap_handles():
# - duration = 68fr (source) + 20fr (handles) = 88frames = 3.666s # - duration = 68fr (source) + 20fr (handles) = 88frames = 3.666s
"/path/to/ffmpeg -ss 0.16666666666666666 -t 3.6666666666666665 " "/path/to/ffmpeg -ss 0.16666666666666666 -t 3.6666666666666665 "
"-i C:\\data\\qt_embedded_tc.mov -start_number 991 " "-i C:\\data\\qt_embedded_tc.mov -start_number 991 "
"C:/result/output.%03d.jpg" "C:/result/output.%04d.jpg"
] ]
assert calls == expected assert calls == expected
@ -181,12 +181,12 @@ def test_short_movie_head_gap_handles():
expected = [ expected = [
# 10 head black frames generated from gap (991-1000) # 10 head black frames generated from gap (991-1000)
"/path/to/ffmpeg -t 0.4 -r 25.0 -f lavfi -i color=c=black:s=1280x720" "/path/to/ffmpeg -t 0.4 -r 25.0 -f lavfi -i color=c=black:s=1280x720"
" -tune stillimage -start_number 991 C:/result/output.%03d.jpg", " -tune stillimage -start_number 991 C:/result/output.%04d.jpg",
# source range + 10 tail frames # source range + 10 tail frames
# duration = 50fr (source) + 10fr (tail handle) = 60 fr = 2.4s # duration = 50fr (source) + 10fr (tail handle) = 60 fr = 2.4s
"/path/to/ffmpeg -ss 0.0 -t 2.4 -i C:\\data\\movie.mp4" "/path/to/ffmpeg -ss 0.0 -t 2.4 -i C:\\data\\movie.mp4"
" -start_number 1001 C:/result/output.%03d.jpg" " -start_number 1001 C:/result/output.%04d.jpg"
] ]
assert calls == expected assert calls == expected
@ -204,13 +204,13 @@ def test_short_movie_tail_gap_handles():
# 10 tail black frames generated from gap (1067-1076) # 10 tail black frames generated from gap (1067-1076)
"/path/to/ffmpeg -t 0.4166666666666667 -r 24.0 -f lavfi -i " "/path/to/ffmpeg -t 0.4166666666666667 -r 24.0 -f lavfi -i "
"color=c=black:s=1280x720 -tune stillimage -start_number 1067 " "color=c=black:s=1280x720 -tune stillimage -start_number 1067 "
"C:/result/output.%03d.jpg", "C:/result/output.%04d.jpg",
# 10 head frames + source range # 10 head frames + source range
# duration = 10fr (head handle) + 66fr (source) = 76fr = 3.16s # duration = 10fr (head handle) + 66fr (source) = 76fr = 3.16s
"/path/to/ffmpeg -ss 1.0416666666666667 -t 3.1666666666666665 -i " "/path/to/ffmpeg -ss 1.0416666666666667 -t 3.1666666666666665 -i "
"C:\\data\\qt_no_tc_24fps.mov -start_number 991" "C:\\data\\qt_no_tc_24fps.mov -start_number 991"
" C:/result/output.%03d.jpg" " C:/result/output.%04d.jpg"
] ]
assert calls == expected assert calls == expected
@ -238,62 +238,62 @@ def test_multiple_review_clips_no_gap():
# 10 head black frames generated from gap (991-1000) # 10 head black frames generated from gap (991-1000)
'/path/to/ffmpeg -t 0.4 -r 25.0 -f lavfi' '/path/to/ffmpeg -t 0.4 -r 25.0 -f lavfi'
' -i color=c=black:s=1280x720 -tune ' ' -i color=c=black:s=1280x720 -tune '
'stillimage -start_number 991 C:/result/output.%03d.jpg', 'stillimage -start_number 991 C:/result/output.%04d.jpg',
# Alternance 25fps tiff sequence and 24fps exr sequence # Alternance 25fps tiff sequence and 24fps exr sequence
# for 100 frames each # for 100 frames each
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1001 C:/result/output.%03d.jpg', '-start_number 1001 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i '
f'C:\\with_tc{os.sep}output.%04d.exr ' f'C:\\with_tc{os.sep}output.%04d.exr '
'-start_number 1102 C:/result/output.%03d.jpg', '-start_number 1102 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1199 C:/result/output.%03d.jpg', '-start_number 1199 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i '
f'C:\\with_tc{os.sep}output.%04d.exr ' f'C:\\with_tc{os.sep}output.%04d.exr '
'-start_number 1300 C:/result/output.%03d.jpg', '-start_number 1300 C:/result/output.%04d.jpg',
# Repeated 25fps tiff sequence multiple times till the end # Repeated 25fps tiff sequence multiple times till the end
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1397 C:/result/output.%03d.jpg', '-start_number 1397 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1498 C:/result/output.%03d.jpg', '-start_number 1498 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1599 C:/result/output.%03d.jpg', '-start_number 1599 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1700 C:/result/output.%03d.jpg', '-start_number 1700 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1801 C:/result/output.%03d.jpg', '-start_number 1801 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 1902 C:/result/output.%03d.jpg', '-start_number 1902 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 2003 C:/result/output.%03d.jpg', '-start_number 2003 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 2104 C:/result/output.%03d.jpg', '-start_number 2104 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 25.0 -i '
f'C:\\no_tc{os.sep}output.%04d.tif ' f'C:\\no_tc{os.sep}output.%04d.tif '
'-start_number 2205 C:/result/output.%03d.jpg' '-start_number 2205 C:/result/output.%04d.jpg'
] ]
assert calls == expected assert calls == expected
@ -321,15 +321,15 @@ def test_multiple_review_clips_with_gap():
# Gap on review track (12 frames) # Gap on review track (12 frames)
'/path/to/ffmpeg -t 0.5 -r 24.0 -f lavfi' '/path/to/ffmpeg -t 0.5 -r 24.0 -f lavfi'
' -i color=c=black:s=1280x720 -tune ' ' -i color=c=black:s=1280x720 -tune '
'stillimage -start_number 991 C:/result/output.%03d.jpg', 'stillimage -start_number 991 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i '
f'C:\\with_tc{os.sep}output.%04d.exr ' f'C:\\with_tc{os.sep}output.%04d.exr '
'-start_number 1003 C:/result/output.%03d.jpg', '-start_number 1003 C:/result/output.%04d.jpg',
'/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i ' '/path/to/ffmpeg -start_number 1000 -framerate 24.0 -i '
f'C:\\with_tc{os.sep}output.%04d.exr ' f'C:\\with_tc{os.sep}output.%04d.exr '
'-start_number 1091 C:/result/output.%03d.jpg' '-start_number 1091 C:/result/output.%04d.jpg'
] ]
assert calls == expected assert calls == expected