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:
authorBastien Montagne <montagne29@wanadoo.fr>2015-12-27 13:53:50 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-12-27 14:00:33 +0300
commit3fcf535d2e003ad939fa1f1c7aa4d5da1b38aef7 (patch)
tree0cc5b044cdc1f7b6fa58ad1d0c3c6cafc51a7759 /source/blender/blenkernel
parentec2ca11cba496294838bfb5fb76f7bfcef2fe8cc (diff)
Split id->flag in two, persistent flags and runtime tags.
This is purely internal sanitizing/cleanup, no change in behavior is expected at all. This change was also needed because we were getting short on ID flags, and future enhancement of 'user_one' ID behavior requires two new ones. id->flag remains for persistent data (fakeuser only, so far!), this also allows us 100% backward & forward compatibility. New id->tag is used for most flags. Though written in .blend files, its content is cleared at read time. Note that .blend file version was bumped, so that we can clear runtimeflags from old .blends, important in case we add new persistent flags in future. Also, behavior of tags (either status ones, or whether they need to be cleared before/after use) has been added as comments to their declaration. Reviewers: sergey, campbellbarton Differential Revision: https://developer.blender.org/D1683
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_blender.h2
-rw-r--r--source/blender/blenkernel/BKE_library.h6
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c8
-rw-r--r--source/blender/blenkernel/intern/blender.c18
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c68
-rw-r--r--source/blender/blenkernel/intern/group.c6
-rw-r--r--source/blender/blenkernel/intern/image.c6
-rw-r--r--source/blender/blenkernel/intern/lamp.c8
-rw-r--r--source/blender/blenkernel/intern/library.c57
-rw-r--r--source/blender/blenkernel/intern/mask.c4
-rw-r--r--source/blender/blenkernel/intern/material.c8
-rw-r--r--source/blender/blenkernel/intern/object.c8
-rw-r--r--source/blender/blenkernel/intern/object_dupli.c2
-rw-r--r--source/blender/blenkernel/intern/scene.c8
-rw-r--r--source/blender/blenkernel/intern/sequencer.c6
15 files changed, 111 insertions, 104 deletions
diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 6886740c1af..9efaad81feb 100644
--- a/source/blender/blenkernel/BKE_blender.h
+++ b/source/blender/blenkernel/BKE_blender.h
@@ -42,7 +42,7 @@ extern "C" {
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 276
-#define BLENDER_SUBVERSION 4
+#define BLENDER_SUBVERSION 5
/* Several breakages with 270, e.g. constraint deg vs rad */
#define BLENDER_MINVERSION 270
#define BLENDER_MINSUBVERSION 5
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index 9a961bafbf9..ff0cad2e5ed 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -102,8 +102,8 @@ void BKE_main_id_tag_idcode(struct Main *mainvar, const short type, const bool t
void BKE_main_id_tag_listbase(struct ListBase *lb, const bool tag);
void BKE_main_id_tag_all(struct Main *mainvar, const bool tag);
-void BKE_main_id_flag_listbase(ListBase *lb, const short flag, const bool value);
-void BKE_main_id_flag_all(struct Main *bmain, const short flag, const bool value);
+void BKE_main_id_flag_listbase(ListBase *lb, const int flag, const bool value);
+void BKE_main_id_flag_all(struct Main *bmain, const int flag, const bool value);
void BKE_main_id_clear_newpoins(struct Main *bmain);
@@ -129,7 +129,7 @@ void BKE_library_callback_free_editor_id_reference_set(BKE_library_free_editor_i
/* use when "" is given to new_id() */
#define ID_FALLBACK_NAME N_("Untitled")
-#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))
+#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT))
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 2ddf01433eb..41950c59a22 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -1596,8 +1596,8 @@ static bool animsys_write_rna_setting(PointerRNA *ptr, char *path, int array_ind
/* for cases like duplifarmes it's only a temporary so don't
* notify anyone of updates */
- if (!(id->flag & LIB_ANIM_NO_RECALC)) {
- id->flag |= LIB_ID_RECALC;
+ if (!(id->tag & LIB_TAG_ANIM_NO_RECALC)) {
+ id->tag |= LIB_TAG_ID_RECALC;
DAG_id_type_tag(G.main, GS(id->name));
}
}
@@ -2562,8 +2562,8 @@ static void animsys_evaluate_nla(ListBase *echannels, PointerRNA *ptr, AnimData
*/
if (ptr->id.data != NULL) {
ID *id = ptr->id.data;
- if (!(id->flag & LIB_ANIM_NO_RECALC)) {
- id->flag |= LIB_ID_RECALC;
+ if (!(id->tag & LIB_TAG_ANIM_NO_RECALC)) {
+ id->tag |= LIB_TAG_ID_RECALC;
DAG_id_type_tag(G.main, GS(id->name));
}
}
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index fc76c298802..8b447379d01 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -963,12 +963,12 @@ Main *BKE_undo_get_main(Scene **r_scene)
void BKE_copybuffer_begin(Main *bmain)
{
/* set all id flags to zero; */
- BKE_main_id_flag_all(bmain, LIB_NEED_EXPAND | LIB_DOIT, false);
+ BKE_main_id_flag_all(bmain, LIB_TAG_NEED_EXPAND | LIB_TAG_DOIT, false);
}
void BKE_copybuffer_tag_ID(ID *id)
{
- id->flag |= LIB_NEED_EXPAND | LIB_DOIT;
+ id->tag |= LIB_TAG_NEED_EXPAND | LIB_TAG_DOIT;
}
static void copybuffer_doit(void *UNUSED(handle), Main *UNUSED(bmain), void *vid)
@@ -976,8 +976,8 @@ static void copybuffer_doit(void *UNUSED(handle), Main *UNUSED(bmain), void *vid
if (vid) {
ID *id = vid;
/* only tag for need-expand if not done, prevents eternal loops */
- if ((id->flag & LIB_DOIT) == 0)
- id->flag |= LIB_NEED_EXPAND | LIB_DOIT;
+ if ((id->tag & LIB_TAG_DOIT) == 0)
+ id->tag |= LIB_TAG_NEED_EXPAND | LIB_TAG_DOIT;
}
}
@@ -1006,7 +1006,7 @@ int BKE_copybuffer_save(const char *filename, ReportList *reports)
for (id = lb2->first; id; id = nextid) {
nextid = id->next;
- if (id->flag & LIB_DOIT) {
+ if (id->tag & LIB_TAG_DOIT) {
BLI_remlink(lb2, id);
BLI_addtail(lb1, id);
}
@@ -1033,7 +1033,7 @@ int BKE_copybuffer_save(const char *filename, ReportList *reports)
MEM_freeN(mainb);
/* set id flag to zero; */
- BKE_main_id_flag_all(G.main, LIB_NEED_EXPAND | LIB_DOIT, false);
+ BKE_main_id_flag_all(G.main, LIB_TAG_NEED_EXPAND | LIB_TAG_DOIT, false);
if (path_list_backup) {
BKE_bpath_list_restore(G.main, path_list_flag, path_list_backup);
@@ -1064,8 +1064,8 @@ int BKE_copybuffer_paste(bContext *C, const char *libname, ReportList *reports)
/* tag everything, all untagged data can be made local
* its also generally useful to know what is new
*
- * take extra care BKE_main_id_flag_all(bmain, LIB_LINK_TAG, false) is called after! */
- BKE_main_id_flag_all(bmain, LIB_PRE_EXISTING, true);
+ * take extra care BKE_main_id_flag_all(bmain, LIB_TAG_PRE_EXISTING, false) is called after! */
+ BKE_main_id_flag_all(bmain, LIB_TAG_PRE_EXISTING, true);
/* here appending/linking starts */
mainl = BLO_library_link_begin(bmain, &bh, libname);
@@ -1084,7 +1084,7 @@ int BKE_copybuffer_paste(bContext *C, const char *libname, ReportList *reports)
/* important we unset, otherwise these object wont
* link into other scenes from this blend file */
- BKE_main_id_flag_all(bmain, LIB_PRE_EXISTING, false);
+ BKE_main_id_flag_all(bmain, LIB_TAG_PRE_EXISTING, false);
/* recreate dependency graph to include new objects */
DAG_relations_tag_update(bmain);
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 17faae053eb..e313ad7c2a1 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -398,13 +398,13 @@ static void dag_add_shader_nodetree_driver_relations(DagForest *dag, DagNode *no
static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Material *ma)
{
/* Prevent infinite recursion by checking (and tagging the material) as having been visited
- * already (see build_dag()). This assumes ma->id.flag & LIB_DOIT isn't set by anything else
+ * already (see build_dag()). This assumes ma->id.tag & LIB_TAG_DOIT isn't set by anything else
* in the meantime... [#32017]
*/
- if (ma->id.flag & LIB_DOIT)
+ if (ma->id.tag & LIB_TAG_DOIT)
return;
- ma->id.flag |= LIB_DOIT;
+ ma->id.tag |= LIB_TAG_DOIT;
/* material itself */
if (ma->adt)
@@ -418,20 +418,20 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
if (ma->nodetree)
dag_add_shader_nodetree_driver_relations(dag, node, ma->nodetree);
- ma->id.flag &= ~LIB_DOIT;
+ ma->id.tag &= ~LIB_TAG_DOIT;
}
/* recursive handling for lamp drivers */
static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *la)
{
/* Prevent infinite recursion by checking (and tagging the lamp) as having been visited
- * already (see build_dag()). This assumes la->id.flag & LIB_DOIT isn't set by anything else
+ * already (see build_dag()). This assumes la->id.tag & LIB_TAG_DOIT isn't set by anything else
* in the meantime... [#32017]
*/
- if (la->id.flag & LIB_DOIT)
+ if (la->id.tag & LIB_TAG_DOIT)
return;
- la->id.flag |= LIB_DOIT;
+ la->id.tag |= LIB_TAG_DOIT;
/* lamp itself */
if (la->adt)
@@ -445,7 +445,7 @@ static void dag_add_lamp_driver_relations(DagForest *dag, DagNode *node, Lamp *l
if (la->nodetree)
dag_add_shader_nodetree_driver_relations(dag, node, la->nodetree);
- la->id.flag &= ~LIB_DOIT;
+ la->id.tag &= ~LIB_TAG_DOIT;
}
static void check_and_create_collision_relation(DagForest *dag, Object *ob, DagNode *node, Object *ob1, int skip_forcefield, bool no_collision)
@@ -903,10 +903,10 @@ static void build_dag_group(DagForest *dag, DagNode *scenenode, Main *bmain, Sce
{
GroupObject *go;
- if (group->id.flag & LIB_DOIT)
+ if (group->id.tag & LIB_TAG_DOIT)
return;
- group->id.flag |= LIB_DOIT;
+ group->id.tag |= LIB_TAG_DOIT;
for (go = group->gobject.first; go; go = go->next) {
build_dag_object(dag, scenenode, bmain, scene, go->ob, mask);
@@ -932,7 +932,7 @@ DagForest *build_dag(Main *bmain, Scene *sce, short mask)
sce->theDag = dag;
}
- /* clear "LIB_DOIT" flag from all materials, to prevent infinite recursion problems later [#32017] */
+ /* clear "LIB_TAG_DOIT" flag from all materials, to prevent infinite recursion problems later [#32017] */
BKE_main_id_tag_idcode(bmain, ID_MA, false);
BKE_main_id_tag_idcode(bmain, ID_LA, false);
BKE_main_id_tag_idcode(bmain, ID_GR, false);
@@ -1402,15 +1402,15 @@ static void scene_sort_groups(Main *bmain, Scene *sce)
/* test; are group objects all in this scene? */
for (ob = bmain->object.first; ob; ob = ob->id.next) {
- ob->id.flag &= ~LIB_DOIT;
+ ob->id.tag &= ~LIB_TAG_DOIT;
ob->id.newid = NULL; /* newid abuse for GroupObject */
}
for (base = sce->base.first; base; base = base->next)
- base->object->id.flag |= LIB_DOIT;
+ base->object->id.tag |= LIB_TAG_DOIT;
for (group = bmain->group.first; group; group = group->id.next) {
for (go = group->gobject.first; go; go = go->next) {
- if ((go->ob->id.flag & LIB_DOIT) == 0)
+ if ((go->ob->id.tag & LIB_TAG_DOIT) == 0)
break;
}
/* this group is entirely in this scene */
@@ -1481,7 +1481,7 @@ static bool check_object_tagged_for_update(Object *object)
if (ELEM(object->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
ID *data_id = object->data;
- return (data_id->flag & (LIB_ID_RECALC_DATA | LIB_ID_RECALC)) != 0;
+ return (data_id->tag & (LIB_TAG_ID_RECALC_DATA | LIB_TAG_ID_RECALC)) != 0;
}
return false;
@@ -1729,13 +1729,13 @@ void DAG_scene_free(Scene *sce)
static void lib_id_recalc_tag(Main *bmain, ID *id)
{
- id->flag |= LIB_ID_RECALC;
+ id->tag |= LIB_TAG_ID_RECALC;
DAG_id_type_tag(bmain, GS(id->name));
}
static void lib_id_recalc_data_tag(Main *bmain, ID *id)
{
- id->flag |= LIB_ID_RECALC_DATA;
+ id->tag |= LIB_TAG_ID_RECALC_DATA;
DAG_id_type_tag(bmain, GS(id->name));
}
@@ -2262,10 +2262,10 @@ static void dag_group_update_flags(Main *bmain, Scene *scene, Group *group, cons
{
GroupObject *go;
- if (group->id.flag & LIB_DOIT)
+ if (group->id.tag & LIB_TAG_DOIT)
return;
- group->id.flag |= LIB_DOIT;
+ group->id.tag |= LIB_TAG_DOIT;
for (go = group->gobject.first; go; go = go->next) {
if (do_time)
@@ -2301,7 +2301,7 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const b
dag_object_time_update_flags(bmain, sce_iter, ob);
}
- /* recursively tag groups with LIB_DOIT, and update flags for objects */
+ /* recursively tag groups with LIB_TAG_DOIT, and update flags for objects */
if (ob->dup_group)
dag_group_update_flags(bmain, scene, ob->dup_group, do_time);
}
@@ -2324,12 +2324,12 @@ void DAG_scene_update_flags(Main *bmain, Scene *scene, unsigned int lay, const b
/* and store the info in groupobject */
for (group = bmain->group.first; group; group = group->id.next) {
- if (group->id.flag & LIB_DOIT) {
+ if (group->id.tag & LIB_TAG_DOIT) {
for (go = group->gobject.first; go; go = go->next) {
go->recalc = go->ob->recalc;
// printf("ob %s recalc %d\n", go->ob->id.name, go->recalc);
}
- group->id.flag &= ~LIB_DOIT;
+ group->id.tag &= ~LIB_TAG_DOIT;
}
}
@@ -2356,14 +2356,14 @@ static void dag_current_scene_layers(Main *bmain, ListBase *lb)
/* if we have a windowmanager, look into windows */
if ((wm = bmain->wm.first)) {
- BKE_main_id_flag_listbase(&bmain->scene, LIB_DOIT, 1);
+ BKE_main_id_flag_listbase(&bmain->scene, LIB_TAG_DOIT, 1);
for (win = wm->windows.first; win; win = win->next) {
if (win->screen && win->screen->scene->theDag) {
Scene *scene = win->screen->scene;
DagSceneLayer *dsl;
- if (scene->id.flag & LIB_DOIT) {
+ if (scene->id.tag & LIB_TAG_DOIT) {
dsl = MEM_mallocN(sizeof(DagSceneLayer), "dag scene layer");
BLI_addtail(lb, dsl);
@@ -2371,7 +2371,7 @@ static void dag_current_scene_layers(Main *bmain, ListBase *lb)
dsl->scene = scene;
dsl->layer = BKE_screen_visible_layers(win->screen, scene);
- scene->id.flag &= ~LIB_DOIT;
+ scene->id.tag &= ~LIB_TAG_DOIT;
}
else {
/* It is possible that multiple windows shares the same scene
@@ -2413,20 +2413,20 @@ static void dag_group_on_visible_update(Scene *scene, Group *group)
{
GroupObject *go;
- if (group->id.flag & LIB_DOIT)
+ if (group->id.tag & LIB_TAG_DOIT)
return;
- group->id.flag |= LIB_DOIT;
+ group->id.tag |= LIB_TAG_DOIT;
for (go = group->gobject.first; go; go = go->next) {
if (ELEM(go->ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_MBALL, OB_LATTICE)) {
go->ob->recalc |= OB_RECALC_DATA;
- go->ob->id.flag |= LIB_DOIT;
+ go->ob->id.tag |= LIB_TAG_DOIT;
lib_id_recalc_tag(G.main, &go->ob->id);
}
if (go->ob->proxy_from) {
go->ob->recalc |= OB_RECALC_OB;
- go->ob->id.flag |= LIB_DOIT;
+ go->ob->id.tag |= LIB_TAG_DOIT;
lib_id_recalc_tag(G.main, &go->ob->id);
}
@@ -2749,7 +2749,7 @@ void DAG_ids_flush_tagged(Main *bmain)
* looping over all ID's in case there are no tags */
if (id && bmain->id_tag_update[id->name[0]]) {
for (; id; id = id->next) {
- if (id->flag & (LIB_ID_RECALC | LIB_ID_RECALC_DATA)) {
+ if (id->tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA)) {
for (dsl = listbase.first; dsl; dsl = dsl->next)
dag_id_flush_update(bmain, dsl->scene, id);
@@ -2874,13 +2874,13 @@ void DAG_ids_clear_recalc(Main *bmain)
* looping over all ID's in case there are no tags */
if (id && bmain->id_tag_update[id->name[0]]) {
for (; id; id = id->next) {
- if (id->flag & (LIB_ID_RECALC | LIB_ID_RECALC_DATA))
- id->flag &= ~(LIB_ID_RECALC | LIB_ID_RECALC_DATA);
+ if (id->tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA))
+ id->tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
/* some ID's contain semi-datablock nodetree */
ntree = ntreeFromID(id);
- if (ntree && (ntree->id.flag & (LIB_ID_RECALC | LIB_ID_RECALC_DATA)))
- ntree->id.flag &= ~(LIB_ID_RECALC | LIB_ID_RECALC_DATA);
+ if (ntree && (ntree->id.tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA)))
+ ntree->id.tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
}
}
}
diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c
index 96cf0fe574a..4506f932413 100644
--- a/source/blender/blenkernel/intern/group.c
+++ b/source/blender/blenkernel/intern/group.c
@@ -232,12 +232,12 @@ static bool group_object_cyclic_check_internal(Object *object, Group *group)
{
if (object->dup_group) {
Group *dup_group = object->dup_group;
- if ((dup_group->id.flag & LIB_DOIT) == 0) {
+ if ((dup_group->id.tag & LIB_TAG_DOIT) == 0) {
/* Cycle already exists in groups, let's prevent further crappyness */
return true;
}
/* flag the object to identify cyclic dependencies in further dupli groups */
- dup_group->id.flag &= ~LIB_DOIT;
+ dup_group->id.tag &= ~LIB_TAG_DOIT;
if (dup_group == group)
return true;
@@ -251,7 +251,7 @@ static bool group_object_cyclic_check_internal(Object *object, Group *group)
}
/* un-flag the object, it's allowed to have the same group multiple times in parallel */
- dup_group->id.flag |= LIB_DOIT;
+ dup_group->id.tag |= LIB_TAG_DOIT;
}
return false;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 21d8f8dde67..394237f6c14 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1136,14 +1136,14 @@ void BKE_image_free_all_textures(void)
#endif
for (ima = G.main->image.first; ima; ima = ima->id.next)
- ima->id.flag &= ~LIB_DOIT;
+ ima->id.tag &= ~LIB_TAG_DOIT;
for (tex = G.main->tex.first; tex; tex = tex->id.next)
if (tex->ima)
- tex->ima->id.flag |= LIB_DOIT;
+ tex->ima->id.tag |= LIB_TAG_DOIT;
for (ima = G.main->image.first; ima; ima = ima->id.next) {
- if (ima->cache && (ima->id.flag & LIB_DOIT)) {
+ if (ima->cache && (ima->id.tag & LIB_TAG_DOIT)) {
#ifdef CHECK_FREED_SIZE
uintptr_t old_size = image_mem_size(ima);
#endif
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c
index 7fcbd9cafb7..9601a93b1f1 100644
--- a/source/blender/blenkernel/intern/lamp.c
+++ b/source/blender/blenkernel/intern/lamp.c
@@ -265,12 +265,12 @@ static void lamp_node_drivers_update(Scene *scene, bNodeTree *ntree, float ctime
void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
{
/* Prevent infinite recursion by checking (and tagging the lamp) as having been visited already
- * (see BKE_scene_update_tagged()). This assumes la->id.flag & LIB_DOIT isn't set by anything else
+ * (see BKE_scene_update_tagged()). This assumes la->id.tag & LIB_TAG_DOIT isn't set by anything else
* in the meantime... [#32017] */
- if (la->id.flag & LIB_DOIT)
+ if (la->id.tag & LIB_TAG_DOIT)
return;
- la->id.flag |= LIB_DOIT;
+ la->id.tag |= LIB_TAG_DOIT;
/* lamp itself */
if (la->adt && la->adt->drivers.first)
@@ -280,6 +280,6 @@ void lamp_drivers_update(Scene *scene, Lamp *la, float ctime)
if (la->nodetree)
lamp_node_drivers_update(scene, la->nodetree, ctime);
- la->id.flag &= ~LIB_DOIT;
+ la->id.tag &= ~LIB_TAG_DOIT;
}
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index f1e0bc69dbc..14e21a8b014 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -154,9 +154,9 @@ void id_lib_extern(ID *id)
{
if (id) {
BLI_assert(BKE_idcode_is_linkable(GS(id->name)));
- if (id->flag & LIB_INDIRECT) {
- id->flag -= LIB_INDIRECT;
- id->flag |= LIB_EXTERN;
+ if (id->tag & LIB_TAG_INDIRECT) {
+ id->tag -= LIB_TAG_INDIRECT;
+ id->tag |= LIB_TAG_EXTERN;
}
}
}
@@ -223,7 +223,7 @@ void id_fake_user_clear(ID *id)
* if the block can be made local. */
bool id_make_local(ID *id, bool test)
{
- if (id->flag & LIB_INDIRECT)
+ if (id->tag & LIB_TAG_INDIRECT)
return false;
switch (GS(id->name)) {
@@ -549,21 +549,27 @@ ListBase *which_libbase(Main *mainlib, short type)
return NULL;
}
-/* Flag all ids in listbase */
-void BKE_main_id_flag_listbase(ListBase *lb, const short flag, const bool value)
+/**
+ * Clear or set given flags for all ids in listbase (runtime flags only).
+ */
+void BKE_main_id_flag_listbase(ListBase *lb, const int flag, const bool value)
{
ID *id;
if (value) {
- for (id = lb->first; id; id = id->next) id->flag |= flag;
+ for (id = lb->first; id; id = id->next)
+ id->tag |= flag;
}
else {
- const short nflag = ~flag;
- for (id = lb->first; id; id = id->next) id->flag &= nflag;
+ const int nflag = ~flag;
+ for (id = lb->first; id; id = id->next)
+ id->tag &= nflag;
}
}
-/* Flag all ids in listbase */
-void BKE_main_id_flag_all(Main *bmain, const short flag, const bool value)
+/**
+ * Clear or set given flags for all ids in bmain (runtime flags only).
+ */
+void BKE_main_id_flag_all(Main *bmain, const int flag, const bool value)
{
ListBase *lbarray[MAX_LIBARRAY];
int a;
@@ -952,7 +958,7 @@ void *BKE_libblock_copy_ex(Main *bmain, ID *id)
}
id->newid = idn;
- idn->flag |= LIB_NEW;
+ idn->tag |= LIB_TAG_NEW;
BKE_libblock_copy_data(idn, id, false);
@@ -978,7 +984,7 @@ void *BKE_libblock_copy_nolib(ID *id, const bool do_action)
}
id->newid = idn;
- idn->flag |= LIB_NEW;
+ idn->tag |= LIB_TAG_NEW;
idn->us = 1;
BKE_libblock_copy_data(idn, id, do_action);
@@ -1000,8 +1006,8 @@ static bool id_relink_looper(void *UNUSED(user_data), ID **id_pointer, const int
BKE_library_update_ID_link_user(id->newid, id, cd_flag);
*id_pointer = id->newid;
}
- else if (id->flag & LIB_NEW) {
- id->flag &= ~LIB_NEW;
+ else if (id->tag & LIB_TAG_NEW) {
+ id->tag &= ~LIB_TAG_NEW;
BKE_libblock_relink(id);
}
}
@@ -1632,7 +1638,7 @@ void id_clear_lib_data(Main *bmain, ID *id)
id_fake_user_clear(id);
id->lib = NULL;
- id->flag = LIB_LOCAL;
+ id->tag |= LIB_TAG_LOCAL;
new_id(which_libbase(bmain, GS(id->name)), id, NULL);
/* internal bNodeTree blocks inside ID types below
@@ -1666,7 +1672,7 @@ void BKE_main_id_clear_newpoins(Main *bmain)
id = lbarray[a]->first;
while (id) {
id->newid = NULL;
- id->flag &= ~LIB_NEW;
+ id->tag &= ~LIB_TAG_NEW;
id = id->next;
}
}
@@ -1674,7 +1680,8 @@ void BKE_main_id_clear_newpoins(Main *bmain)
static void lib_indirect_test_id(ID *id, Library *lib)
{
-#define LIBTAG(a) if (a && a->id.lib) { a->id.flag &= ~LIB_INDIRECT; a->id.flag |= LIB_EXTERN; } (void)0
+#define LIBTAG(a) \
+ if (a && a->id.lib) { a->id.tag &= ~LIB_TAG_INDIRECT; a->id.tag |= LIB_TAG_EXTERN; } (void)0
if (id->lib) {
/* datablocks that were indirectly related are now direct links
@@ -1723,12 +1730,12 @@ void BKE_main_id_tag_listbase(ListBase *lb, const bool tag)
ID *id;
if (tag) {
for (id = lb->first; id; id = id->next) {
- id->flag |= LIB_DOIT;
+ id->tag |= LIB_TAG_DOIT;
}
}
else {
for (id = lb->first; id; id = id->next) {
- id->flag &= ~LIB_DOIT;
+ id->tag &= ~LIB_TAG_DOIT;
}
}
}
@@ -1767,27 +1774,27 @@ void BKE_library_make_local(Main *bmain, Library *lib, bool untagged_only)
id->newid = NULL;
idn = id->next; /* id is possibly being inserted again */
- /* The check on the second line (LIB_PRE_EXISTING) is done so its
+ /* The check on the second line (LIB_TAG_PRE_EXISTING) is done so its
* possible to tag data you don't want to be made local, used for
* appending data, so any libdata already linked wont become local
* (very nasty to discover all your links are lost after appending)
* */
- if (id->flag & (LIB_EXTERN | LIB_INDIRECT | LIB_NEW) &&
- ((untagged_only == false) || !(id->flag & LIB_PRE_EXISTING)))
+ if (id->tag & (LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW) &&
+ ((untagged_only == false) || !(id->tag & LIB_TAG_PRE_EXISTING)))
{
if (lib == NULL || id->lib == lib) {
if (id->lib) {
/* for Make Local > All we should be calling id_make_local,
* but doing that breaks append (see #36003 and #36006), we
* we should make it work with all datablocks and id.us==0 */
- id_clear_lib_data(bmain, id); /* sets 'id->flag' */
+ id_clear_lib_data(bmain, id); /* sets 'id->tag' */
/* why sort alphabetically here but not in
* id_clear_lib_data() ? - campbell */
id_sort_by_name(lbarray[a], id);
}
else {
- id->flag &= ~(LIB_EXTERN | LIB_INDIRECT | LIB_NEW);
+ id->tag &= ~(LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW);
}
}
}
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index cd26691c3e1..12db3a87ba0 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1589,8 +1589,8 @@ void BKE_mask_update_scene(Main *bmain, Scene *scene)
Mask *mask;
for (mask = bmain->mask.first; mask; mask = mask->id.next) {
- if (mask->id.flag & (LIB_ID_RECALC | LIB_ID_RECALC_DATA)) {
- bool do_new_frame = (mask->id.flag & LIB_ID_RECALC_DATA) != 0;
+ if (mask->id.tag & (LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA)) {
+ bool do_new_frame = (mask->id.tag & LIB_TAG_ID_RECALC_DATA) != 0;
BKE_mask_evaluate_all_masks(bmain, CFRA, do_new_frame);
}
}
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index b913e6de433..809b45d4b36 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -1312,13 +1312,13 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
// printf("material_drivers_update(%s, %s)\n", scene->id.name, ma->id.name);
/* Prevent infinite recursion by checking (and tagging the material) as having been visited already
- * (see BKE_scene_update_tagged()). This assumes ma->id.flag & LIB_DOIT isn't set by anything else
+ * (see BKE_scene_update_tagged()). This assumes ma->id.tag & LIB_TAG_DOIT isn't set by anything else
* in the meantime... [#32017]
*/
- if (ma->id.flag & LIB_DOIT)
+ if (ma->id.tag & LIB_TAG_DOIT)
return;
- ma->id.flag |= LIB_DOIT;
+ ma->id.tag |= LIB_TAG_DOIT;
/* material itself */
if (ma->adt && ma->adt->drivers.first) {
@@ -1330,7 +1330,7 @@ void material_drivers_update(Scene *scene, Material *ma, float ctime)
material_node_drivers_update(scene, ma->nodetree, ctime);
}
- ma->id.flag &= ~LIB_DOIT;
+ ma->id.tag &= ~LIB_TAG_DOIT;
}
bool object_remove_material_slot(Object *ob)
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index 70da0111752..89f22b8e742 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -1802,7 +1802,7 @@ void BKE_object_make_proxy(Object *ob, Object *target, Object *gob)
/* set object type and link to data */
ob->type = target->type;
ob->data = target->data;
- id_us_plus((ID *)ob->data); /* ensures lib data becomes LIB_EXTERN */
+ id_us_plus((ID *)ob->data); /* ensures lib data becomes LIB_TAG_EXTERN */
/* copy material and index information */
ob->actcol = ob->totcol = 0;
@@ -3795,13 +3795,13 @@ static Object *obrel_armature_find(Object *ob)
static bool obrel_list_test(Object *ob)
{
- return ob && !(ob->id.flag & LIB_DOIT);
+ return ob && !(ob->id.tag & LIB_TAG_DOIT);
}
static void obrel_list_add(LinkNode **links, Object *ob)
{
BLI_linklist_prepend(links, ob);
- ob->id.flag |= LIB_DOIT;
+ ob->id.tag |= LIB_TAG_DOIT;
}
/*
@@ -3819,7 +3819,7 @@ LinkNode *BKE_object_relational_superset(struct Scene *scene, eObjectSet objectS
/* Remove markers from all objects */
for (base = scene->base.first; base; base = base->next) {
- base->object->id.flag &= ~LIB_DOIT;
+ base->object->id.tag &= ~LIB_TAG_DOIT;
}
/* iterate over all selected and visible objects */
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index 8abe4bdbb97..5da9fcbb4fe 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -354,7 +354,7 @@ static void make_duplis_frames(const DupliContext *ctx)
/* special flag to avoid setting recalc flags to notify the depsgraph of
* updates, as this is not a permanent change to the object */
- ob->id.flag |= LIB_ANIM_NO_RECALC;
+ ob->id.tag |= LIB_TAG_ANIM_NO_RECALC;
for (scene->r.cfra = ob->dupsta; scene->r.cfra <= dupend; scene->r.cfra++) {
int ok = 1;
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 73d211f5c44..9f0a49ba1bc 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1757,8 +1757,8 @@ static void prepare_mesh_for_viewport_render(Main *bmain, Scene *scene)
if (obedit) {
Mesh *mesh = obedit->data;
if ((obedit->type == OB_MESH) &&
- ((obedit->id.flag & LIB_ID_RECALC_ALL) ||
- (mesh->id.flag & LIB_ID_RECALC_ALL)))
+ ((obedit->id.tag & LIB_TAG_ID_RECALC_ALL) ||
+ (mesh->id.tag & LIB_TAG_ID_RECALC_ALL)))
{
if (check_rendered_viewport_visible(bmain)) {
BMesh *bm = mesh->edit_btmesh->bm;
@@ -1801,7 +1801,7 @@ void BKE_scene_update_tagged(EvaluationContext *eval_ctx, Main *bmain, Scene *sc
/* removed calls to quick_cache, see pointcache.c */
- /* clear "LIB_DOIT" flag from all materials, to prevent infinite recursion problems later
+ /* clear "LIB_TAG_DOIT" flag from all materials, to prevent infinite recursion problems later
* when trying to find materials with drivers that need evaluating [#32017]
*/
BKE_main_id_tag_idcode(bmain, ID_MA, false);
@@ -1960,7 +1960,7 @@ void BKE_scene_update_for_newframe_ex(EvaluationContext *eval_ctx, Main *bmain,
}
#endif
- /* clear "LIB_DOIT" flag from all materials, to prevent infinite recursion problems later
+ /* clear "LIB_TAG_DOIT" flag from all materials, to prevent infinite recursion problems later
* when trying to find materials with drivers that need evaluating [#32017]
*/
BKE_main_id_tag_idcode(bmain, ID_MA, false);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index 7c420549a0d..588f591b2d1 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3402,16 +3402,16 @@ static ImBuf *do_render_strip_uncached(const SeqRenderData *context, Sequence *s
if (seq->scene && (context->scene != seq->scene)) {
#ifdef USE_SCENE_RECURSIVE_HACK
/* weak recusrive check, same as T32017 */
- if (seq->scene->id.flag & LIB_DOIT) {
+ if (seq->scene->id.tag & LIB_TAG_DOIT) {
break;
}
- seq->scene->id.flag |= LIB_DOIT;
+ seq->scene->id.tag |= LIB_TAG_DOIT;
#endif
ibuf = do_render_strip_seqbase(context, seq, nr, use_preprocess);
#ifdef USE_SCENE_RECURSIVE_HACK
- seq->scene->id.flag &= ~LIB_DOIT;
+ seq->scene->id.tag &= ~LIB_TAG_DOIT;
#endif
}
}