[Bf-blender-cvs] [71c9704] depsgraph_refactor: Time source registration logic added to DepsgraphNodeBuilder (as far as it exists at this point).

Lukas Tönne noreply at git.blender.org
Wed Apr 9 13:32:35 CEST 2014


Commit: 71c9704d96bd4aa1b10237c4cd5af542b62575aa
Author: Lukas Tönne
Date:   Wed Apr 9 11:21:18 2014 +0200
https://developer.blender.org/rB71c9704d96bd4aa1b10237c4cd5af542b62575aa

Time source registration logic added to DepsgraphNodeBuilder (as far as
it exists at this point).

The goal is to remove all add_to_graph functionality from the invidiual
node classes eventually and add this to the respective owner node types.
Doing this in the builder classes is just temporary atm.

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

M	source/blender/depsgraph/intern/depsgraph_build.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp b/source/blender/depsgraph/intern/depsgraph_build.cpp
index 48cdc0b..6092e96 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -196,7 +196,42 @@ IDDepsNode *DepsgraphNodeBuilder::add_id_node(IDPtr id)
 
 TimeSourceDepsNode *DepsgraphNodeBuilder::add_time_source(IDPtr id)
 {
-	return (TimeSourceDepsNode *)m_graph->get_node(id, "", DEPSNODE_TYPE_TIMESOURCE, string_format("%s Time Source", id->name+2));
+	TimeSourceDepsNode *time_source = (TimeSourceDepsNode *)m_graph->get_node(id, "", DEPSNODE_TYPE_TIMESOURCE, string_format("%s Time Source", id->name+2));
+
+	/* 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;
+		root_node->time_source = time_source;
+		/*time_source->owner = root_node;*/
+	}
 }
 
 ComponentDepsNode *DepsgraphNodeBuilder::add_component_node(IDDepsNode *id_node, eDepsNode_Type comp_type, const string &subdata)




More information about the Bf-blender-cvs mailing list