From 8a1cb690058b476b427ef55eb0770bdaf0d8acb7 Mon Sep 17 00:00:00 2001 From: Bazza Date: Sat, 3 Feb 2024 23:39:22 -0300 Subject: [PATCH] Update op_playback.py Problem with frames float --- operators/op_playback.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/operators/op_playback.py b/operators/op_playback.py index 539de0c..9163a2a 100644 --- a/operators/op_playback.py +++ b/operators/op_playback.py @@ -129,8 +129,8 @@ def add_driver_to_node(node): obj[datapath_playhead] = float(self.playback_reversed ^ pingpong) obj.keyframe_insert(f'["{datapath_playhead}"]') # Set end frame - bpy.context.scene.frame_current += max(1, round( (frame_duration-1.0) / self.playback_rate) ) - obj[datapath_playhead] = 1.0 - float(self.playback_reversed ^ pingpong) + bpy.context.scene.frame_current += round(max(1, round( (frame_duration)-1.0) / self.playback_rate) )) + ) obj[datapath_playhead] = 1.0 - float(self.playback_reversed ^ pingpong) obj.keyframe_insert(f'["{datapath_playhead}"]') bpy.context.scene.frame_current += 1 @@ -154,4 +154,4 @@ def add_driver_to_node(node): if expected_name in target_node_tree.nodes: add_driver_to_node(target_node_tree.nodes[expected_name]) - return {'FINISHED'} \ No newline at end of file + return {'FINISHED'}