Page MenuHome

Core particle nodes (ui only)
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 9 2020, 3:00 PM.

Details

Summary

This patch adds definitions for the core particle simulation nodes. Most of these nodes are fairly low level and are expected to be put into groups that we ship with Blender. The exact definitions might change a bit in the upcoming weeks. However, in my tests, these nodes provide a lot of flexibility already and can be grouped easily to provide more high level interfaces.

I'll add the "function nodes" (nodes that only operate on data) in a separate patch.

This is part of T73324.

Short description of the different nodes:

Particle Simulation:
  The most important node. It collects all the influences (emitters, events, forces, (colliders, ...)) for a specific particle simulation.
  Multiple of these nodes can exist in the same node tree.
  It shows its name in the node, because this will probably used to reference the node from somewhere else later on.

Mesh Emitter:
  Main emitter node that uses a mesh object as source.
  It will get more options soon.

Emit Particles:
  This node allows existing particles to spawn new particles.
  It can be triggered by events.

Particle Birth Event:
  A simple event that is triggered exactly once for every particle.
  It can be used to initialize particle attributes.

Particle Mesh Collision Event:
  A more complex event that is triggered when a particle hits an object.
  This node only does collision detection, but not collision response for now.

Particle Time Step Event:
  This event is triggered once per time step per particle.
  It can be triggered at the beginning or end of a time step.
  This node can be used to update particle attributes continuously or to build custom events in node groups.

Force:
  Represents a force that affects every particle in the particle simulation.
  The input vector is computed per particle and can depend on e.g. the particle position.

Execute Condition:
  This control flow nodes executes either the first or second input based on a boolean.
  This is similar to an `if` statement.

Multi Execute:
  This node allows multiple nodes to be executed one after the other.
  In the functions branch this node is needed less often and is more dynamic.
  However, since Blender's builtin node system is not very dynamic yet, a node with fixed number of inputs should work fine.
  We could have more hidden inputs.

Set Particle Attribute:
  Changes an attribute of a particle based on the name of the attribute.

Particle Attribute:
  An input node that allows accessing the current particle attributes.
  For example, it can be used to read the particle position to compute a force.

Simulation Time:
  The simulation time can be used to control many aspects of the particle simulation.

Diff Detail

Repository
rB Blender
Branch
core-simulation-nodes (branched from master)
Build Status
Buildable 7520
Build 7520: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Apr 9 2020, 3:00 PM
Jacques Lucke (JacquesLucke) created this revision.

Don't forget the license headers.

The naming and category colors need to be refined here I think, but this can also be done in master.

release/scripts/startup/nodeitems_builtins.py
500

Can this be just "Input" for consistency with shading nodes?

In general, I'm not sure "function" is a term we should use in the user interface. There will be a common set of nodes and sockets for the various nodes systems, but I'm not sure that calling them "function something" really explains much to users.

source/blender/nodes/simulation/nodes/node_sim_simulation_time.cc
3–15

Can this just be "Time" rather than "Simulation Time"? Or is there a distinction?

This revision is now accepted and ready to land.Apr 15 2020, 3:23 PM

Ah the license headers again... Will add them.

release/scripts/startup/nodeitems_builtins.py
500

Yes, I guess we can just call them Inputs.

source/blender/nodes/simulation/nodes/node_sim_simulation_time.cc
3–15

We might get Simulation Time and Scene Time (or similar) at some point. They might go out of sync for various reasons:

  • Simulation does not start at the beginning of the scene time.
  • Simulation should run while the current frame stays the same.
  • Simulation should slow down/speed up over time.

We could just have a "Time" node and use an enum or multiple outputs for the different clocks.

source/blender/nodes/simulation/nodes/node_sim_simulation_time.cc
3–15

An enum makes sense to me. Since I think in most cases users would want to use simulation time then, with scene time more as an advanced option.