[Bf-blender-cvs] [18c7575f93a] blender2.8: Depsgraph: Introduce ID recalc flag for COW component
Sergey Sharybin
noreply at git.blender.org
Thu Apr 12 11:43:32 CEST 2018
Commit: 18c7575f93aa73f3a25290a97950d4eb6d37f94c
Author: Sergey Sharybin
Date: Wed Apr 11 17:29:00 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB18c7575f93aa73f3a25290a97950d4eb6d37f94c
Depsgraph: Introduce ID recalc flag for COW component
Currently unused, but will become handy to check whether ID needs
to have COW update to be run.
===================================================================
M source/blender/depsgraph/intern/eval/deg_eval_flush.cc
M source/blender/depsgraph/intern/nodes/deg_node_component.cc
M source/blender/makesdna/DNA_ID.h
===================================================================
diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
index 8be8a4b31ba..c22d27c118b 100644
--- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
+++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc
@@ -155,6 +155,7 @@ BLI_INLINE void flush_handle_component_node(Depsgraph *graph,
ComponentDepsNode *cow_comp =
id_node->find_component(DEG_NODE_TYPE_COPY_ON_WRITE);
cow_comp->tag_update(graph);
+ id_node->id_orig->recalc |= ID_RECALC_COPY_ON_WRITE;
}
/* Tag all required operations in component for update. */
foreach (OperationDepsNode *op, comp_node->operations) {
@@ -168,7 +169,7 @@ BLI_INLINE void flush_handle_component_node(Depsgraph *graph,
}
op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
}
- /* When some target changes bone, we might need to re-run the
+ /* when some target changes bone, we might need to re-run the
* whole IK solver, otherwise result might be unpredictable.
*/
if (comp_node->type == DEG_NODE_TYPE_BONE) {
diff --git a/source/blender/depsgraph/intern/nodes/deg_node_component.cc b/source/blender/depsgraph/intern/nodes/deg_node_component.cc
index 6c33856555e..786faa6e86c 100644
--- a/source/blender/depsgraph/intern/nodes/deg_node_component.cc
+++ b/source/blender/depsgraph/intern/nodes/deg_node_component.cc
@@ -381,7 +381,7 @@ DEG_COMPONENT_NODE_DEFINE(Animation, ANIMATION, ID_RECALC_ANIMA
DEG_COMPONENT_NODE_DEFINE(BatchCache, BATCH_CACHE, ID_RECALC_DRAW_CACHE);
DEG_COMPONENT_NODE_DEFINE(Bone, BONE, ID_RECALC_GEOMETRY);
DEG_COMPONENT_NODE_DEFINE(Cache, CACHE, ID_RECALC);
-DEG_COMPONENT_NODE_DEFINE(CopyOnWrite, COPY_ON_WRITE, ID_RECALC);
+DEG_COMPONENT_NODE_DEFINE(CopyOnWrite, COPY_ON_WRITE, ID_RECALC_COPY_ON_WRITE);
DEG_COMPONENT_NODE_DEFINE(Geometry, GEOMETRY, ID_RECALC_GEOMETRY);
DEG_COMPONENT_NODE_DEFINE(LayerCollections, LAYER_COLLECTIONS, ID_RECALC_COLLECTIONS);
DEG_COMPONENT_NODE_DEFINE(Parameters, PARAMETERS, ID_RECALC);
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index fd8cd8b2855..778aaec7d19 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -472,6 +472,7 @@ enum {
ID_RECALC_GEOMETRY = 1 << 4,
ID_RECALC_TRANSFORM = 1 << 5,
ID_RECALC_COLLECTIONS = 1 << 6,
+ ID_RECALC_COPY_ON_WRITE = 1 << 7,
/* Special flag to check if SOMETHING was changed. */
ID_RECALC_ALL = (~(int)0),
};
More information about the Bf-blender-cvs
mailing list