[Bf-blender-cvs] [6ced026ae15] master: Simulation: remove particle nodes with outdated design

Jacques Lucke noreply at git.blender.org
Tue Oct 20 12:08:33 CEST 2020


Commit: 6ced026ae1547ac28c88516a0d061315aeacc913
Author: Jacques Lucke
Date:   Tue Oct 20 12:07:42 2020 +0200
Branches: master
https://developer.blender.org/rB6ced026ae1547ac28c88516a0d061315aeacc913

Simulation: remove particle nodes with outdated design

The design for how we approach the "Everything Nodes" project
has changed. We will focus on a different part of the project initially.

While future me will likely refer back to some of the code I remove here,
there is no point in keeping this code around in master currently.
It would just confuse other developers working on the project.

This does not remove the simulation modifier and data block. Those are
just cleaned up, so that the boilerplate code can be reused in the future.

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

M	release/scripts/startup/bl_operators/object_quick_effects.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	release/scripts/startup/nodeitems_builtins.py
M	source/blender/blenkernel/BKE_node.h
M	source/blender/blenkernel/BKE_simulation.h
M	source/blender/blenkernel/intern/node.c
M	source/blender/blenkernel/intern/simulation.cc
M	source/blender/depsgraph/intern/builder/deg_builder_relations.cc
M	source/blender/editors/space_node/drawnode.c
M	source/blender/makesdna/DNA_ID.h
M	source/blender/makesdna/DNA_modifier_defaults.h
M	source/blender/makesdna/DNA_modifier_types.h
M	source/blender/makesdna/DNA_node_types.h
M	source/blender/makesdna/DNA_simulation_types.h
M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/makesrna/intern/rna_nodetree.c
M	source/blender/modifiers/intern/MOD_simulation.cc
M	source/blender/nodes/CMakeLists.txt
M	source/blender/nodes/NOD_simulation.h
M	source/blender/nodes/NOD_static_types.h
M	source/blender/nodes/intern/node_socket.cc
D	source/blender/nodes/simulation/nodes/node_sim_age_reached_event.cc
D	source/blender/nodes/simulation/nodes/node_sim_emit_particles.cc
D	source/blender/nodes/simulation/nodes/node_sim_execute_condition.cc
D	source/blender/nodes/simulation/nodes/node_sim_force.cc
D	source/blender/nodes/simulation/nodes/node_sim_kill_particle.cc
D	source/blender/nodes/simulation/nodes/node_sim_multi_execute.cc
D	source/blender/nodes/simulation/nodes/node_sim_particle_attribute.cc
D	source/blender/nodes/simulation/nodes/node_sim_particle_birth_event.cc
D	source/blender/nodes/simulation/nodes/node_sim_particle_mesh_collision_event.cc
D	source/blender/nodes/simulation/nodes/node_sim_particle_mesh_emitter.cc
D	source/blender/nodes/simulation/nodes/node_sim_particle_simulation.cc
D	source/blender/nodes/simulation/nodes/node_sim_particle_time_step_event.cc
D	source/blender/nodes/simulation/nodes/node_sim_set_particle_attribute.cc
D	source/blender/nodes/simulation/nodes/node_sim_simulation_time.cc
M	source/blender/simulation/CMakeLists.txt
D	source/blender/simulation/SIM_simulation_update.hh
D	source/blender/simulation/intern/particle_allocator.cc
D	source/blender/simulation/intern/particle_allocator.hh
D	source/blender/simulation/intern/particle_function.cc
D	source/blender/simulation/intern/particle_function.hh
D	source/blender/simulation/intern/particle_mesh_emitter.cc
D	source/blender/simulation/intern/particle_mesh_emitter.hh
D	source/blender/simulation/intern/simulation_collect_influences.cc
D	source/blender/simulation/intern/simulation_collect_influences.hh
D	source/blender/simulation/intern/simulation_solver.cc
D	source/blender/simulation/intern/simulation_solver.hh
D	source/blender/simulation/intern/simulation_solver_influences.cc
D	source/blender/simulation/intern/simulation_solver_influences.hh
D	source/blender/simulation/intern/simulation_update.cc
D	source/blender/simulation/intern/time_interval.hh

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

diff --git a/release/scripts/startup/bl_operators/object_quick_effects.py b/release/scripts/startup/bl_operators/object_quick_effects.py
index 8ac1262645b..0f4eb8a8507 100644
--- a/release/scripts/startup/bl_operators/object_quick_effects.py
+++ b/release/scripts/startup/bl_operators/object_quick_effects.py
@@ -573,63 +573,9 @@ class QuickLiquid(Operator):
 
         return {'FINISHED'}
 
-
-class QuickParticles(Operator):
-    """Use active object as particle emitter"""
-    bl_idname = "object.quick_particles"
-    bl_label = "Quick Particles"
-
-    @classmethod
-    def poll(cls, context):
-        if not context.preferences.experimental.use_new_particle_system:
-            return False
-        if context.mode != 'OBJECT':
-            return False
-        if context.active_object is None:
-            return False
-        if context.active_object.type != 'MESH':
-            return False
-        return True
-
-    def execute(self, context):
-        pointcloud = bpy.data.pointclouds.new("Particles")
-        pointcloud_object = bpy.data.objects.new("Particles", pointcloud)
-        modifier = pointcloud_object.modifiers.new("Simulation", 'SIMULATION')
-        simulation = bpy.data.simulations.new("Particle Simulation")
-        tree = simulation.node_tree
-
-        default_name = "Particles"
-        particle_simulation_node = tree.nodes.new('SimulationNodeParticleSimulation')
-        particle_simulation_node.name = default_name
-        emitter_node = tree.nodes.new('SimulationNodeParticleMeshEmitter')
-        emitter_node.location.x -= 200
-        emitter_node.location.y += 50
-        emitter_node.inputs["Object"].default_value = context.active_object
-        force_node = tree.nodes.new('SimulationNodeForce')
-        force_node.location.x -= 200
-        force_node.location.y -= 100
-        force_node.inputs["Force"].default_value = (0, 0, -1)
-
-        tree.links.new(particle_simulation_node.inputs["Emitters"], emitter_node.outputs["Emitter"])
-        tree.links.new(particle_simulation_node.inputs["Forces"], force_node.outputs["Force"])
-
-        modifier.simulation = simulation
-        modifier.data_path = default_name
-
-        for obj in context.selected_objects:
-            obj.select_set(False)
-
-        context.collection.objects.link(pointcloud_object)
-        pointcloud_object.select_set(True)
-        context.view_layer.objects.active = pointcloud_object
-        pointcloud_object.show_bounds = True
-        return {'FINISHED'}
-
-
 classes = (
     QuickExplode,
     QuickFur,
     QuickSmoke,
     QuickLiquid,
-    QuickParticles,
 )
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 38f2c67f501..b5ce8be3b6a 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2691,8 +2691,6 @@ class VIEW3D_MT_object_quick_effects(Menu):
         layout.operator("object.quick_explode")
         layout.operator("object.quick_smoke")
         layout.operator("object.quick_liquid")
-        if context.preferences.experimental.use_new_particle_system:
-            layout.operator("object.quick_particles")
 
 
 class VIEW3D_MT_object_showhide(Menu):
diff --git a/release/scripts/startup/nodeitems_builtins.py b/release/scripts/startup/nodeitems_builtins.py
index 027f4068dc4..8d2b6198fd5 100644
--- a/release/scripts/startup/nodeitems_builtins.py
+++ b/release/scripts/startup/nodeitems_builtins.py
@@ -485,64 +485,6 @@ def not_implemented_node(idname):
 
 simulation_node_categories = [
     # Simulation Nodes
-    SimulationNodeCategory("SIM_OUTPUT", "Output", items=[
-        NodeItem("SimulationNodeParticleSimulation"),
-    ]),
-    SimulationNodeCategory("SIM_INPUTS", "Input", items=[
-        NodeItem("SimulationNodeTime"),
-        NodeItem("SimulationNodeParticleAttribute"),
-        NodeItem("FunctionNodeGroupInstanceID"),
-        NodeItem("ShaderNodeValue"),
-        NodeItem("FunctionNodeObjectTransforms"),
-    ]),
-    SimulationNodeCategory("SIM_EMITTERS", "Emitters", items=[
-        NodeItem("SimulationNodeParticleMeshEmitter"),
-        not_implemented_node("SimulationNodeEmitParticles"),
-    ]),
-    SimulationNodeCategory("SIM_EVENTS", "Events", items=[
-        NodeItem("SimulationNodeParticleBirthEvent"),
-        NodeItem("SimulationNodeParticleTimeStepEvent"),
-        NodeItem("SimulationNodeAgeReachedEvent"),
-        not_implemented_node("SimulationNodeParticleMeshCollisionEvent"),
-    ]),
-    SimulationNodeCategory("SIM_FORCES", "Forces", items=[
-        NodeItem("SimulationNodeForce"),
-    ]),
-    SimulationNodeCategory("SIM_EXECUTE", "Execute", items=[
-        NodeItem("SimulationNodeSetParticleAttribute"),
-        NodeItem("SimulationNodeExecuteCondition"),
-        NodeItem("SimulationNodeKillParticle"),
-        not_implemented_node("SimulationNodeMultiExecute"),
-    ]),
-    SimulationNodeCategory("SIM_NOISE", "Noise", items=[
-        not_implemented_node("ShaderNodeTexNoise"),
-        not_implemented_node("ShaderNodeTexWhiteNoise"),
-    ]),
-    SimulationNodeCategory("SIM_COLOR", "Color", items=[
-        not_implemented_node("ShaderNodeMixRGB"),
-        not_implemented_node("ShaderNodeInvert"),
-        not_implemented_node("ShaderNodeHueSaturation"),
-        not_implemented_node("ShaderNodeGamma"),
-        not_implemented_node("ShaderNodeBrightContrast"),
-    ]),
-    SimulationNodeCategory("SIM_CONVERTER", "Converter", items=[
-        NodeItem("ShaderNodeMapRange"),
-        NodeItem("ShaderNodeClamp"),
-        NodeItem("ShaderNodeMath"),
-        NodeItem("ShaderNodeValToRGB"),
-        NodeItem("ShaderNodeVectorMath"),
-        NodeItem("ShaderNodeSeparateRGB"),
-        NodeItem("ShaderNodeCombineRGB"),
-        NodeItem("ShaderNodeSeparateXYZ"),
-        NodeItem("ShaderNodeCombineXYZ"),
-        not_implemented_node("ShaderNodeSeparateHSV"),
-        not_implemented_node("ShaderNodeCombineHSV"),
-        NodeItem("FunctionNodeBooleanMath"),
-        NodeItem("FunctionNodeFloatCompare"),
-        not_implemented_node("FunctionNodeSwitch"),
-        NodeItem("FunctionNodeCombineStrings"),
-        NodeItem("FunctionNodeRandomFloat"),
-    ]),
     SimulationNodeCategory("SIM_GROUP", "Group", items=node_group_items),
     SimulationNodeCategory("SIM_LAYOUT", "Layout", items=[
         NodeItem("NodeFrame"),
diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h
index 5200a1b03fe..38045e22def 100644
--- a/source/blender/blenkernel/BKE_node.h
+++ b/source/blender/blenkernel/BKE_node.h
@@ -1323,27 +1323,6 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
                      struct MTex *mtex);
 /** \} */
 
-/* -------------------------------------------------------------------- */
-/** \name Simulation Nodes
- * \{ */
-
-#define SIM_NODE_PARTICLE_SIMULATION 1000
-#define SIM_NODE_FORCE 1001
-#define SIM_NODE_SET_PARTICLE_ATTRIBUTE 1002
-#define SIM_NODE_PARTICLE_BIRTH_EVENT 1003
-#define SIM_NODE_PARTICLE_TIME_STEP_EVENT 1004
-#define SIM_NODE_EXECUTE_CONDITION 1005
-#define SIM_NODE_MULTI_EXECUTE 1006
-#define SIM_NODE_PARTICLE_MESH_EMITTER 1007
-#define SIM_NODE_PARTICLE_MESH_COLLISION_EVENT 1008
-#define SIM_NODE_EMIT_PARTICLES 1009
-#define SIM_NODE_TIME 1010
-#define SIM_NODE_PARTICLE_ATTRIBUTE 1011
-#define SIM_NODE_AGE_REACHED_EVENT 1012
-#define SIM_NODE_KILL_PARTICLE 1013
-
-/** \} */
-
 /* -------------------------------------------------------------------- */
 /** \name Function Nodes
  * \{ */
diff --git a/source/blender/blenkernel/BKE_simulation.h b/source/blender/blenkernel/BKE_simulation.h
index 2c436f2bff8..23735990079 100644
--- a/source/blender/blenkernel/BKE_simulation.h
+++ b/source/blender/blenkernel/BKE_simulation.h
@@ -31,27 +31,7 @@ void *BKE_simulation_add(struct Main *bmain, const char *name);
 void BKE_simulation_data_update(struct Depsgraph *depsgraph,
                                 struct Scene *scene,
                                 struct Simulation *simulation);
-void BKE_simulation_update_dependencies(struct Simulation *simulation, struct Main *bmain);
-
-SimulationState *BKE_simulation_state_add(Simulation *simulation,
-                                          const char *type,
-                                          const char *name);
-void BKE_simulation_state_remove(Simulation *simulation, SimulationState *state);
-void BKE_simulation_state_remove_all(Simulation *simulation);
-void BKE_simulation_state_reset(Simulation *simulation, SimulationState *state);
-void BKE_simulation_state_reset_all(Simulation *simulation);
-SimulationState *BKE_simulation_state_try_find_by_name(Simulation *simulation, const char *name);
-SimulationState *BKE_simulation_state_try_find_by_name_and_type(Simulation *simulation,
-                                                                const char *name,
-                                                                const char *type);
-void BKE_simulation_state_copy_data(const SimulationState *src_state, SimulationState *dst_state);
 
 #ifdef __cplusplus
 }
 #endif
-
-#ifdef __cplusplus
-
-template<typename StateType> const char *BKE_simulation_get_state_type_name();
-
-#endif
diff --git a/source/blender/blenkernel/intern/node.c b/source/blender/blenkernel/intern/node.c
index cf31b5338cb..80a553ff525 100644
--- a/source/blender/blenkernel/intern/node.c
+++ b/source/blender/blenkernel/intern/node.c
@@ -281,10 +281,6 @@ static void library_foreach_node_socket(LibraryForeachIDData *data, bNodeSocket
     case __SOCK_MESH:
     case SOCK_CUSTOM:
     case SOCK_SHADER:
-    case SOCK_EMITTERS:
-    case SOCK_EVENTS:
-    case SOCK_FORCES:
-    case SOCK_CONTROL_FLOW:
       break;
   }
 }
@@ -377,10 +373,6 @@ static void write_node_socket_default_value(BlendWriter *writer, bNodeSocket *so
     case __SOCK_MESH:
     case SOCK_CUSTOM:
     case SOCK_SHADER:
-    case SOCK_EMITTERS:
-    case SOCK_EVENTS:
-    case SOCK_FORCES:
-    case SOCK_CONTROL_FLOW:
       BLI_assert(false);
       break;
   }
@@ -723,10 +715,6 @@ static void lib_link_node_socket(BlendLibReader *reader, Library *lib, bNodeSock
     case __SOCK_MESH:
     case SOCK_CUSTOM:
     ca

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list