[Bf-blender-cvs] [a1308c1f984] functions-experimental-refactor: init stuff

Jacques Lucke noreply at git.blender.org
Tue Oct 15 15:57:23 CEST 2019


Commit: a1308c1f984a01fadb889d236c79caf06a68c3e2
Author: Jacques Lucke
Date:   Sun Oct 13 12:40:17 2019 +0200
Branches: functions-experimental-refactor
https://developer.blender.org/rBa1308c1f984a01fadb889d236c79caf06a68c3e2

init stuff

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

A	source/blender/blenkernel/BKE_init_stuff.h
M	source/blender/blenkernel/CMakeLists.txt
A	source/blender/blenkernel/intern/init_stuff.cc
M	source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
M	source/blender/windowmanager/intern/wm_init_exit.c

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

diff --git a/source/blender/blenkernel/BKE_init_stuff.h b/source/blender/blenkernel/BKE_init_stuff.h
new file mode 100644
index 00000000000..bdec0844e76
--- /dev/null
+++ b/source/blender/blenkernel/BKE_init_stuff.h
@@ -0,0 +1,10 @@
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void BKE_init_stuff(void);
+void BKE_free_stuff(void);
+
+#ifdef __cplusplus
+}
+#endif
\ No newline at end of file
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 60e4bb500c1..b95c86cf610 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -133,6 +133,7 @@ set(SRC
   intern/image.c
   intern/image_gen.c
   intern/image_save.c
+  intern/init_stuff.cc
   intern/ipo.c
   intern/key.c
   intern/keyconfig.c
diff --git a/source/blender/blenkernel/intern/init_stuff.cc b/source/blender/blenkernel/intern/init_stuff.cc
new file mode 100644
index 00000000000..65faa12e70b
--- /dev/null
+++ b/source/blender/blenkernel/intern/init_stuff.cc
@@ -0,0 +1,12 @@
+#include "BKE_init_stuff.h"
+#include "BKE_cpp_types.h"
+
+void BKE_init_stuff(void)
+{
+  BKE::init_data_types();
+}
+
+void BKE_free_stuff(void)
+{
+  BKE::free_data_types();
+}
\ No newline at end of file
diff --git a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
index 4777f11b619..3cd0c0cda10 100644
--- a/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
+++ b/source/blender/modifiers/intern/MOD_functiondeform_cxx.cc
@@ -1,11 +1,28 @@
 #include "DNA_modifier_types.h"
 
+#include "BKE_virtual_node_tree_cxx.h"
+
+using BKE::VirtualLink;
+using BKE::VirtualNode;
+using BKE::VirtualNodeTree;
+using BKE::VirtualSocket;
+
 extern "C" {
 void MOD_functiondeform_do(FunctionDeformModifierData *fdmd, float (*vertexCos)[3], int numVerts);
 }
 
 void MOD_functiondeform_do(FunctionDeformModifierData *fdmd, float (*vertexCos)[3], int numVerts)
 {
+  if (fdmd->function_tree == nullptr) {
+    return;
+  }
+
+  VirtualNodeTree vtree;
+  vtree.add_all_of_tree(fdmd->function_tree);
+  vtree.freeze_and_index();
+
+  VirtualNode *output_node = vtree.nodes_with_idname("fn_FunctionOutputNode")[0];
+
   for (uint i = 0; i < numVerts; i++) {
     vertexCos[i][2] += 3;
   }
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index d13d33051d2..6b83a053e71 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -68,6 +68,7 @@
 #include "BKE_scene.h"
 #include "BKE_sound.h"
 #include "BKE_keyconfig.h"
+#include "BKE_init_stuff.h"
 
 #include "BKE_addon.h"
 #include "BKE_appdir.h"
@@ -261,6 +262,7 @@ void WM_init(bContext *C, int argc, const char **argv)
       WM_main_remap_editor_id_reference);                     /* library.c */
   BKE_spacedata_callback_id_remap_set(ED_spacedata_id_remap); /* screen.c */
   DEG_editors_set_update_cb(ED_render_id_flush_update, ED_render_scene_update);
+  BKE_init_stuff();
 
   ED_spacetypes_init(); /* editors/space_api/spacetype.c */
 
@@ -597,6 +599,7 @@ void WM_exit_ex(bContext *C, const bool do_python)
   wm_gizmotype_free();
 
   BLF_exit();
+  BKE_free_stuff();
 
   if (opengl_is_init) {
     DRW_opengl_context_enable_ex(false);



More information about the Bf-blender-cvs mailing list