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.
This commit is contained in:
parent
ce114a307d
commit
3765653b38
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -1507,8 +1507,10 @@ static void rna_Scene_editmesh_select_mode_update(bContext *C, PointerRNA *UNUSE
|
|||
me = NULL;
|
||||
}
|
||||
|
||||
WM_main_add_notifier(NC_GEOM | ND_SELECT, me);
|
||||
WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
if (me) {
|
||||
DEG_id_tag_update(&me->id, DEG_TAG_SELECT_UPDATE);
|
||||
WM_main_add_notifier(NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
static void object_simplify_update(Object *ob)
|
||||
|
|
Loading…
Reference in New Issue