[Bf-blender-cvs] [0be6ca0] master: Fix T46465: Lag scrubbing w/ PlayAnim
Campbell Barton
noreply at git.blender.org
Thu Oct 15 08:32:39 CEST 2015
Commit: 0be6ca0b839ffc28d02b9e1bd50cdd81df3b6aeb
Author: Campbell Barton
Date: Thu Oct 15 17:25:43 2015 +1100
Branches: master
https://developer.blender.org/rB0be6ca0b839ffc28d02b9e1bd50cdd81df3b6aeb
Fix T46465: Lag scrubbing w/ PlayAnim
===================================================================
M source/blender/windowmanager/intern/wm_playanim.c
===================================================================
diff --git a/source/blender/windowmanager/intern/wm_playanim.c b/source/blender/windowmanager/intern/wm_playanim.c
index 27b4609..5e22314 100644
--- a/source/blender/windowmanager/intern/wm_playanim.c
+++ b/source/blender/windowmanager/intern/wm_playanim.c
@@ -973,6 +973,19 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr ps_void)
GHOST_TEventCursorData *cd = GHOST_GetEventData(evt);
int cx, cy;
+ /* Ignore 'in-between' events, since they can make scrubbing lag.
+ *
+ * Ideally we would keep into the event queue and see if this is the last motion event.
+ * however the API currently doesn't support this. */
+ {
+ int x_test, y_test;
+ GHOST_GetCursorPosition(g_WS.ghost_system, &x_test, &y_test);
+ if (x_test != cd->x || y_test != cd->y) {
+ /* we're not the last event... skipping */
+ break;
+ }
+ }
+
GHOST_ScreenToClient(g_WS.ghost_window, cd->x, cd->y, &cx, &cy);
change_frame(ps, cx);
More information about the Bf-blender-cvs
mailing list