[Bf-blender-cvs] [4086bf9823f] functions: make particle colors work again

Jacques Lucke noreply at git.blender.org
Fri Sep 27 12:35:15 CEST 2019


Commit: 4086bf9823fbc936f226f3f51c1eb70ec4d8d42c
Author: Jacques Lucke
Date:   Fri Sep 27 12:35:02 2019 +0200
Branches: functions
https://developer.blender.org/rB4086bf9823fbc936f226f3f51c1eb70ec4d8d42c

make particle colors work again

This broke in rBa168c3d282083bb4.

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

M	source/blender/modifiers/intern/MOD_bparticles.c
M	source/blender/modifiers/intern/MOD_bparticles_output.c

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

diff --git a/source/blender/modifiers/intern/MOD_bparticles.c b/source/blender/modifiers/intern/MOD_bparticles.c
index 4dab2611dd7..c3d542d5b8a 100644
--- a/source/blender/modifiers/intern/MOD_bparticles.c
+++ b/source/blender/modifiers/intern/MOD_bparticles.c
@@ -99,9 +99,7 @@ BParticlesSimulationState MOD_bparticles_find_simulation_state(Object *object)
   return runtime->simulation_state;
 }
 
-static Mesh *applyModifier(ModifierData *md,
-                           const struct ModifierEvalContext *ctx,
-                           Mesh *UNUSED(mesh))
+static Mesh *applyModifier(ModifierData *md, const struct ModifierEvalContext *ctx, Mesh *mesh)
 {
   BParticlesModifierData *bpmd = (BParticlesModifierData *)md;
   BParticlesModifierData *bpmd_orig = (BParticlesModifierData *)modifier_get_original(
@@ -138,7 +136,9 @@ static Mesh *applyModifier(ModifierData *md,
     return BParticles_modifier_point_mesh_from_state(runtime->simulation_state);
   }
   else if (bpmd->output_type == MOD_BPARTICLES_OUTPUT_TETRAHEDONS) {
-    return BParticles_modifier_mesh_from_state(runtime->simulation_state);
+    Mesh *new_mesh = BParticles_modifier_mesh_from_state(runtime->simulation_state);
+    BKE_mesh_copy_settings(new_mesh, mesh);
+    return new_mesh;
   }
   else {
     return BKE_mesh_new_nomain(0, 0, 0, 0, 0);
diff --git a/source/blender/modifiers/intern/MOD_bparticles_output.c b/source/blender/modifiers/intern/MOD_bparticles_output.c
index 537a58e3139..9d52fcbb0ba 100644
--- a/source/blender/modifiers/intern/MOD_bparticles_output.c
+++ b/source/blender/modifiers/intern/MOD_bparticles_output.c
@@ -65,8 +65,10 @@ static Mesh *applyModifier(ModifierData *md,
   }
 
   if (bpmd->output_type == MOD_BPARTICLES_OUTPUT_TETRAHEDONS) {
-    return BParticles_state_extract_type__tetrahedons(simulation_state,
-                                                      bpmd->source_particle_system);
+    Mesh *new_mesh = BParticles_state_extract_type__tetrahedons(simulation_state,
+                                                                bpmd->source_particle_system);
+    BKE_mesh_copy_settings(new_mesh, mesh);
+    return new_mesh;
   }
   else if (bpmd->output_type == MOD_BPARTICLES_OUTPUT_POINTS) {
     return BParticles_state_extract_type__points(simulation_state, bpmd->source_particle_system);



More information about the Bf-blender-cvs mailing list