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:
authorCampbell Barton <ideasman42@gmail.com>2018-05-23 16:24:39 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-23 16:26:50 +0300
commitb4b745b72064ee7d3d8b0245ac8e8358b7fd07a3 (patch)
tree17b5f9ee992e632546a504b9c75554e1e48dc6d1
parent6afccf63485d4b8578ab9e647b1d57349f1b9b17 (diff)
Depsgraph: refresh RNA that doesn't need a full rebuild
Fixes bug with changes to properties not being flushed to the COW data.
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc6
-rw-r--r--source/blender/makesdna/DNA_ID.h4
-rw-r--r--source/blender/makesrna/intern/rna_access.c6
3 files changed, 14 insertions, 2 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index edb2969fa63..10edc17e94e 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -2134,7 +2134,8 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
*/
OperationDepsNode *op_entry = comp_node->get_entry_operation();
if (op_entry != NULL) {
- graph_->add_new_relation(op_cow, op_entry, "CoW Dependency");
+ DepsRelation *rel = graph_->add_new_relation(op_cow, op_entry, "CoW Dependency");
+ rel->flag |= DEPSREL_FLAG_NO_FLUSH;
}
/* All dangling operations should also be executed after copy-on-write. */
GHASH_FOREACH_BEGIN(OperationDepsNode *, op_node, comp_node->operations_map)
@@ -2158,7 +2159,8 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDDepsNode *id_node
}
}
if (!has_same_comp_dependency) {
- graph_->add_new_relation(op_cow, op_node, "CoW Dependency");
+ DepsRelation *rel_sub = graph_->add_new_relation(op_cow, op_node, "CoW Dependency");
+ rel_sub->flag |= DEPSREL_FLAG_NO_FLUSH;
}
}
}
diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h
index acf054a94d5..4d59a7c9669 100644
--- a/source/blender/makesdna/DNA_ID.h
+++ b/source/blender/makesdna/DNA_ID.h
@@ -397,6 +397,10 @@ typedef enum ID_Type {
ID_IS_STATIC_OVERRIDE((_id)) && \
(((ID *)(_id))->override_static->flag & STATICOVERRIDE_AUTO))
+/* No copy-on-write for these types. */
+#define ID_TYPE_IS_COW(_id_type) \
+ (!ELEM(_id_type, ID_WM, ID_SCR, ID_SCRN, ID_IM, ID_MC, ID_LI))
+
#ifdef GS
# undef GS
#endif
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index a6a834465ff..4c27d3d2226 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2075,6 +2075,12 @@ static void rna_property_update(bContext *C, Main *bmain, Scene *scene, PointerR
/* we could add NULL check, for now don't */
WM_msg_publish_rna(mbus, ptr, prop);
}
+ if (ptr->id.data != NULL) {
+ const short id_type = GS(((ID *)ptr->id.data)->name);
+ if (ID_TYPE_IS_COW(id_type)) {
+ DEG_id_tag_update(ptr->id.data, DEG_TAG_COPY_ON_WRITE);
+ }
+ }
#endif
}