Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-02-13 14:04:41 +0300
committerJacques Lucke <jacques@blender.org>2020-02-13 14:04:41 +0300
commit630da3b5e3539ca3bda80a8342b899afc6bfd306 (patch)
treed362b803c01eb725a8c99474acf8a051bde4ceaa /source/blender/simulations
parenta88db0aa7dd9785c4cf68a8e510e7a7114035319 (diff)
Initial builtin simulation node tree type
Diffstat (limited to 'source/blender/simulations')
-rw-r--r--source/blender/simulations/CMakeLists.txt5
-rw-r--r--source/blender/simulations/nodes/SIM_node_tree.h16
-rw-r--r--source/blender/simulations/nodes/simulation_node_tree.cc23
3 files changed, 44 insertions, 0 deletions
diff --git a/source/blender/simulations/CMakeLists.txt b/source/blender/simulations/CMakeLists.txt
index 331b0c6f85b..a58bb8ea97c 100644
--- a/source/blender/simulations/CMakeLists.txt
+++ b/source/blender/simulations/CMakeLists.txt
@@ -7,6 +7,8 @@ set(INC
../depsgraph
../functions
../imbuf
+ ../blentranslation
+ ../editors/include
../../../intern/guardedalloc
)
@@ -55,6 +57,9 @@ set(SRC
bparticles/particle_set.cpp
bparticles/force_interface.hpp
bparticles/force_interface.cpp
+
+ nodes/SIM_node_tree.h
+ nodes/simulation_node_tree.cc
)
set(LIB
diff --git a/source/blender/simulations/nodes/SIM_node_tree.h b/source/blender/simulations/nodes/SIM_node_tree.h
new file mode 100644
index 00000000000..ee370dd556d
--- /dev/null
+++ b/source/blender/simulations/nodes/SIM_node_tree.h
@@ -0,0 +1,16 @@
+#ifndef __SIM_NODE_TREE_H__
+#define __SIM_NODE_TREE_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern struct bNodeTreeType *ntreeType_Simulation;
+
+void register_node_tree_type_sim(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __SIM_NODE_TREE_H__ */
diff --git a/source/blender/simulations/nodes/simulation_node_tree.cc b/source/blender/simulations/nodes/simulation_node_tree.cc
new file mode 100644
index 00000000000..4f231a509c8
--- /dev/null
+++ b/source/blender/simulations/nodes/simulation_node_tree.cc
@@ -0,0 +1,23 @@
+#include <cstring>
+
+#include "SIM_node_tree.h"
+#include "BKE_node.h"
+#include "MEM_guardedalloc.h"
+#include "BLT_translation.h"
+#include "RNA_access.h"
+
+bNodeTreeType *ntreeType_Simulation;
+
+void register_node_tree_type_sim()
+{
+ bNodeTreeType *tt = ntreeType_Simulation = (bNodeTreeType *)MEM_callocN(
+ sizeof(bNodeTreeType), "simulation node tree type");
+ tt->type = NTREE_SIMULATION;
+ strcpy(tt->idname, "SimulationNodeTree");
+ strcpy(tt->ui_name, N_("Simulation Editor"));
+ strcpy(tt->ui_description, N_("Simulation nodes"));
+ tt->ui_icon = 0; /* Defined in drawnode.c */
+ tt->ext.srna = &RNA_SimulationNodeTree;
+
+ ntreeTypeAdd(tt);
+}