processing review feedback

This commit is contained in:
Jakub Jezek 2022-03-08 11:57:06 +01:00
parent f566779531
commit 8617b6d389
No known key found for this signature in database
GPG key ID: D8548FBF690B100A

View file

@ -1107,8 +1107,10 @@ class ExtractReview(pyblish.api.InstancePlugin):
output.extend([left_line, right_line]) output.extend([left_line, right_line])
else: else:
raise ValueError( raise ValueError((
"Letterbox state \"{}\" is not recognized".format(state) "Letterbox not working: ratio set \"{}\", "
"Image ratio\"{}\"").format(
format(ratio, ".3f"), format(output_ratio, ".3f"))
) )
return output return output
@ -1124,9 +1126,20 @@ class ExtractReview(pyblish.api.InstancePlugin):
""" """
filters = [] filters = []
# if reformat input video file is already reforamted from upstream
reformat_in_baking = bool("reformated" in new_repre["tags"])
self.log.debug("reformat_in_baking: `{}`".format(reformat_in_baking))
# Get instance data # Get instance data
pixel_aspect = temp_data["pixel_aspect"] pixel_aspect = temp_data["pixel_aspect"]
if reformat_in_baking:
self.log.debug((
"Using resolution from input. It is already "
"reformated from upstream process"
))
pixel_aspect = 1
# NOTE Skipped using instance's resolution # NOTE Skipped using instance's resolution
full_input_path_single_file = temp_data["full_input_path_single_file"] full_input_path_single_file = temp_data["full_input_path_single_file"]
try: try:
@ -1161,19 +1174,6 @@ class ExtractReview(pyblish.api.InstancePlugin):
output_width = output_def.get("width") or None output_width = output_def.get("width") or None
output_height = output_def.get("height") or None output_height = output_def.get("height") or None
# if nuke baking profile was having set reformat node
reformat_in_baking = bool("reformated" in new_repre["tags"])
self.log.debug("reformat_in_baking: `{}`".format(reformat_in_baking))
if reformat_in_baking:
self.log.debug((
"Using resolution from input. It is already "
"reformated from baking process"
))
output_width = output_width or input_width
output_height = output_height or input_height
pixel_aspect = 1
# Overscal color # Overscal color
overscan_color_value = "black" overscan_color_value = "black"
overscan_color = output_def.get("overscan_color") overscan_color = output_def.get("overscan_color")
@ -1202,9 +1202,6 @@ class ExtractReview(pyblish.api.InstancePlugin):
output_width = input_width output_width = input_width
output_height = input_height output_height = input_height
letter_box_def = output_def["letter_box"]
letter_box_enabled = letter_box_def["enabled"]
# Make sure input width and height is not an odd number # Make sure input width and height is not an odd number
input_width_is_odd = bool(input_width % 2 != 0) input_width_is_odd = bool(input_width % 2 != 0)
input_height_is_odd = bool(input_height % 2 != 0) input_height_is_odd = bool(input_height % 2 != 0)
@ -1263,6 +1260,9 @@ class ExtractReview(pyblish.api.InstancePlugin):
"Output resolution is {}x{}".format(output_width, output_height) "Output resolution is {}x{}".format(output_width, output_height)
) )
letter_box_def = output_def["letter_box"]
letter_box_enabled = letter_box_def["enabled"]
# Skip processing if resolution is same as input's and letterbox is # Skip processing if resolution is same as input's and letterbox is
# not set # not set
if ( if (
@ -1347,12 +1347,6 @@ class ExtractReview(pyblish.api.InstancePlugin):
# letter_box # letter_box
if letter_box_enabled: if letter_box_enabled:
filters.extend([
"scale={}x{}:flags=lanczos".format(
output_width, output_height
),
"setsar=1"
])
filters.extend( filters.extend(
self.get_letterbox_filters( self.get_letterbox_filters(
letter_box_def, letter_box_def,