[Bf-blender-cvs] [be308462b45] functions: vector socket actually works now

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


Commit: be308462b458321b3fa25d4b56b459327c6bb63e
Author: Jacques Lucke
Date:   Thu Feb 21 16:54:41 2019 +0100
Branches: functions
https://developer.blender.org/rBbe308462b458321b3fa25d4b56b459327c6bb63e

vector socket actually works now

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

M	source/blender/functions/nodes/socket_inputs.cpp
M	source/blender/functions/types/numeric.hpp

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

diff --git a/source/blender/functions/nodes/socket_inputs.cpp b/source/blender/functions/nodes/socket_inputs.cpp
index e060cce6303..b7c7ef98401 100644
--- a/source/blender/functions/nodes/socket_inputs.cpp
+++ b/source/blender/functions/nodes/socket_inputs.cpp
@@ -35,7 +35,12 @@ namespace FN { namespace Nodes {
 
 		virtual void call(const Tuple &UNUSED(fn_in), Tuple &fn_out) const
 		{
-			fn_out.set<Vector>(0, Vector());
+			PointerRNA ptr;
+			RNA_pointer_create(&m_btree->id, &RNA_NodeSocket, m_bsocket, &ptr);
+
+			float vector[3];
+			RNA_float_get_array(&ptr, "value", vector);
+			fn_out.set<Vector>(0, Vector(vector));
 		}
 	};
 
diff --git a/source/blender/functions/types/numeric.hpp b/source/blender/functions/types/numeric.hpp
index 0850af0fa43..85515ded34f 100644
--- a/source/blender/functions/types/numeric.hpp
+++ b/source/blender/functions/types/numeric.hpp
@@ -6,6 +6,11 @@ namespace FN { namespace Types {
 
 	struct Vector {
 		float x, y, z;
+
+		Vector() = default;
+
+		Vector(float *vec)
+			: x(vec[0]), y(vec[1]), z(vec[2]) {}
 	};
 
 	SharedType &get_float_type();



More information about the Bf-blender-cvs mailing list