diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-08-26 06:53:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-08-26 06:53:15 +0300 |
commit | f464cac55a683387ae3511c76d08c8cca0a216c1 (patch) | |
tree | 0828728341aaafd0aa6d9e1c3a35ad22a0fffb86 /source/blender/editors/object | |
parent | 2fb57685e393e2d9e59fe9bde02358e28f3e57a3 (diff) |
Cleanup: redundant update calls adding objects
These update calls are already performed by
ED_object_add_type_with_obdata.
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 29 |
1 files changed, 4 insertions, 25 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 34400462d38..2e34284f46e 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -766,8 +766,6 @@ static int lightprobe_add_exec(bContext *C, wmOperator *op) BKE_lightprobe_type_set(probe, type); - DEG_relations_tag_update(CTX_data_main(C)); - return OPERATOR_FINISHED; } @@ -884,8 +882,6 @@ static int effector_add_exec(bContext *C, wmOperator *op) ob->pd = BKE_partdeflect_new(type); - DEG_relations_tag_update(CTX_data_main(C)); - return OPERATOR_FINISHED; } @@ -1015,8 +1011,10 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op) if (newob && !enter_editmode) { ED_object_editmode_exit_ex(bmain, scene, obedit, EM_FREEDATA); } - - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit); + else { + /* Only needed in edit-mode (#ED_object_add_type normally handles this). */ + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit); + } return OPERATOR_FINISHED; } @@ -1067,8 +1065,6 @@ static int object_add_text_exec(bContext *C, wmOperator *op) obedit = ED_object_add_type(C, OB_FONT, NULL, loc, rot, enter_editmode, local_view_bits); BKE_object_obdata_size_init(obedit, RNA_float_get(op->ptr, "radius")); - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit); - return OPERATOR_FINISHED; } @@ -1138,8 +1134,6 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) ED_object_editmode_exit_ex(bmain, scene, obedit, EM_FREEDATA); } - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, obedit); - return OPERATOR_FINISHED; } @@ -1670,7 +1664,6 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); /* Avoid dependency cycles. */ @@ -1686,12 +1679,6 @@ static int collection_instance_add_exec(bContext *C, wmOperator *op) ob->transflag |= OB_DUPLICOLLECTION; id_us_plus(&collection->id); - /* works without this except if you try render right after, see: 22027 */ - DEG_relations_tag_update(bmain); - 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; } @@ -1784,17 +1771,9 @@ static int object_data_instance_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } - Scene *scene = CTX_data_scene(C); - ED_object_add_type_with_obdata( C, object_type, id->name + 2, loc, rot, false, local_view_bits, id); - /* Works without this except if you try render right after, see: T22027. */ - DEG_relations_tag_update(bmain); - 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; } |