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/editors/space_outliner
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/editors/space_outliner')
-rw-r--r--source/blender/editors/space_outliner/outliner_collections.c8
-rw-r--r--source/blender/editors/space_outliner/outliner_dragdrop.c6
-rw-r--r--source/blender/editors/space_outliner/outliner_draw.c6
-rw-r--r--source/blender/editors/space_outliner/outliner_edit.c2
-rw-r--r--source/blender/editors/space_outliner/outliner_select.c18
-rw-r--r--source/blender/editors/space_outliner/outliner_tools.c26
6 files changed, 33 insertions, 33 deletions
diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c
index 251015e0f2d..6b4a7e10e63 100644
--- a/source/blender/editors/space_outliner/outliner_collections.c
+++ b/source/blender/editors/space_outliner/outliner_collections.c
@@ -204,7 +204,7 @@ static int collection_new_exec(bContext *C, wmOperator *op)
data.collection,
NULL);
- DEG_id_tag_update(&data.collection->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&data.collection->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
outliner_cleanup_tree(soops);
@@ -288,7 +288,7 @@ static int collection_delete_exec(bContext *C, wmOperator *op)
BLI_gset_free(data.collections_to_edit, NULL);
- DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
@@ -365,7 +365,7 @@ static int collection_objects_select_exec(bContext *C, wmOperator *op)
BKE_layer_collection_objects_select(view_layer, layer_collection, deselect);
Scene *scene = CTX_data_scene(C);
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
return OPERATOR_FINISHED;
@@ -505,7 +505,7 @@ static int collection_link_exec(bContext *C, wmOperator *UNUSED(op))
BLI_gset_free(data.collections_to_edit, NULL);
- DEG_id_tag_update(&active_collection->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&active_collection->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
WM_main_add_notifier(NC_SCENE | ND_LAYER, NULL);
diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c
index 2217048aca7..6dd12571448 100644
--- a/source/blender/editors/space_outliner/outliner_dragdrop.c
+++ b/source/blender/editors/space_outliner/outliner_dragdrop.c
@@ -588,7 +588,7 @@ static int scene_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent
DEG_relations_tag_update(bmain);
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_main_add_notifier(NC_SCENE | ND_OB_SELECT, scene);
return OPERATOR_FINISHED;
@@ -854,12 +854,12 @@ static int collection_drop_invoke(bContext *C, wmOperator *UNUSED(op), const wmE
}
if (from) {
- DEG_id_tag_update(&from->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&from->id, ID_RECALC_COPY_ON_WRITE);
}
}
/* Update dependency graph. */
- DEG_id_tag_update(&data.to->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&data.to->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
WM_event_add_notifier(C, NC_SCENE | ND_LAYER, scene);
diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c
index 722ed393492..6cf7e2ce0a1 100644
--- a/source/blender/editors/space_outliner/outliner_draw.c
+++ b/source/blender/editors/space_outliner/outliner_draw.c
@@ -292,7 +292,7 @@ static void hidebutton_base_flag_cb(bContext *C, void *poin, void *poin2)
view_layer->basact = base;
}
- DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -308,7 +308,7 @@ static void hidebutton_layer_collection_flag_cb(bContext *C, void *poin, void *p
BKE_layer_collection_set_visible(scene, view_layer, lc, extend);
- DEG_id_tag_update(&scene->id, DEG_TAG_BASE_FLAGS_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -339,7 +339,7 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
{
Object *ob = (Object *)tselem->id;
if (ob->type == OB_MBALL) {
- DEG_id_tag_update(&ob->id, DEG_TAG_GEOMETRY);
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
}
WM_event_add_notifier(C, NC_ID | NA_RENAME, NULL); break;
}
diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c
index 9d94947f61e..b5059cf6bb3 100644
--- a/source/blender/editors/space_outliner/outliner_edit.c
+++ b/source/blender/editors/space_outliner/outliner_edit.c
@@ -921,7 +921,7 @@ static int outliner_select_all_exec(bContext *C, wmOperator *op)
break;
}
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
ED_region_tag_redraw_no_rebuild(ar);
diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c
index efe27b5be89..d9e069f75c2 100644
--- a/source/blender/editors/space_outliner/outliner_select.c
+++ b/source/blender/editors/space_outliner/outliner_select.c
@@ -85,7 +85,7 @@ static void do_outliner_activate_obdata(bContext *C, Scene *scene, ViewLayer *vi
if (obact == NULL) {
ED_object_base_activate(C, base);
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
obact = base->object;
use_all = true;
@@ -109,7 +109,7 @@ static void do_outliner_activate_obdata(bContext *C, Scene *scene, ViewLayer *vi
}
if (ok) {
ED_object_base_select(base, (ob->mode & OB_MODE_EDIT) ? BA_SELECT : BA_DESELECT);
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
}
@@ -124,7 +124,7 @@ static void do_outliner_activate_pose(bContext *C, ViewLayer *view_layer, Base *
if (obact == NULL) {
ED_object_base_activate(C, base);
Scene *scene = CTX_data_scene(C);
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
obact = base->object;
use_all = true;
@@ -151,7 +151,7 @@ static void do_outliner_activate_pose(bContext *C, ViewLayer *view_layer, Base *
ED_object_base_select(base, (ob->mode & OB_MODE_POSE) ? BA_SELECT : BA_DESELECT);
Scene *scene = CTX_data_scene(C);
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_MODE | NS_MODE_OBJECT, NULL);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -318,7 +318,7 @@ static eOLDrawState tree_element_set_active_object(
if (set != OL_SETSEL_NONE) {
ED_object_base_activate(C, base); /* adds notifier */
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
@@ -376,7 +376,7 @@ static eOLDrawState tree_element_active_material(
/* Tagging object for update seems a bit stupid here, but looks like we have to do it
* for render views to update. See T42973.
* Note that RNA material update does it too, see e.g. rna_MaterialSlot_update(). */
- DEG_id_tag_update((ID *)ob, OB_RECALC_OB);
+ DEG_id_tag_update((ID *)ob, ID_RECALC_TRANSFORM);
WM_event_add_notifier(C, NC_MATERIAL | ND_SHADING_LINKS, NULL);
}
return OL_DRAWSEL_NONE;
@@ -462,7 +462,7 @@ static eOLDrawState tree_element_active_defgroup(
BLI_assert(te->index + 1 >= 0);
ob->actdef = te->index + 1;
- DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, ob);
}
else {
@@ -1020,7 +1020,7 @@ static void do_outliner_item_activate_tree_element(
FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
}
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
else if (OB_DATA_SUPPORT_EDITMODE(te->idcode)) {
@@ -1225,7 +1225,7 @@ static int outliner_box_select_exec(bContext *C, wmOperator *op)
outliner_item_box_select(scene, &rectf, te, select);
}
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
ED_region_tag_redraw(ar);
diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c
index a9212a99eb8..5806cf28fa8 100644
--- a/source/blender/editors/space_outliner/outliner_tools.c
+++ b/source/blender/editors/space_outliner/outliner_tools.c
@@ -230,14 +230,14 @@ static void unlink_collection_cb(
if (GS(tsep->id->name) == ID_OB) {
Object *ob = (Object *)tsep->id;
ob->dup_group = NULL;
- DEG_id_tag_update(&ob->id, OB_RECALC_OB);
+ DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM);
DEG_relations_tag_update(bmain);
}
else if (GS(tsep->id->name) == ID_GR) {
Collection *parent = (Collection *)tsep->id;
id_fake_user_set(&collection->id);
BKE_collection_child_remove(bmain, parent, collection);
- DEG_id_tag_update(&parent->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&parent->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
}
else if (GS(tsep->id->name) == ID_SCE) {
@@ -245,7 +245,7 @@ static void unlink_collection_cb(
Collection *parent = BKE_collection_master(scene);
id_fake_user_set(&collection->id);
BKE_collection_child_remove(bmain, parent, collection);
- DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
}
}
@@ -262,14 +262,14 @@ static void unlink_object_cb(
if (GS(tsep->id->name) == ID_GR) {
Collection *parent = (Collection *)tsep->id;
BKE_collection_object_remove(bmain, parent, ob, true);
- DEG_id_tag_update(&parent->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&parent->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
}
else if (GS(tsep->id->name) == ID_SCE) {
Scene *scene = (Scene *)tsep->id;
Collection *parent = BKE_collection_master(scene);
BKE_collection_object_remove(bmain, parent, ob, true);
- DEG_id_tag_update(&scene->id, DEG_TAG_COPY_ON_WRITE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_COPY_ON_WRITE);
DEG_relations_tag_update(bmain);
}
}
@@ -796,12 +796,12 @@ static void modifier_cb(int event, TreeElement *te, TreeStoreElem *UNUSED(tselem
if (event == OL_MODIFIER_OP_TOGVIS) {
md->mode ^= eModifierMode_Realtime;
- DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
}
else if (event == OL_MODIFIER_OP_TOGREN) {
md->mode ^= eModifierMode_Render;
- DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
+ DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY);
WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, ob);
}
else if (event == OL_MODIFIER_OP_DELETE) {
@@ -894,7 +894,7 @@ static void object_delete_hierarchy_cb(
#endif
}
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
}
@@ -953,7 +953,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
}
str = "Select Objects";
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
else if (event == OL_OP_SELECT_HIERARCHY) {
@@ -963,13 +963,13 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
WM_window_set_active_scene(bmain, C, win, sce);
}
str = "Select Object Hierarchy";
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
else if (event == OL_OP_DESELECT) {
outliner_do_object_operation(C, op->reports, scene, soops, &soops->tree, object_deselect_cb);
str = "Deselect Objects";
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene);
}
else if (event == OL_OP_DELETE) {
@@ -984,7 +984,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
DEG_relations_tag_update(bmain);
str = "Delete Objects";
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
}
else if (event == OL_OP_DELETE_HIERARCHY) {
@@ -995,7 +995,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op)
DEG_relations_tag_update(bmain);
str = "Delete Object Hierarchy";
- DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE);
+ DEG_id_tag_update(&scene->id, ID_RECALC_SELECT);
WM_event_add_notifier(C, NC_SCENE | ND_OB_ACTIVE, scene);
}
else if (event == OL_OP_REMAP) {