Animation: Make Bake Animation operator use preview range when enabled

This patch makes the Bake Actions operator fills the Start Frame & End From with that of the Preview Range if "Use Preview Range" is enabled.

{F13973619}

Reviewed By: sybren

Differential Revision: https://developer.blender.org/D16630
This commit is contained in:
Colin Basnett 2022-11-28 08:04:02 -08:00 committed by Colin Basnett
parent 19bb30baf6
commit c47b6978e3
1 changed files with 6 additions and 2 deletions

View File

@ -282,8 +282,12 @@ class NLA_OT_bake(Operator):
def invoke(self, context, _event):
scene = context.scene
self.frame_start = scene.frame_start
self.frame_end = scene.frame_end
if scene.use_preview_range:
self.frame_start = scene.frame_preview_start
self.frame_end = scene.frame_preview_end
else:
self.frame_start = scene.frame_start
self.frame_end = scene.frame_end
self.bake_types = {'POSE'} if context.mode == 'POSE' else {'OBJECT'}
wm = context.window_manager