Commit: f0cca102487401d36e16afce1047cca7a076b15f
Author: Jacques Lucke
Date:   Thu Jun 20 15:05:08 2019 +0200
Branches: functions
https://developer.blender.org/rBf0cca102487401d36e16afce1047cca7a076b15f

use mesh surface emitter again

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

M       source/blender/simulations/bparticles/c_wrapper.cpp

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

diff --git a/source/blender/simulations/bparticles/c_wrapper.cpp 
b/source/blender/simulations/bparticles/c_wrapper.cpp
index e6692611a6e..c07b56835f7 100644
--- a/source/blender/simulations/bparticles/c_wrapper.cpp
+++ b/source/blender/simulations/bparticles/c_wrapper.cpp
@@ -10,6 +10,7 @@
 
 #include "BKE_curve.h"
 
+#include "DNA_modifier_types.h"
 #include "DNA_object_types.h"
 #include "DNA_curve_types.h"
 
@@ -176,19 +177,24 @@ class ModifierStepDescription : public StepDescription {
   }
 };
 
-void BParticles_simulate_modifier(NodeParticlesModifierData *UNUSED(npmd),
+void BParticles_simulate_modifier(NodeParticlesModifierData *npmd,
                                   Depsgraph *UNUSED(depsgraph),
                                   BParticlesState state_c)
 {
+  SCOPED_TIMER("simulate");
+
   ParticlesState &state = *unwrap(state_c);
   ModifierStepDescription description;
   description.m_duration = 1.0f / 24.0f;
-  description.m_emitters.append(EMITTER_point({1, 1, 1}).release());
+  if (npmd->emitter_object) {
+    description.m_emitters.append(
+        EMITTER_mesh_surface((Mesh *)npmd->emitter_object->data, 
npmd->control1).release());
+  }
   description.m_influences.m_forces.append(FORCE_directional({0, 0, 
-2}).release());
-  description.m_influences.m_events.append(new AgeReachedEvent(1));
+  description.m_influences.m_events.append(new AgeReachedEvent(6.0f));
   description.m_influences.m_actions.append(new KillAction());
-  description.m_influences.m_events.append(new AgeReachedEvent(0.5f));
-  description.m_influences.m_actions.append(new MoveAction({0, 1, 0}));
+  description.m_influences.m_events.append(new AgeReachedEvent(3.0f));
+  description.m_influences.m_actions.append(new MoveAction({0, 10, 0}));
   simulate_step(state, description);
 
   std::cout << "Active Blocks: " << state.m_container->active_blocks().size() 
<< "\n";

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to