[Bf-blender-cvs] [660ca276ca9] functions: add function relations

Jacques Lucke noreply at git.blender.org
Thu Feb 21 17:00:53 CET 2019


Commit: 660ca276ca9617127eeb637bdadc901297b8b2a4
Author: Jacques Lucke
Date:   Thu Feb 21 16:51:42 2019 +0100
Branches: functions
https://developer.blender.org/rB660ca276ca9617127eeb637bdadc901297b8b2a4

add function relations

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

M	source/blender/functions/c_wrapper.cpp
M	source/blender/functions/core/dependencies.cpp
M	source/blender/functions/core/dependencies.hpp

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

diff --git a/source/blender/functions/c_wrapper.cpp b/source/blender/functions/c_wrapper.cpp
index a3fd6aa209c..c34a324d8d4 100644
--- a/source/blender/functions/c_wrapper.cpp
+++ b/source/blender/functions/c_wrapper.cpp
@@ -159,6 +159,7 @@ SIMPLE_TYPE_GETTER(fvec3);
 FnFunction FN_tree_to_function(bNodeTree *btree)
 {
 	TIMEIT("Tree to function");
+	BLI_assert(btree);
 	auto fgraph = FN::Nodes::btree_to_graph(btree);
 	//std::cout << fgraph.graph()->to_dot() << std::endl;
 
diff --git a/source/blender/functions/core/dependencies.cpp b/source/blender/functions/core/dependencies.cpp
index f5dd0ff4db4..faffeac8362 100644
--- a/source/blender/functions/core/dependencies.cpp
+++ b/source/blender/functions/core/dependencies.cpp
@@ -11,4 +11,18 @@ namespace FN {
 		}
 	}
 
+	void Dependencies::add_relations(
+		DEG::DepsgraphRelationBuilder &builder,
+		const DEG::OperationKey &target)
+	{
+		for (struct Object *ob : m_transform_dependencies) {
+			DEG::OperationKey from_key(
+				(ID *)ob,
+				DEG::NodeType::TRANSFORM,
+				DEG::OperationCode::TRANSFORM_FINAL);
+
+			builder.add_relation(from_key, target, "Function Dependency");
+		}
+	}
+
 } /* namespace FN */
\ No newline at end of file
diff --git a/source/blender/functions/core/dependencies.hpp b/source/blender/functions/core/dependencies.hpp
index 29ab9a4d585..5922ba050ae 100644
--- a/source/blender/functions/core/dependencies.hpp
+++ b/source/blender/functions/core/dependencies.hpp
@@ -1,5 +1,7 @@
 #include "BLI_small_set.hpp"
 
+#include "intern/builder/deg_builder_relations.h"
+
 struct Object;
 struct DepsNodeHandle;
 
@@ -17,6 +19,10 @@ namespace FN {
 		}
 
 		void update_depsgraph(DepsNodeHandle *deps_node);
+
+		void add_relations(
+			DEG::DepsgraphRelationBuilder &builder,
+			const DEG::OperationKey &target);
 	};
 
 } /* namespace FN */
\ No newline at end of file



More information about the Bf-blender-cvs mailing list