[Bf-blender-cvs] [5ecbc7c0f20] id_override_static: Merge branch 'master' into id_override_static
Bastien Montagne
noreply at git.blender.org
Wed Jun 14 15:31:43 CEST 2017
Commit: 5ecbc7c0f201af1ef5903a1aa8e1abfd2b853cdd
Author: Bastien Montagne
Date: Wed Jun 14 15:20:15 2017 +0200
Branches: id_override_static
https://developer.blender.org/rB5ecbc7c0f201af1ef5903a1aa8e1abfd2b853cdd
Merge branch 'master' into id_override_static
===================================================================
===================================================================
diff --cc source/blender/blenkernel/intern/library_remap.c
index 70233386727,01ad4fb86ce..494c87c8a55
--- a/source/blender/blenkernel/intern/library_remap.c
+++ b/source/blender/blenkernel/intern/library_remap.c
@@@ -730,36 -729,11 +730,15 @@@ void BKE_libblock_free_data(ID *id, con
IDP_FreeProperty_ex(id->properties, do_id_user);
MEM_freeN(id->properties);
}
+
+ if (id->override) {
+ BKE_override_free(&id->override);
+ }
}
- /**
- * used in headerbuttons.c image.c mesh.c screen.c sound.c and library.c
- *
- * \param do_id_user: if \a true, try to release other ID's 'references' hold by \a idv.
- * (only applies to main database)
- * \param do_ui_user: similar to do_id_user but makes sure UI does not hold references to
- * \a id.
- */
- void BKE_libblock_free_ex(Main *bmain, void *idv, const bool do_id_user, const bool do_ui_user)
+ void BKE_libblock_free_datablock(ID *id)
{
- ID *id = idv;
- short type = GS(id->name);
- ListBase *lb = which_libbase(bmain, type);
-
- DAG_id_type_tag(bmain, type);
-
- #ifdef WITH_PYTHON
- BPY_id_release(id);
- #endif
-
- if (do_id_user) {
- BKE_libblock_relink_ex(bmain, id, NULL, NULL, true);
- }
-
+ const short type = GS(id->name);
switch (type) {
case ID_SCE:
BKE_scene_free((Scene *)id);
diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 99041074dfb,55f1f93be6a..0c2f1775dd6
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -161,31 -160,9 +161,26 @@@ DepsgraphNodeBuilder::~DepsgraphNodeBui
{
}
- RootDepsNode *DepsgraphNodeBuilder::add_root_node()
- {
- return m_graph->add_root_node();
- }
-
IDDepsNode *DepsgraphNodeBuilder::add_id_node(ID *id)
{
- return m_graph->add_id_node(id, id->name);
+ IDDepsNode *id_node = m_graph->find_id_node(id);
+
+ if (id_node == NULL) {
+ id_node = m_graph->add_id_node(id, id->name);
+
+ 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;
}
TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source()
More information about the Bf-blender-cvs
mailing list