[Bf-blender-cvs] [7a609a16eb9] id_override_static: Merge branch 'blender2.8' into id_override_static
Bastien Montagne
noreply at git.blender.org
Fri Nov 10 10:40:22 CET 2017
Commit: 7a609a16eb9c001dc798b4ecbd7fcfb8082e1aa5
Author: Bastien Montagne
Date: Fri Nov 10 10:40:12 2017 +0100
Branches: id_override_static
https://developer.blender.org/rB7a609a16eb9c001dc798b4ecbd7fcfb8082e1aa5
Merge branch 'blender2.8' into id_override_static
Conflicts:
source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/library_remap.c
index ca75bb90d05,e897f3c5330..f749ce468b7
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@@ -85,8 -85,8 +85,9 @@@
#include "BKE_key.h"
#include "BKE_lamp.h"
#include "BKE_lattice.h"
+ #include "BKE_layer.h"
#include "BKE_library.h"
+#include "BKE_library_override.h"
#include "BKE_library_query.h"
#include "BKE_library_remap.h"
#include "BKE_linestyle.h"
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 767e71b6a9c,2c0aa951ffa..872ce13803d
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -176,53 -175,31 +176,53 @@@ DepsgraphNodeBuilder::~DepsgraphNodeBui
IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id, bool do_tag)
{
+ IDDepsNode *id_node = NULL;
+ bool is_idnode_created = false;
+
if (!DEG_depsgraph_use_copy_on_write()) {
- id_node = m_graph->add_id_node(id);
- return graph_->add_id_node(id);
++ id_node = graph_->add_id_node(id);
+
+ /* Zero number of components indicates that ID node was just created. */
+ is_idnode_created = (BLI_ghash_size(id_node->components) == 0);
}
- IDDepsNode *id_node = NULL;
- ID *id_cow = (ID *)BLI_ghash_lookup(cow_id_hash_, id);
- if (id_cow != NULL) {
- /* TODO(sergey): Is it possible to lookup and pop element from GHash
- * at the same time?
- */
- BLI_ghash_remove(cow_id_hash_, id, NULL, NULL);
+ else {
- ID *id_cow = (ID *)BLI_ghash_lookup(m_cow_id_hash, id);
++ ID *id_cow = (ID *)BLI_ghash_lookup(cow_id_hash_, id);
+ if (id_cow != NULL) {
+ /* TODO(sergey): Is it possible to lookup and pop element from GHash
+ * at the same time?
+ */
- BLI_ghash_remove(m_cow_id_hash, id, NULL, NULL);
++ BLI_ghash_remove(cow_id_hash_, id, NULL, NULL);
+ }
- id_node = m_graph->add_id_node(id, do_tag, id_cow);
++ id_node = graph_->add_id_node(id, do_tag, id_cow);
+
+ /* Zero number of components indicates that ID node was just created. */
+ is_idnode_created = (BLI_ghash_size(id_node->components) == 0);
+
+ /* Currently all ID nodes are supposed to have copy-on-write logic. */
+ if (is_idnode_created) {
+ ComponentDepsNode *comp_cow =
+ id_node->add_component(DEG_NODE_TYPE_COPY_ON_WRITE);
+ OperationDepsNode *op_cow = comp_cow->add_operation(
- function_bind(deg_evaluate_copy_on_write, _1, m_graph, id_node),
++ function_bind(deg_evaluate_copy_on_write, _1, graph_, id_node),
+ DEG_OPCODE_COPY_ON_WRITE,
+ "", -1);
- m_graph->operations.push_back(op_cow);
++ graph_->operations.push_back(op_cow);
+ }
}
- id_node = graph_->add_id_node(id, do_tag, id_cow);
- /* Currently all ID nodes are supposed to have copy-on-write logic.
- *
- * NOTE: Zero number of components indicates that ID node was just created.
- */
- if (BLI_ghash_size(id_node->components) == 0) {
- ComponentDepsNode *comp_cow =
- id_node->add_component(DEG_NODE_TYPE_COPY_ON_WRITE);
- OperationDepsNode *op_cow = comp_cow->add_operation(
- function_bind(deg_evaluate_copy_on_write, _1, graph_, id_node),
- DEG_OPCODE_COPY_ON_WRITE,
- "", -1);
- graph_->operations.push_back(op_cow);
+
+ if (is_idnode_created) {
+ if (id->override != NULL && (id->flag & LIB_AUTOOVERRIDE) != 0) {
+ ComponentDepsNode *comp_node = id_node->add_component(DEG_NODE_TYPE_PARAMETERS, "override_generator");
+ comp_node->owner = id_node;
+
+ /* TDOD We most certainly do not want to run this on every deg evaluation! Especially not during animation? */
+ /* Ideally, putting this in some kind of queue (only one entry per ID in whole queue) and consuming it in a
+ * low-priority background thread would be ideal, but we need to ensure IDs remain valid for the thread? */
+ add_operation_node(comp_node, function_bind(BKE_override_operations_create, id, false),
+ DEG_OPCODE_OPERATION, "override_generator", 0);
+ }
}
+
return id_node;
}
More information about the Bf-blender-cvs
mailing list