Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGermano <germano.costa@ig.com.br>2018-04-13 16:41:44 +0300
committerGermano <germano.costa@ig.com.br>2018-04-13 16:41:44 +0300
commit3765653b38f82c1190127f06c868e34c2d017232 (patch)
treef1dac5004469f2425b545993e6528dc7e7c65521 /source/blender/editors
parentce114a307d522916af75814749751de660fa958c (diff)
RNA: Fix crash with select_mode_update.
`bpy.context.tool_settings.mesh_select_mode = (True, True, True)` was crashing because `wmn->window` was not being passed.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index abfbccdcc27..9fb602c81d6 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -911,11 +911,15 @@ static void view3d_main_region_listener(
{
WM_manipulatormap_tag_refresh(mmap);
- ViewLayer *view_layer = WM_window_get_active_view_layer(wmn->window);
- Object *obedit = OBEDIT_FROM_VIEW_LAYER(view_layer);
- if (obedit) {
+ ID *ob_data = wmn->reference;
+ if (ob_data == NULL) {
+ BLI_assert(wmn->window); // Use `WM_event_add_notifier` instead of `WM_main_add_notifier`
+ ViewLayer *view_layer = WM_window_get_active_view_layer(wmn->window);
+ ob_data = OBEDIT_FROM_VIEW_LAYER(view_layer)->data;
+ }
+ if (ob_data) {
/* TODO(sergey): Notifiers shouldn't really be doing DEG tags. */
- DEG_id_tag_update((ID *)obedit->data, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(ob_data, DEG_TAG_SELECT_UPDATE);
}
ATTR_FALLTHROUGH;
}