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/depsgraph/intern
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/depsgraph/intern')
-rw-r--r--source/blender/depsgraph/intern/depsgraph.cc2
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build.cc8
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build_nodes.cc26
-rw-r--r--source/blender/depsgraph/intern/depsgraph_build_relations.cc36
-rw-r--r--source/blender/depsgraph/intern/depsgraph_tag.cc18
5 files changed, 45 insertions, 45 deletions
diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc
index dedb6e322ba..18c7c5bd8e1 100644
--- a/source/blender/depsgraph/intern/depsgraph.cc
+++ b/source/blender/depsgraph/intern/depsgraph.cc
@@ -317,7 +317,7 @@ IDDepsNode *Depsgraph::add_id_node(ID *id, const string &name)
if (!id_node) {
DepsNodeFactory *factory = DEG_get_node_factory(DEPSNODE_TYPE_ID_REF);
id_node = (IDDepsNode *)factory->create_node(id, "", name);
- id->flag |= LIB_DOIT;
+ id->tag |= LIB_TAG_DOIT;
/* register */
this->id_hash[id] = id_node;
}
diff --git a/source/blender/depsgraph/intern/depsgraph_build.cc b/source/blender/depsgraph/intern/depsgraph_build.cc
index 7a2ee2c416a..a62b23bde68 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build.cc
@@ -206,7 +206,7 @@ static void deg_graph_build_finalize(Depsgraph *graph)
stack.push(node);
}
IDDepsNode *id_node = node->owner->owner;
- id_node->id->flag |= LIB_DOIT;
+ id_node->id->tag |= LIB_TAG_DOIT;
}
while (!stack.empty()) {
@@ -249,11 +249,11 @@ static void deg_graph_build_finalize(Depsgraph *graph)
* update tag.
*/
ID *id = id_node->id;
- if (id->flag & LIB_ID_RECALC_ALL &&
- id->flag & LIB_DOIT)
+ if (id->tag & LIB_TAG_ID_RECALC_ALL &&
+ id->tag & LIB_TAG_DOIT)
{
id_node->tag_update(graph);
- id->flag &= ~LIB_DOIT;
+ id->tag &= ~LIB_TAG_DOIT;
}
}
}
diff --git a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
index 47aa14c7637..87af9c8aceb 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_nodes.cc
@@ -242,7 +242,7 @@ OperationDepsNode *DepsgraphNodeBuilder::find_operation_node(
void DepsgraphNodeBuilder::build_scene(Main *bmain, Scene *scene)
{
- /* LIB_DOIT is used to indicate whether node for given ID was already
+ /* LIB_TAG_DOIT is used to indicate whether node for given ID was already
* created or not. This flag is being set in add_id_node(), so functions
* shouldn't bother with setting it, they only might query this flag when
* needed.
@@ -315,10 +315,10 @@ void DepsgraphNodeBuilder::build_group(Scene *scene,
Group *group)
{
ID *group_id = &group->id;
- 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 (GroupObject *go = (GroupObject *)group->gobject.first;
go != NULL;
@@ -365,7 +365,7 @@ SubgraphDepsNode *DepsgraphNodeBuilder::build_subgraph(Group *group)
void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
{
- if (ob->id.flag & LIB_DOIT) {
+ if (ob->id.tag & LIB_TAG_DOIT) {
IDDepsNode *id_node = m_graph->find_id_node(&ob->id);
id_node->layers = base->lay;
return;
@@ -430,7 +430,7 @@ void DepsgraphNodeBuilder::build_object(Scene *scene, Base *base, Object *ob)
default:
{
ID *obdata = (ID *)ob->data;
- if ((obdata->flag & LIB_DOIT) == 0) {
+ if ((obdata->tag & LIB_TAG_DOIT) == 0) {
build_animdata(obdata);
}
break;
@@ -598,7 +598,7 @@ OperationDepsNode *DepsgraphNodeBuilder::build_driver(ID *id, FCurve *fcu)
void DepsgraphNodeBuilder::build_world(World *world)
{
ID *world_id = &world->id;
- if (world_id->flag & LIB_DOIT) {
+ if (world_id->tag & LIB_TAG_DOIT) {
return;
}
@@ -961,7 +961,7 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
// add geometry collider relations
}
- if (obdata->flag & LIB_DOIT) {
+ if (obdata->tag & LIB_TAG_DOIT) {
return;
}
@@ -1045,7 +1045,7 @@ void DepsgraphNodeBuilder::build_camera(Object *ob)
/* TODO: Link scene-camera links in somehow... */
Camera *cam = (Camera *)ob->data;
ID *camera_id = &cam->id;
- if (camera_id->flag & LIB_DOIT) {
+ if (camera_id->tag & LIB_TAG_DOIT) {
return;
}
@@ -1068,7 +1068,7 @@ void DepsgraphNodeBuilder::build_lamp(Object *ob)
{
Lamp *la = (Lamp *)ob->data;
ID *lamp_id = &la->id;
- if (lamp_id->flag & LIB_DOIT) {
+ if (lamp_id->tag & LIB_TAG_DOIT) {
return;
}
@@ -1115,7 +1115,7 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree
}
else if (bnode->type == NODE_GROUP) {
bNodeTree *group_ntree = (bNodeTree *)bnode->id;
- if ((group_ntree->id.flag & LIB_DOIT) == 0) {
+ if ((group_ntree->id.tag & LIB_TAG_DOIT) == 0) {
build_nodetree(owner_node, group_ntree);
}
}
@@ -1129,7 +1129,7 @@ void DepsgraphNodeBuilder::build_nodetree(DepsNode *owner_node, bNodeTree *ntree
void DepsgraphNodeBuilder::build_material(DepsNode *owner_node, Material *ma)
{
ID *ma_id = &ma->id;
- if (ma_id->flag & LIB_DOIT) {
+ if (ma_id->tag & LIB_TAG_DOIT) {
return;
}
@@ -1167,10 +1167,10 @@ void DepsgraphNodeBuilder::build_texture_stack(DepsNode *owner_node, MTex **text
void DepsgraphNodeBuilder::build_texture(DepsNode *owner_node, Tex *tex)
{
ID *tex_id = &tex->id;
- if (tex_id->flag & LIB_DOIT) {
+ if (tex_id->tag & LIB_TAG_DOIT) {
return;
}
- tex_id->flag |= LIB_DOIT;
+ tex_id->tag |= LIB_TAG_DOIT;
/* texture itself */
build_animdata(tex_id);
/* texture's nodetree */
diff --git a/source/blender/depsgraph/intern/depsgraph_build_relations.cc b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
index 2a0dd6f9439..b0eed963aba 100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cc
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cc
@@ -240,7 +240,7 @@ void DepsgraphRelationBuilder::add_operation_relation(
void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
{
- /* LIB_DOIT is used to indicate whether node for given ID was already
+ /* LIB_TAG_DOIT is used to indicate whether node for given ID was already
* created or not.
*/
BKE_main_id_tag_all(bmain, false);
@@ -305,7 +305,7 @@ void DepsgraphRelationBuilder::build_group(Main *bmain,
Group *group)
{
ID *group_id = &group->id;
- bool group_done = (group_id->flag & LIB_DOIT) != 0;
+ bool group_done = (group_id->tag & LIB_TAG_DOIT) != 0;
OperationKey object_local_transform_key(&object->id,
DEPSNODE_TYPE_TRANSFORM,
DEG_OPCODE_TRANSFORM_LOCAL);
@@ -322,12 +322,12 @@ void DepsgraphRelationBuilder::build_group(Main *bmain,
DEPSREL_TYPE_TRANSFORM,
"Dupligroup");
}
- group_id->flag |= LIB_DOIT;
+ group_id->tag |= LIB_TAG_DOIT;
}
void DepsgraphRelationBuilder::build_object(Main *bmain, Scene *scene, Object *ob)
{
- if (ob->id.flag & LIB_DOIT) {
+ if (ob->id.tag & LIB_TAG_DOIT) {
return;
}
@@ -910,10 +910,10 @@ void DepsgraphRelationBuilder::build_driver(ID *id, FCurve *fcu)
void DepsgraphRelationBuilder::build_world(World *world)
{
ID *world_id = &world->id;
- if (world_id->flag & LIB_DOIT) {
+ if (world_id->tag & LIB_TAG_DOIT) {
return;
}
- world_id->flag |= LIB_DOIT;
+ world_id->tag |= LIB_TAG_DOIT;
build_animdata(world_id);
@@ -1631,10 +1631,10 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
}
}
- if (obdata->flag & LIB_DOIT) {
+ if (obdata->tag & LIB_TAG_DOIT) {
return;
}
- obdata->flag |= LIB_DOIT;
+ obdata->tag |= LIB_TAG_DOIT;
/* Link object data evaluation node to exit operation. */
OperationKey obdata_geom_eval_key(obdata, DEPSNODE_TYPE_GEOMETRY, DEG_OPCODE_PLACEHOLDER, "Geometry Eval");
@@ -1718,10 +1718,10 @@ void DepsgraphRelationBuilder::build_camera(Object *ob)
{
Camera *cam = (Camera *)ob->data;
ID *camera_id = &cam->id;
- if (camera_id->flag & LIB_DOIT) {
+ if (camera_id->tag & LIB_TAG_DOIT) {
return;
}
- camera_id->flag |= LIB_DOIT;
+ camera_id->tag |= LIB_TAG_DOIT;
ComponentKey parameters_key(camera_id, DEPSNODE_TYPE_PARAMETERS);
@@ -1744,10 +1744,10 @@ void DepsgraphRelationBuilder::build_lamp(Object *ob)
{
Lamp *la = (Lamp *)ob->data;
ID *lamp_id = &la->id;
- if (lamp_id->flag & LIB_DOIT) {
+ if (lamp_id->tag & LIB_TAG_DOIT) {
return;
}
- lamp_id->flag |= LIB_DOIT;
+ lamp_id->tag |= LIB_TAG_DOIT;
ComponentKey parameters_key(lamp_id, DEPSNODE_TYPE_PARAMETERS);
@@ -1794,9 +1794,9 @@ void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree)
}
else if (bnode->type == NODE_GROUP) {
bNodeTree *group_ntree = (bNodeTree *)bnode->id;
- if ((group_ntree->id.flag & LIB_DOIT) == 0) {
+ if ((group_ntree->id.tag & LIB_TAG_DOIT) == 0) {
build_nodetree(owner, group_ntree);
- group_ntree->id.flag |= LIB_DOIT;
+ group_ntree->id.tag |= LIB_TAG_DOIT;
}
OperationKey group_parameters_key(&group_ntree->id,
DEPSNODE_TYPE_PARAMETERS,
@@ -1821,10 +1821,10 @@ void DepsgraphRelationBuilder::build_nodetree(ID *owner, bNodeTree *ntree)
void DepsgraphRelationBuilder::build_material(ID *owner, Material *ma)
{
ID *ma_id = &ma->id;
- 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;
/* animation */
build_animdata(ma_id);
@@ -1840,10 +1840,10 @@ void DepsgraphRelationBuilder::build_material(ID *owner, Material *ma)
void DepsgraphRelationBuilder::build_texture(ID *owner, Tex *tex)
{
ID *tex_id = &tex->id;
- if (tex_id->flag & LIB_DOIT) {
+ if (tex_id->tag & LIB_TAG_DOIT) {
return;
}
- tex_id->flag |= LIB_DOIT;
+ tex_id->tag |= LIB_TAG_DOIT;
/* texture itself */
build_animdata(tex_id);
diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc
index a635cb670c7..42399cce3a5 100644
--- a/source/blender/depsgraph/intern/depsgraph_tag.cc
+++ b/source/blender/depsgraph/intern/depsgraph_tag.cc
@@ -76,13 +76,13 @@ namespace {
void lib_id_recalc_tag(Main *bmain, ID *id)
{
- id->flag |= LIB_ID_RECALC;
+ id->tag |= LIB_TAG_ID_RECALC;
DEG_id_type_tag(bmain, GS(id->name));
}
void lib_id_recalc_data_tag(Main *bmain, ID *id)
{
- id->flag |= LIB_ID_RECALC_DATA;
+ id->tag |= LIB_TAG_ID_RECALC_DATA;
DEG_id_type_tag(bmain, GS(id->name));
}
@@ -412,16 +412,16 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
wmWindowManager *wm = (wmWindowManager *)bmain->wm.first;
int old_layers = graph->layers;
if (wm != NULL) {
- BKE_main_id_flag_listbase(&bmain->scene, LIB_DOIT, true);
+ BKE_main_id_flag_listbase(&bmain->scene, LIB_TAG_DOIT, true);
graph->layers = 0;
for (wmWindow *win = (wmWindow *)wm->windows.first;
win != NULL;
win = (wmWindow *)win->next)
{
Scene *scene = win->screen->scene;
- if (scene->id.flag & LIB_DOIT) {
+ if (scene->id.tag & LIB_TAG_DOIT) {
graph->layers |= BKE_screen_visible_layers(win->screen, scene);
- scene->id.flag &= ~LIB_DOIT;
+ scene->id.tag &= ~LIB_TAG_DOIT;
}
}
}
@@ -443,7 +443,7 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
OperationDepsNode *node = *it;
IDDepsNode *id_node = node->owner->owner;
ID *id = id_node->id;
- if ((id->flag & LIB_ID_RECALC_ALL) != 0 ||
+ if ((id->tag & LIB_TAG_ID_RECALC_ALL) != 0 ||
(id_node->layers & scene->lay_updated) == 0)
{
id_node->tag_update(graph);
@@ -455,7 +455,7 @@ void DEG_graph_on_visible_update(Main *bmain, Scene *scene)
*/
if (GS(id->name) == ID_OB) {
Object *object = (Object *)id;
- if ((id->flag & LIB_ID_RECALC_ALL) == 0 &&
+ if ((id->tag & LIB_TAG_ID_RECALC_ALL) == 0 &&
(object->recalc & OB_RECALC_ALL) != 0)
{
id_node->tag_update(graph);
@@ -531,12 +531,12 @@ void DEG_ids_clear_recalc(Main *bmain)
*/
if (id && bmain->id_tag_update[(unsigned char)id->name[0]]) {
for (; id; id = (ID *)id->next) {
- id->flag &= ~(LIB_ID_RECALC | LIB_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 != NULL) {
- ntree->id.flag &= ~(LIB_ID_RECALC | LIB_ID_RECALC_DATA);
+ ntree->id.tag &= ~(LIB_TAG_ID_RECALC | LIB_TAG_ID_RECALC_DATA);
}
}
}