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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-12-06 19:52:37 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-12-07 13:37:38 +0300
commit79312c1912b4fdb830e38a856cf88bfca8e4703d (patch)
tree74d5b262de9cd5d044e1963df13f2cbe73c3b796 /source/blender/blenkernel/intern/object.c
parent989fbff16f49204ca31a67f56f87c2221e0246f4 (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/blenkernel/intern/object.c')
-rw-r--r--source/blender/blenkernel/intern/object.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 694dae77bcd..b6946967764 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -517,7 +517,7 @@ void BKE_object_free_caches(Object *object)
psys = psys->next)
{
psys_free_path_cache(psys, psys->edit);
- update_flag |= PSYS_RECALC_REDO;
+ update_flag |= ID_RECALC_PSYS_REDO;
}
}
@@ -533,7 +533,7 @@ void BKE_object_free_caches(Object *object)
psmd->mesh_original = NULL;
}
psmd->flag |= eParticleSystemFlag_file_loaded;
- update_flag |= OB_RECALC_DATA;
+ update_flag |= ID_RECALC_GEOMETRY;
}
}
}
@@ -544,7 +544,7 @@ void BKE_object_free_caches(Object *object)
*/
if ((object->base_flag & BASE_FROMDUPLI) == 0) {
BKE_object_free_derived_caches(object);
- update_flag |= OB_RECALC_DATA;
+ update_flag |= ID_RECALC_GEOMETRY;
}
/* Tag object for update, so once memory critical operation is over and
@@ -904,7 +904,7 @@ static Object *object_add_common(Main *bmain, ViewLayer *view_layer, int type, c
ob->data = BKE_object_obdata_add_from_type(bmain, type, name);
BKE_view_layer_base_deselect_all(view_layer);
- DEG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+ DEG_id_tag_update_ex(bmain, &ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
return ob;
}
@@ -978,7 +978,7 @@ Object *BKE_object_add_for_data(
if (do_id_user) id_us_plus(data);
BKE_view_layer_base_deselect_all(view_layer);
- DEG_id_tag_update_ex(bmain, &ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+ DEG_id_tag_update_ex(bmain, &ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
layer_collection = BKE_layer_collection_get_active(view_layer);
BKE_collection_object_add(bmain, layer_collection->collection, ob);
@@ -1567,8 +1567,8 @@ void BKE_object_make_proxy(Main *bmain, Object *ob, Object *target, Object *cob)
ob->proxy_group = cob;
id_lib_extern(&target->id);
- DEG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
- DEG_id_tag_update(&target->id, OB_RECALC_OB | OB_RECALC_DATA | OB_RECALC_TIME);
+ DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
+ DEG_id_tag_update(&target->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
/* copy transform
* - cob means this proxy comes from a collection, just apply the matrix
@@ -2856,7 +2856,7 @@ void BKE_object_handle_update_ex(Depsgraph *depsgraph,
const bool do_proxy_update)
{
const ID *object_data = ob->data;
- const bool recalc_object = (ob->id.recalc & ID_RECALC) != 0;
+ const bool recalc_object = (ob->id.recalc & ID_RECALC_ALL) != 0;
const bool recalc_data =
(object_data != NULL) ? ((object_data->recalc & ID_RECALC_ALL) != 0)
: 0;
@@ -2883,9 +2883,9 @@ void BKE_object_handle_update_ex(Depsgraph *depsgraph,
}
}
}
- /* XXX new animsys warning: depsgraph tag OB_RECALC_DATA should not skip drivers,
+ /* XXX new animsys warning: depsgraph tag ID_RECALC_GEOMETRY should not skip drivers,
* which is only in BKE_object_where_is_calc now */
- /* XXX: should this case be OB_RECALC_OB instead? */
+ /* XXX: should this case be ID_RECALC_TRANSFORM instead? */
if (recalc_object || recalc_data) {
if (G.debug & G_DEBUG_DEPSGRAPH_EVAL) {
printf("recalcob %s\n", ob->id.name + 2);
@@ -3695,7 +3695,7 @@ void BKE_object_groups_clear(Main *bmain, Object *ob)
Collection *collection = NULL;
while ((collection = BKE_collection_object_find(bmain, collection, ob))) {
BKE_collection_object_remove(bmain, collection, ob, false);
- DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&collection->id, ID_RECALC_COPY_ON_WRITE);
}
}
@@ -4016,7 +4016,7 @@ bool BKE_object_modifier_update_subframe(
}
}
- /* was originally OB_RECALC_ALL - TODO - which flags are really needed??? */
+ /* was originally ID_RECALC_ALL - TODO - which flags are really needed??? */
/* TODO(sergey): What about animation? */
ob->id.recalc |= ID_RECALC_ALL;
BKE_animsys_evaluate_animdata(depsgraph, scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM);