[Bf-blender-cvs] [9d885235eb8] functions: better float3 printing

Jacques Lucke noreply at git.blender.org
Thu Dec 19 13:21:49 CET 2019


Commit: 9d885235eb88a5a171d5832c50d3efe1c36903c2
Author: Jacques Lucke
Date:   Thu Dec 19 12:38:37 2019 +0100
Branches: functions
https://developer.blender.org/rB9d885235eb88a5a171d5832c50d3efe1c36903c2

better float3 printing

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

M	source/blender/functions/intern/multi_functions/customizable.h

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

diff --git a/source/blender/functions/intern/multi_functions/customizable.h b/source/blender/functions/intern/multi_functions/customizable.h
index 1376a0d957b..c038d20ad22 100644
--- a/source/blender/functions/intern/multi_functions/customizable.h
+++ b/source/blender/functions/intern/multi_functions/customizable.h
@@ -1,7 +1,11 @@
 #pragma once
 
+#include <sstream>
+
 #include "FN_multi_function.h"
 
+#include "BLI_math_cxx.h"
+
 namespace FN {
 
 template<typename T> class MF_ConstantValue : public MultiFunction {
@@ -40,6 +44,14 @@ template<> inline std::string MF_ConstantValue<int>::output_name_from_value(cons
   return std::to_string(value);
 }
 
+template<>
+inline std::string MF_ConstantValue<BLI::float3>::output_name_from_value(const BLI::float3 &value)
+{
+  std::stringstream ss;
+  ss << value;
+  return ss.str();
+}
+
 template<> inline std::string MF_ConstantValue<bool>::output_name_from_value(const bool &value)
 {
   return (value) ? "true" : "false";



More information about the Bf-blender-cvs mailing list