Fix T91423: View Animation not working with stereoscopic animations

The animation playback did not take into account individual stereoscopic views.

This patch fixes this by playing back the active view render.

Reviewed By: campbellbarton

Maniphest Tasks: T91423

Differential Revision: https://developer.blender.org/D14070
This commit is contained in:
2022-02-11 20:53:29 -05:00
parent 27d3140b13
commit 517afcc858

View File

@@ -74,6 +74,12 @@ class PlayRenderedAnim(Operator):
# file_path = bpy.path.abspath(rd.filepath) # UNUSED # file_path = bpy.path.abspath(rd.filepath) # UNUSED
is_movie = rd.is_movie_format is_movie = rd.is_movie_format
views_format = rd.image_settings.views_format
if rd.use_multiview and views_format == 'INDIVIDUAL':
view_suffix = rd.views.active.file_suffix
else:
view_suffix = ""
# try and guess a command line if it doesn't exist # try and guess a command line if it doesn't exist
if preset == 'CUSTOM': if preset == 'CUSTOM':
player_path = prefs.filepaths.animation_player player_path = prefs.filepaths.animation_player
@@ -82,16 +88,16 @@ class PlayRenderedAnim(Operator):
if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}: if is_movie is False and preset in {'FRAMECYCLER', 'RV', 'MPLAYER'}:
# replace the number with '#' # replace the number with '#'
file_a = rd.frame_path(frame=0) file_a = rd.frame_path(frame=0, view=view_suffix)
# TODO, make an api call for this # TODO, make an api call for this
frame_tmp = 9 frame_tmp = 9
file_b = rd.frame_path(frame=frame_tmp) file_b = rd.frame_path(frame=frame_tmp, view=view_suffix)
while len(file_a) == len(file_b): while len(file_a) == len(file_b):
frame_tmp = (frame_tmp * 10) + 9 frame_tmp = (frame_tmp * 10) + 9
file_b = rd.frame_path(frame=frame_tmp) file_b = rd.frame_path(frame=frame_tmp, view=view_suffix)
file_b = rd.frame_path(frame=int(frame_tmp / 10)) file_b = rd.frame_path(frame=int(frame_tmp / 10), view=view_suffix)
file = ("".join((c if file_b[i] == c else "#") file = ("".join((c if file_b[i] == c else "#")
for i, c in enumerate(file_a))) for i, c in enumerate(file_a)))
@@ -100,7 +106,7 @@ class PlayRenderedAnim(Operator):
else: else:
path_valid = True path_valid = True
# works for movies and images # works for movies and images
file = rd.frame_path(frame=scene.frame_start, preview=scene.use_preview_range) file = rd.frame_path(frame=scene.frame_start, preview=scene.use_preview_range, view=view_suffix)
file = bpy.path.abspath(file) # expand '//' file = bpy.path.abspath(file) # expand '//'
if not os.path.exists(file): if not os.path.exists(file):
err_msg = tip_("File %r not found") % file err_msg = tip_("File %r not found") % file
@@ -109,7 +115,7 @@ class PlayRenderedAnim(Operator):
# one last try for full range if we used preview range # one last try for full range if we used preview range
if scene.use_preview_range and not path_valid: if scene.use_preview_range and not path_valid:
file = rd.frame_path(frame=scene.frame_start, preview=False) file = rd.frame_path(frame=scene.frame_start, preview=False, view=view_suffix)
file = bpy.path.abspath(file) # expand '//' file = bpy.path.abspath(file) # expand '//'
err_msg = tip_("File %r not found") % file err_msg = tip_("File %r not found") % file
if not os.path.exists(file): if not os.path.exists(file):