[Bf-blender-cvs] [4ce7ad37fe7] id_override_static: Merge branch 'master' into id_override_static

Bastien Montagne noreply at git.blender.org
Tue Jun 13 10:27:05 CEST 2017


Commit: 4ce7ad37fe7663334509ea8b22d7dc6a22308063
Author: Bastien Montagne
Date:   Mon Jun 12 15:07:00 2017 +0200
Branches: id_override_static
https://developer.blender.org/rB4ce7ad37fe7663334509ea8b22d7dc6a22308063

Merge branch 'master' into id_override_static

===================================================================



===================================================================

diff --cc source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
index 5687bde7e55,99d8834da1b..78b02a4f7e1
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
@@@ -168,64 -167,16 +168,33 @@@ RootDepsNode *DepsgraphNodeBuilder::add
  
  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(DEPSNODE_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, DEPSOP_TYPE_INIT, function_bind(BKE_override_operations_create, id, false),
 +			                   DEG_OPCODE_OPERATION, "override_generator", 0);
 +		}
 +	}
 +
 +	return id_node;
  }
  
- TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source(ID *id)
+ TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source()
  {
- 	/* determine which node to attach timesource to */
- 	if (id) {
- #if 0 /* XXX TODO */
- 		/* get ID node */
- 		IDDepsNode id_node = m_graph->find_id_node(id);
- 
- 		/* depends on what this is... */
- 		switch (GS(id->name)) {
- 			case ID_SCE: /* Scene - Usually sequencer strip causing time remapping... */
- 			{
- 				// TODO...
- 			}
- 			break;
- 
- 			case ID_GR: /* Group */
- 			{
- 				// TODO...
- 			}
- 			break;
- 
- 			// XXX: time source...
- 
- 			default:     /* Unhandled */
- 				printf("%s(): Unhandled ID - %s \n", __func__, id->name);
- 				break;
- 		}
- #endif
- 	}
- 	else {
- 		/* root-node */
- 		RootDepsNode *root_node = m_graph->root_node;
- 		if (root_node) {
- 			return root_node->add_time_source("Time Source");
- 		}
+ 	/* root-node */
+ 	RootDepsNode *root_node = m_graph->root_node;
+ 	if (root_node != NULL) {
+ 		return root_node->add_time_source("Time Source");
  	}
- 
  	return NULL;
  }




More information about the Bf-blender-cvs mailing list