[Bf-blender-cvs] [f64710a5182] master: Particles: change initial velocity of particles

Jacques Lucke noreply at git.blender.org
Thu Jul 16 16:09:37 CEST 2020


Commit: f64710a518238fd4bf5e1842481bc1194249d6e7
Author: Jacques Lucke
Date:   Thu Jul 16 16:09:09 2020 +0200
Branches: master
https://developer.blender.org/rBf64710a518238fd4bf5e1842481bc1194249d6e7

Particles: change initial velocity of particles

This is only temporary, but makes testing the system a bit easier.

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

M	source/blender/blenkernel/intern/simulation.cc

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

diff --git a/source/blender/blenkernel/intern/simulation.cc b/source/blender/blenkernel/intern/simulation.cc
index e735c30ffae..7ba6e07fb64 100644
--- a/source/blender/blenkernel/intern/simulation.cc
+++ b/source/blender/blenkernel/intern/simulation.cc
@@ -732,12 +732,12 @@ static void simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulatio
   fn::MFNetwork network;
   ResourceCollector resources;
   MFNetworkTreeMap network_map = insert_node_tree_into_mf_network(network, tree, resources);
-  // WM_clipboard_text_set(tree.to_dot().c_str(), false);
   Map<const fn::MFOutputSocket *, std::string> attribute_inputs = deduplicate_attribute_nodes(
       network, network_map, tree);
   fn::mf_network_optimization::constant_folding(network, resources);
   fn::mf_network_optimization::common_subnetwork_elimination(network);
   fn::mf_network_optimization::dead_node_removal(network);
+  // WM_clipboard_text_set(network.to_dot().c_str(), false);
 
   Map<std::string, Vector<const ParticleForce *>> forces_by_simulation = collect_forces(
       network_map, resources, attribute_inputs);
@@ -763,7 +763,7 @@ static void simulation_data_update(Depsgraph *depsgraph, Scene *scene, Simulatio
 
       for (uint i : positions.index_range()) {
         positions[i] = {i / 100.0f, 0, 0};
-        velocities[i] = {0, BLI_rng_get_float(rng), BLI_rng_get_float(rng) * 2 + 1};
+        velocities[i] = {0, BLI_rng_get_float(rng) - 0.5f, BLI_rng_get_float(rng) - 0.5f};
         ids[i] = i;
       }
     }



More information about the Bf-blender-cvs mailing list