diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-06 19:52:37 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-12-07 13:37:38 +0300 |
commit | 79312c1912b4fdb830e38a856cf88bfca8e4703d (patch) | |
tree | 74d5b262de9cd5d044e1963df13f2cbe73c3b796 /source/blender/editors/object/object_transform.c | |
parent | 989fbff16f49204ca31a67f56f87c2221e0246f4 (diff) |
Depsgraph: Remove duplicated sets of recalc/update flags
There were at least three copies of those:
- OB_RECALC* family of flags, which are rudiment of an old
dependency graph system.
- PSYS_RECALC* which were used by old dependency graph system
as a separate set since the graph itself did not handle
particle systems.
- DEG_TAG_* which was used to tag IDs.
Now there is a single set, which defines what can be tagged
and queried for an update. It also has some aggregate flags
to make queries simpler.
Lets once and for all solve the madness of those flags, stick
to a single set, which will not overlap with anything or require
any extra conversion.
Technically, shouldn't be measurable user difference, but some
of the agregate flags for few dependency graph components did
change.
Fixes T58632: Particle don't update rotation settings
Diffstat (limited to 'source/blender/editors/object/object_transform.c')
-rw-r--r-- | source/blender/editors/object/object_transform.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index e2574cf3813..5c0bd51bcca 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -273,7 +273,7 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op, ED_autokeyframe_object(C, scene, ob, ks); /* tag for updates */ - DEG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); } } CTX_DATA_END; @@ -379,7 +379,7 @@ static int object_origin_clear_exec(bContext *C, wmOperator *UNUSED(op)) mul_m3_v3(mat, v3); } - DEG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); } CTX_DATA_END; @@ -699,7 +699,7 @@ static int apply_objects_internal( ignore_parent_tx(C, bmain, scene, ob); - DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); changed = true; } @@ -727,7 +727,7 @@ static int visual_transform_apply_exec(bContext *C, wmOperator *UNUSED(op)) BKE_object_where_is_calc(depsgraph, scene, ob); /* update for any children that may get moved */ - DEG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); changed = true; } @@ -872,7 +872,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) EDBM_mesh_normals_update(em); tot_change++; - DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, ID_RECALC_GEOMETRY); } } @@ -997,7 +997,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (obedit) { if (centermode == GEOMETRY_TO_ORIGIN) { - DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, ID_RECALC_GEOMETRY); } break; } @@ -1075,7 +1075,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (obedit) { if (centermode == GEOMETRY_TO_ORIGIN) { - DEG_id_tag_update(&obedit->id, OB_RECALC_DATA); + DEG_id_tag_update(&obedit->id, ID_RECALC_GEOMETRY); } break; } @@ -1143,7 +1143,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) } } } - DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); tot_change++; if (centermode == ORIGIN_TO_GEOMETRY) { @@ -1196,7 +1196,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) (ob->transflag | ob_other->transflag) & OB_DUPLICOLLECTION))) { ob_other->flag |= OB_DONE; - DEG_id_tag_update(&ob_other->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&ob_other->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); mul_v3_mat3_m4v3(centn, ob_other->obmat, cent); /* omit translation part */ add_v3_v3(ob_other->loc, centn); @@ -1217,7 +1217,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) for (tob = bmain->object.first; tob; tob = tob->id.next) { if (tob->data && (((ID *)tob->data)->tag & LIB_TAG_DOIT)) { BKE_object_batch_cache_dirty_tag(tob); - DEG_id_tag_update(&tob->id, OB_RECALC_OB | OB_RECALC_DATA); + DEG_id_tag_update(&tob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); } } @@ -1389,7 +1389,7 @@ static void object_orient_to_location( object_apply_rotation(ob, final_rot); - DEG_id_tag_update(&ob->id, OB_RECALC_OB); + DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM); } } } @@ -1400,7 +1400,7 @@ static void object_transform_axis_target_cancel(bContext *C, wmOperator *op) struct XFormAxisItem *item = xfd->object_data; for (int i = 0; i < xfd->object_data_len; i++, item++) { BKE_object_tfm_restore(item->ob, item->obtfm); - DEG_id_tag_update(&item->ob->id, OB_RECALC_OB); + DEG_id_tag_update(&item->ob->id, ID_RECALC_TRANSFORM); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item->ob); } |