diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2022-05-24 15:57:30 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2022-05-24 15:57:30 +0300 |
commit | 10aa2fa9026067ad489197bcb43337d714c07cab (patch) | |
tree | 43055fce6621c11f53d635e0c3f71cc04ceaf018 /source/blender/editors/object | |
parent | f29ff7fb7e19d8e8dd5dd01ac527f0675467fbf2 (diff) |
Redraw Motion Paths panel after creating motion path
Add notifier such that the Motion Paths panel in the Object Properties tab
gets redrawn, after using the Create Motion Path button.
The reason it didn't update was that the button actually triggers a popup,
and then executes in the context of that popup. It now actually emits a
`ND_DRAW_ANIMVIZ` notifier, and ensures that the panel redraws on that.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_edit.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index ff25859b56b..c0637f4ac04 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1241,6 +1241,9 @@ static int object_calculate_paths_exec(bContext *C, wmOperator *op) ED_objects_recalculate_paths_selected(C, scene, OBJECT_PATH_CALC_RANGE_FULL); /* notifiers for updates */ + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL); + /* Note: the notifier below isn't actually correct, but kept around just to be on the safe side. + * If further testing shows it's not necessary (for both bones and objects) removal is fine. */ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM | ND_POSE, NULL); return OPERATOR_FINISHED; @@ -1310,6 +1313,9 @@ static int object_update_paths_exec(bContext *C, wmOperator *op) ED_objects_recalculate_paths_selected(C, scene, OBJECT_PATH_CALC_RANGE_FULL); /* notifiers for updates */ + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW_ANIMVIZ, NULL); + /* Note: the notifier below isn't actually correct, but kept around just to be on the safe side. + * If further testing shows it's not necessary (for both bones and objects) removal is fine. */ WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM | ND_POSE, NULL); return OPERATOR_FINISHED; |