From 39e1518d413a1af35b39a695b6a2e2d69fd2d35b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 31 Jul 2017 14:35:10 +1000 Subject: Fix glitch updating manipulator after undo Running undo would notify manipulators to refresh, but this still allowed for events in the queue to be handled, where manipulators could be drawn for selection before their refresh callback runs. This made Python manipulators raise exceptions about referencing invalid data (or crash). Now tag manipulator update on file load (including undo) and ensure the refresh callback runs before drawing manipulator selection. Also split manipulator map refresh flag in two since selection doesn't perform the same operations as regular drawing. --- source/blender/blenkernel/intern/blendfile.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenkernel/intern/blendfile.c') diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index 4de2433a89a..09760fcc4cb 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -218,6 +218,13 @@ static void setup_app_data( BKE_screen_view3d_scene_sync(curscreen, curscene); } } + + /* We need to tag this here because events may be handled immediately after. + * only the current screen is important because we wont have to handle + * events from multiple screens at once.*/ + { + BKE_screen_manipulator_tag_refresh(curscreen); + } } /* free G.main Main database */ -- cgit v1.2.3