[Bf-blender-cvs] [59970cc12fa] functions: move test code to new modifier

Jacques Lucke noreply at git.blender.org
Sun Feb 10 20:25:14 CET 2019


Commit: 59970cc12fa8cd331c25fd2d40ae9ff18cf0a727
Author: Jacques Lucke
Date:   Wed Jan 23 16:52:26 2019 +0100
Branches: functions
https://developer.blender.org/rB59970cc12fa8cd331c25fd2d40ae9ff18cf0a727

move test code to new modifier

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

M	build_files/cmake/macros.cmake
M	source/blender/editors/object/CMakeLists.txt
M	source/blender/editors/object/object_edit.c
M	source/blender/editors/object/object_intern.h
M	source/blender/editors/object/object_ops.c
M	source/blender/modifiers/CMakeLists.txt
M	source/blender/modifiers/intern/MOD_functiondeform.c

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

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 9caf9971c38..4d4bd347c2c 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -624,9 +624,9 @@ function(SETUP_BLENDER_SORTED_LIBS)
 		bf_python_gpu
 		bf_python_bmesh
 		bf_freestyle
-		bf_functions
 		bf_ikplugin
 		bf_modifiers
+		bf_functions
 		bf_gpencil_modifiers
 		bf_alembic
 		bf_bmesh
diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt
index a0d7555c0c6..f15427e61ac 100644
--- a/source/blender/editors/object/CMakeLists.txt
+++ b/source/blender/editors/object/CMakeLists.txt
@@ -33,7 +33,6 @@ set(INC
 	../../python
 	../../render/extern/include
 	../../windowmanager
-	../../functions
 	../../../../intern/guardedalloc
 	../../../../intern/glew-mx
 )
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 5ac3c25517e..89f043966db 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -1743,42 +1743,3 @@ void OBJECT_OT_link_to_collection(wmOperatorType *ot)
 	                      "Name of the newly added collection");
 	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
 }
-
-#include "FN_functions.h"
-
-static int test_functions_exec(bContext *UNUSED(C), wmOperator *UNUSED(op))
-{
-	FunctionRef fn = FN_get_deform_function();
-	FnInputsRef fn_in = FN_inputs_new(fn);
-	FnOutputsRef fn_out = FN_outputs_new(fn);
-
-	float input[3] = {1, 2, 3};
-	float control = 10;
-	FN_inputs_set_index(fn_in, 0, input);
-	FN_inputs_set_index(fn_in, 1, &control);
-
-	FN_function_call(fn, fn_in, fn_out);
-
-	float result[3];
-	FN_outputs_get_index(fn_out, 0, result);
-
-	printf("Result: %f %f %f\n", result[0], result[1], result[2]);
-
-	printf("Finished\n");
-	return OPERATOR_FINISHED;
-}
-
-
-void TEST_OT_test_functions(wmOperatorType *ot)
-{
-	/* identifiers */
-	ot->name = "Test Functions";
-	ot->description = "Test Functions";
-	ot->idname = "TEST_OT_test_functions";
-
-	/* api callbacks */
-	ot->exec = test_functions_exec;
-
-	/* flags */
-	ot->flag = OPTYPE_REGISTER;
-}
\ No newline at end of file
diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h
index fc349f43827..ff153488042 100644
--- a/source/blender/editors/object/object_intern.h
+++ b/source/blender/editors/object/object_intern.h
@@ -277,6 +277,4 @@ void TRANSFORM_OT_vertex_random(struct wmOperatorType *ot);
 void OBJECT_OT_data_transfer(struct wmOperatorType *ot);
 void OBJECT_OT_datalayout_transfer(struct wmOperatorType *ot);
 
-void TEST_OT_test_functions(struct wmOperatorType *ot);
-
 #endif /* __OBJECT_INTERN_H__ */
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index e2715400251..5d9aeab7eb8 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -259,8 +259,6 @@ void ED_operatortypes_object(void)
 	WM_operatortype_append(OBJECT_OT_hide_view_clear);
 	WM_operatortype_append(OBJECT_OT_hide_view_set);
 	WM_operatortype_append(OBJECT_OT_hide_collection);
-
-	WM_operatortype_append(TEST_OT_test_functions);
 }
 
 void ED_operatormacros_object(void)
diff --git a/source/blender/modifiers/CMakeLists.txt b/source/blender/modifiers/CMakeLists.txt
index 3628d576d18..bb02f8cc035 100644
--- a/source/blender/modifiers/CMakeLists.txt
+++ b/source/blender/modifiers/CMakeLists.txt
@@ -28,6 +28,7 @@ set(INC
 	../makesdna
 	../makesrna
 	../bmesh
+	../functions
 	../render/extern/include
 	../../../intern/elbeem/extern
 	../../../intern/guardedalloc
diff --git a/source/blender/modifiers/intern/MOD_functiondeform.c b/source/blender/modifiers/intern/MOD_functiondeform.c
index b782658db36..ed0be4b69ab 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform.c
+++ b/source/blender/modifiers/intern/MOD_functiondeform.c
@@ -46,7 +46,7 @@
 #include "DEG_depsgraph_query.h"
 #include "time.h"
 
-
+#include "FN_functions.h"
 
 static void deformVerts(
         ModifierData *md,
@@ -55,6 +55,23 @@ static void deformVerts(
         float (*vertexCos)[3],
         int numVerts)
 {
+	FunctionRef fn = FN_get_deform_function();
+	FnInputsRef fn_in = FN_inputs_new(fn);
+	FnOutputsRef fn_out = FN_outputs_new(fn);
+
+	float input[3] = {1, 2, 3};
+	float control = 10;
+	FN_inputs_set_index(fn_in, 0, input);
+	FN_inputs_set_index(fn_in, 1, &control);
+
+	FN_function_call(fn, fn_in, fn_out);
+
+	float result[3];
+	FN_outputs_get_index(fn_out, 0, result);
+
+	printf("Result: %f %f %f\n", result[0], result[1], result[2]);
+
+	printf("Finished\n");
 }



More information about the Bf-blender-cvs mailing list