[Bf-blender-cvs] [9255ce92476] geometry-nodes: Nodes: rename Simulation to Geometry node tree

Jacques Lucke noreply at git.blender.org
Wed Oct 21 11:39:52 CEST 2020


Commit: 9255ce9247696d588a45c722de11d0c5a68cae39
Author: Jacques Lucke
Date:   Wed Oct 21 11:39:42 2020 +0200
Branches: geometry-nodes
https://developer.blender.org/rB9255ce9247696d588a45c722de11d0c5a68cae39

Nodes: rename Simulation to Geometry node tree

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

M	release/scripts/startup/bl_operators/__init__.py
D	release/scripts/startup/bl_operators/simulation.py
M	release/scripts/startup/bl_ui/space_node.py
M	release/scripts/startup/nodeitems_builtins.py
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/simulation.cc
M	source/blender/blenloader/intern/readfile.c
M	source/blender/editors/include/ED_node.h
M	source/blender/editors/space_node/drawnode.c
M	source/blender/editors/space_node/node_edit.c
M	source/blender/editors/space_node/node_group.c
M	source/blender/editors/space_node/node_relationships.c
M	source/blender/editors/space_node/space_node.c
M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesrna/RNA_access.h
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/makesrna/intern/rna_space.c
M	source/blender/nodes/CMakeLists.txt
R086	source/blender/nodes/NOD_simulation.h	source/blender/nodes/NOD_geometry.h
M	source/blender/nodes/function/node_function_util.cc
R066	source/blender/nodes/simulation/node_simulation_tree.cc	source/blender/nodes/geometry/node_geometry_tree.cc
R076	source/blender/nodes/simulation/node_simulation_util.cc	source/blender/nodes/geometry/node_geometry_util.cc
R089	source/blender/nodes/simulation/node_simulation_util.h	source/blender/nodes/geometry/node_geometry_util.h
R083	source/blender/nodes/simulation/nodes/node_sim_common.cc	source/blender/nodes/geometry/nodes/node_geo_common.cc
M	source/blender/nodes/shader/node_shader_util.c

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

diff --git a/release/scripts/startup/bl_operators/__init__.py b/release/scripts/startup/bl_operators/__init__.py
index c927cc184a3..c5baa659668 100644
--- a/release/scripts/startup/bl_operators/__init__.py
+++ b/release/scripts/startup/bl_operators/__init__.py
@@ -42,7 +42,6 @@ _modules = [
     "rigidbody",
     "screen_play_rendered_anim",
     "sequencer",
-    "simulation",
     "userpref",
     "uvcalc_follow_active",
     "uvcalc_lightmap",
diff --git a/release/scripts/startup/bl_operators/simulation.py b/release/scripts/startup/bl_operators/simulation.py
deleted file mode 100644
index 0981baa5941..00000000000
--- a/release/scripts/startup/bl_operators/simulation.py
+++ /dev/null
@@ -1,41 +0,0 @@
-# ##### BEGIN GPL LICENSE BLOCK #####
-#
-#  This program is free software; you can redistribute it and/or
-#  modify it under the terms of the GNU General Public License
-#  as published by the Free Software Foundation; either version 2
-#  of the License, or (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program; if not, write to the Free Software Foundation,
-#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-import bpy
-
-
-class NewSimulation(bpy.types.Operator):
-    """Create a new simulation data block and edit it in the opened simulation editor"""
-
-    bl_idname = "simulation.new"
-    bl_label = "New Simulation"
-    bl_options = {'REGISTER', 'UNDO'}
-
-    @classmethod
-    def poll(cls, context):
-        return context.area.type == 'NODE_EDITOR' and context.space_data.tree_type == 'SimulationNodeTree'
-
-    def execute(self, context):
-        simulation = bpy.data.simulations.new("Simulation")
-        context.space_data.simulation = simulation
-        return {'FINISHED'}
-
-
-classes = (
-    NewSimulation,
-)
diff --git a/release/scripts/startup/bl_ui/space_node.py b/release/scripts/startup/bl_ui/space_node.py
index c0c38c02c63..a0f5d1b549d 100644
--- a/release/scripts/startup/bl_ui/space_node.py
+++ b/release/scripts/startup/bl_ui/space_node.py
@@ -151,13 +151,9 @@ class NODE_HT_header(Header):
             if snode_id:
                 layout.prop(snode_id, "use_nodes")
 
-        elif snode.tree_type == 'SimulationNodeTree':
+        elif snode.tree_type == 'GeometryNodeTree':
             row = layout.row(align=True)
-            row.prop(snode, "simulation", text="")
-            row.operator("simulation.new", text="", icon='ADD')
-            simulation = snode.simulation
-            if simulation:
-                row.prop(snode.simulation, "use_fake_user", text="")
+            # TODO: Add header for geometry node trees.
 
         else:
             # Custom node tree is edited as independent ID block
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index 8d2b6198fd5..2250137b6ef 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -58,11 +58,11 @@ class TextureNodeCategory(SortedNodeCategory):
                 context.space_data.tree_type == 'TextureNodeTree')
 
 
-class SimulationNodeCategory(SortedNodeCategory):
+class GeometryNodeCategory(SortedNodeCategory):
     @classmethod
     def poll(cls, context):
         return (context.space_data.type == 'NODE_EDITOR' and
-                context.space_data.tree_type == 'SimulationNodeTree')
+                context.space_data.tree_type == 'GeometryNodeTree')
 
 
 # menu entry for node group tools
@@ -77,11 +77,11 @@ node_tree_group_type = {
     'CompositorNodeTree': 'CompositorNodeGroup',
     'ShaderNodeTree': 'ShaderNodeGroup',
     'TextureNodeTree': 'TextureNodeGroup',
-    'SimulationNodeTree': 'SimulationNodeGroup',
+    'GeometryNodeTree': 'GeometryNodeGroup',
 }
 
 
-# generic node group items generator for shader, compositor, simulation and texture node groups
+# generic node group items generator for shader, compositor, geometry and texture node groups
 def node_group_items(context):
     if context is None:
         return
@@ -483,10 +483,10 @@ def not_implemented_node(idname):
     return NodeItem(idname, label=label)
 
 
-simulation_node_categories = [
-    # Simulation Nodes
-    SimulationNodeCategory("SIM_GROUP", "Group", items=node_group_items),
-    SimulationNodeCategory("SIM_LAYOUT", "Layout", items=[
+geometry_node_categories = [
+    # Geometry Nodes
+    GeometryNodeCategory("SIM_GROUP", "Group", items=node_group_items),
+    GeometryNodeCategory("SIM_LAYOUT", "Layout", items=[
         NodeItem("NodeFrame"),
         NodeItem("NodeReroute"),
     ]),
@@ -497,14 +497,14 @@ def register():
     nodeitems_utils.register_node_categories('SHADER', shader_node_categories)
     nodeitems_utils.register_node_categories('COMPOSITING', compositor_node_categories)
     nodeitems_utils.register_node_categories('TEXTURE', texture_node_categories)
-    nodeitems_utils.register_node_categories('SIMULATION', simulation_node_categories)
+    nodeitems_utils.register_node_categories('GEOMETRY', geometry_node_categories)
 
 
 def unregister():
     nodeitems_utils.unregister_node_categories('SHADER')
     nodeitems_utils.unregister_node_categories('COMPOSITING')
     nodeitems_utils.unregister_node_categories('TEXTURE')
-    nodeitems_utils.unregister_node_categories('SIMULATION')
+    nodeitems_utils.unregister_node_categories('GEOMETRY')
 
 
 if __name__ == "__main__":
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index 41c1f881a94..3ead32d84df 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -65,7 +65,6 @@
 #include "BKE_lib_query.h"
 #include "BKE_main.h"
 #include "BKE_node.h"
-#include "BKE_simulation.h"
 
 #include "BLI_ghash.h"
 #include "BLI_threads.h"
@@ -75,8 +74,8 @@
 #include "NOD_common.h"
 #include "NOD_composite.h"
 #include "NOD_function.h"
+#include "NOD_geometry.h"
 #include "NOD_shader.h"
-#include "NOD_simulation.h"
 #include "NOD_socket.h"
 #include "NOD_texture.h"
 
@@ -4656,9 +4655,9 @@ static void registerTextureNodes(void)
   register_node_type_tex_proc_distnoise();
 }
 
-static void registerSimulationNodes(void)
+static void registerGeometryNodes(void)
 {
-  register_node_type_sim_group();
+  register_node_type_geo_group();
 }
 
 static void registerFunctionNodes(void)
@@ -4685,7 +4684,7 @@ void init_nodesystem(void)
   register_node_tree_type_cmp();
   register_node_tree_type_sh();
   register_node_tree_type_tex();
-  register_node_tree_type_sim();
+  register_node_tree_type_geo();
 
   register_node_type_frame();
   register_node_type_reroute();
@@ -4695,7 +4694,7 @@ void init_nodesystem(void)
   registerCompositNodes();
   registerShaderNodes();
   registerTextureNodes();
-  registerSimulationNodes();
+  registerGeometryNodes();
   registerFunctionNodes();
 }
 
diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index 2e1f8bd581e..418746a680e 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -48,8 +48,8 @@
 #include "BKE_pointcache.h"
 #include "BKE_simulation.h"
 
+#include "NOD_geometry.h"
 #include "NOD_node_tree_multi_function.hh"
-#include "NOD_simulation.h"
 
 #include "BLI_map.hh"
 #include "BLT_translation.h"
@@ -70,7 +70,7 @@ static void simulation_init_data(ID *id)
 
   MEMCPY_STRUCT_AFTER(simulation, DNA_struct_default_get(Simulation), id);
 
-  bNodeTree *ntree = ntreeAddTree(nullptr, "Simulation Nodetree", ntreeType_Simulation->idname);
+  bNodeTree *ntree = ntreeAddTree(nullptr, "Geometry Nodetree", ntreeType_Geometry->idname);
   simulation->nodetree = ntree;
 }
 
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c49808c3718..5ff3d383a72 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -158,7 +158,6 @@
 #include "BKE_screen.h"
 #include "BKE_sequencer.h"
 #include "BKE_shader_fx.h"
-#include "BKE_simulation.h"
 #include "BKE_sound.h"
 #include "BKE_volume.h"
 #include "BKE_workspace.h"
diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h
index ecb98a46f99..417cae800ea 100644
--- a/source/blender/editors/include/ED_node.h
+++ b/source/blender/editors/include/ED_node.h
@@ -96,7 +96,7 @@ void ED_node_set_tree_type(struct SpaceNode *snode, struct bNodeTreeType *typein
 bool ED_node_is_compositor(struct SpaceNode *snode);
 bool ED_node_is_shader(struct SpaceNode *snode);
 bool ED_node_is_texture(struct SpaceNode *snode);
-bool ED_node_is_simulation(struct SpaceNode *snode);
+bool ED_node_is_geometry(struct SpaceNode *snode);
 
 void ED_node_shader_default(const struct bContext *C, struct ID *id);
 void ED_node_composit_default(const struct bContext *C, struct Scene *scene);
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 17bf5275cb0..b9495519427 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -68,8 +68,8 @@
 #include "IMB_imbuf_types.h"
 
 #include "NOD_composite.h"
+#include "NOD_geometry.h"
 #include "NOD_shader.h"
-#include "NOD_simulation.h"
 #include "NOD_texture.h"
 #include "node_intern.h" /* own include */
 
@@ -3138,9 +3138,9 @@ static void node_texture_set_butfunc(bNodeType *ntype)
   }
 }
 
-/* ****************** BUTTON CALLBACKS FOR SIMULATION NODES ***************** */
+/* ****************** BUTTON CALLBACKS FOR GEOMETRY NODES ***************** */
 
-static void node_simulation_set_butfunc(bNodeType *UNUSED(ntype))
+static void node_geometry_set_butfunc(bNodeType *UNUSED(ntype))
 {
 }
 
@@ -3286,7 +3286,7 @@ void ED_node_init_butfuncs(void)
     node_composit_set_butfunc(ntype);
     node_shader_s

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list