[Bf-blender-cvs] [5c916fa8f8b] functions: utility to copy dot format to clipboard

Jacques Lucke noreply at git.blender.org
Sun Mar 10 16:28:47 CET 2019


Commit: 5c916fa8f8bbf91087d03cd8175e4f6678443d62
Author: Jacques Lucke
Date:   Sun Mar 10 15:49:15 2019 +0100
Branches: functions
https://developer.blender.org/rB5c916fa8f8bbf91087d03cd8175e4f6678443d62

utility to copy dot format to clipboard

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

M	source/blender/functions/CMakeLists.txt
M	source/blender/functions/core/data_flow_graph.hpp
M	source/blender/functions/core/dot_export.cpp

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

diff --git a/source/blender/functions/CMakeLists.txt b/source/blender/functions/CMakeLists.txt
index ed83e02ea34..4bb90c34997 100644
--- a/source/blender/functions/CMakeLists.txt
+++ b/source/blender/functions/CMakeLists.txt
@@ -5,6 +5,7 @@ set(INC
 	../makesrna
 	../blenkernel
 	../depsgraph
+	../windowmanager
 )
 
 set(INC_SYS
diff --git a/source/blender/functions/core/data_flow_graph.hpp b/source/blender/functions/core/data_flow_graph.hpp
index 7b8e47ffe36..7f1644621f5 100644
--- a/source/blender/functions/core/data_flow_graph.hpp
+++ b/source/blender/functions/core/data_flow_graph.hpp
@@ -271,6 +271,7 @@ namespace FN {
 		}
 
 		std::string to_dot() const;
+		void to_dot__clipboard() const;
 
 	private:
 		bool m_frozen = false;
diff --git a/source/blender/functions/core/dot_export.cpp b/source/blender/functions/core/dot_export.cpp
index 020f1c9ec91..22d94974a1d 100644
--- a/source/blender/functions/core/dot_export.cpp
+++ b/source/blender/functions/core/dot_export.cpp
@@ -1,6 +1,7 @@
 #include "data_flow_graph.hpp"
 
 #include <sstream>
+#include "WM_api.h"
 
 namespace FN {
 	static std::string get_id(Node *node)
@@ -102,4 +103,10 @@ namespace FN {
 		ss << "}\n";
 		return ss.str();
 	}
+
+	void DataFlowGraph::to_dot__clipboard() const
+	{
+		std::string dot = this->to_dot();
+		WM_clipboard_text_set(dot.c_str(), false);
+	}
 };
\ No newline at end of file



More information about the Bf-blender-cvs mailing list