[Bf-blender-cvs] [cf3690ae073] refactor-mesh-position-generic: Fix mistake in particle simplification

Hans Goudey noreply at git.blender.org
Mon Jan 9 20:50:35 CET 2023


Commit: cf3690ae073eb860a4918483041530a23e178182
Author: Hans Goudey
Date:   Mon Jan 9 14:50:29 2023 -0500
Branches: refactor-mesh-position-generic
https://developer.blender.org/rBcf3690ae073eb860a4918483041530a23e178182

Fix mistake in particle simplification

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

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

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

diff --git a/source/blender/blenkernel/intern/particle.cc b/source/blender/blenkernel/intern/particle.cc
index a7fae67e8f6..2b1d8d52a81 100644
--- a/source/blender/blenkernel/intern/particle.cc
+++ b/source/blender/blenkernel/intern/particle.cc
@@ -1434,7 +1434,7 @@ static void init_particle_interpolation(Object *ob,
     pind->dietime = (key + pa->totkey - 1)->time;
 
     if (pind->mesh) {
-      blender::MutableSpan<float3> positions = pind->mesh->vert_positions_for_write();
+      float3 *positions = pind->mesh->vert_positions_for_write().data();
       pind->positions[0] = &positions[pa->hair_index];
       pind->positions[1] = pind->positions[0] + 1;
     }
@@ -1554,7 +1554,7 @@ static void do_particle_interpolation(ParticleSystem *psys,
 
     while (pind->hkey[1]->time < real_t) {
       pind->hkey[1]++;
-      pind->positions[1] += 3;
+      pind->positions[1]++;
     }
 
     pind->hkey[0] = pind->hkey[1] - 1;
@@ -1566,7 +1566,7 @@ static void do_particle_interpolation(ParticleSystem *psys,
     edit_to_particle(keys + 2, pind->ekey[1]);
   }
   else if (pind->mesh) {
-    pind->positions[0] = pind->positions[1] - 3;
+    pind->positions[0] = pind->positions[1] - 1;
     mvert_to_particle(keys + 1, pind->positions[0], pind->hkey[0]);
     mvert_to_particle(keys + 2, pind->positions[1], pind->hkey[1]);
   }
@@ -1594,7 +1594,7 @@ static void do_particle_interpolation(ParticleSystem *psys,
     }
     else if (pind->mesh) {
       if (pind->hkey[0] != pa->hair) {
-        mvert_to_particle(keys, pind->positions[0] - 3, pind->hkey[0] - 3);
+        mvert_to_particle(keys, pind->positions[0] - 1, pind->hkey[0] - 1);
       }
       else {
         mvert_to_particle(keys, pind->positions[0], pind->hkey[0]);
@@ -1619,7 +1619,7 @@ static void do_particle_interpolation(ParticleSystem *psys,
     }
     else if (pind->mesh) {
       if (pind->hkey[1] != pa->hair + pa->totkey - 1) {
-        mvert_to_particle(keys + 3, pind->positions[1] + 3, pind->hkey[1] + 3);
+        mvert_to_particle(keys + 3, pind->positions[1] + 1, pind->hkey[1] + 1);
       }
       else {
         mvert_to_particle(keys + 3, pind->positions[1], pind->hkey[1]);



More information about the Bf-blender-cvs mailing list