Fix T79987: Crash when joining objects
Mistake inb077de086e
. I did the same fix for a few operators there, but missed the object "Join" one. The joining operator changes the layer content. So it must send a notifier for that. Beforeb077de086e
that didn't cause a noticeable issue, because the Outliner happened to listen to other notifiers (active/selection changes) the operator sent and fully rebuilt its tree in response. Now missing these notifiers can be more problematic, since we try to avoid more rebuilds. Added comments to the notifier types to avoid at least this pitfall.
This commit is contained in:
parent
70500121b4
commit
53d1f89322
Notes:
blender-bot
2023-02-14 01:57:12 +01:00
Referenced by issue #79987, Crash when joining objects
|
@ -435,6 +435,7 @@ int ED_armature_join_objects_exec(bContext *C, wmOperator *op)
|
|||
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
|
|
@ -6988,6 +6988,7 @@ int ED_curve_join_objects_exec(bContext *C, wmOperator *op)
|
|||
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
|
|
@ -2910,6 +2910,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
|
|||
DEG_relations_tag_update(bmain); /* because we removed object(s) */
|
||||
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
|
|
@ -741,6 +741,7 @@ int ED_mesh_join_objects_exec(bContext *C, wmOperator *op)
|
|||
|
||||
DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
|
||||
WM_event_add_notifier(C, NC_SCENE | ND_LAYER_CONTENT, scene);
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
|
|
@ -329,7 +329,10 @@ typedef struct wmNotifier {
|
|||
#define ND_RENDER_OPTIONS (4 << 16)
|
||||
#define ND_NODES (5 << 16)
|
||||
#define ND_SEQUENCER (6 << 16)
|
||||
/* Note: If an object was added, removed, merged/joined, ..., it is not enough to notify with
|
||||
* this. This affects the layer so also send a layer change notifier (e.g. ND_LAYER_CONTENT)! */
|
||||
#define ND_OB_ACTIVE (7 << 16)
|
||||
/* See comment on ND_OB_ACTIVE. */
|
||||
#define ND_OB_SELECT (8 << 16)
|
||||
#define ND_OB_VISIBLE (9 << 16)
|
||||
#define ND_OB_RENDER (10 << 16)
|
||||
|
|
Loading…
Reference in New Issue