[Bf-blender-cvs] [1c8f6d88073] functions: cleanup

Jacques Lucke noreply at git.blender.org
Wed Sep 4 19:43:47 CEST 2019


Commit: 1c8f6d88073296c0bfe5635316f6180f768dfb13
Author: Jacques Lucke
Date:   Wed Sep 4 16:20:40 2019 +0200
Branches: functions
https://developer.blender.org/rB1c8f6d88073296c0bfe5635316f6180f768dfb13

cleanup

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

M	source/blender/simulations/bparticles/emitters.cpp
M	source/blender/simulations/bparticles/time_span.hpp

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

diff --git a/source/blender/simulations/bparticles/emitters.cpp b/source/blender/simulations/bparticles/emitters.cpp
index 37c347a362e..f1539d1c590 100644
--- a/source/blender/simulations/bparticles/emitters.cpp
+++ b/source/blender/simulations/bparticles/emitters.cpp
@@ -267,9 +267,6 @@ void SurfaceEmitter::emit(EmitterInterface &interface)
   if (m_object->type != OB_MESH) {
     return;
   }
-  if (interface.time_span().duration() == 0.0f) {
-    return;
-  }
 
   Vector<float> birth_moments;
   float factor_start, factor_step;
diff --git a/source/blender/simulations/bparticles/time_span.hpp b/source/blender/simulations/bparticles/time_span.hpp
index 76034612af3..6c326c36fff 100644
--- a/source/blender/simulations/bparticles/time_span.hpp
+++ b/source/blender/simulations/bparticles/time_span.hpp
@@ -87,6 +87,11 @@ struct TimeSpan {
                             float &r_factor_start,
                             float &r_factor_step) const
   {
+    if (m_duration == 0) {
+      /* Just needs to be greater than one. */
+      r_factor_start = 2.0f;
+      return;
+    }
     r_factor_step = 1 / (m_duration * samples_per_time);
     float time_start = std::ceil(m_start * samples_per_time) / samples_per_time;
     r_factor_start = this->get_factor_safe(time_start);



More information about the Bf-blender-cvs mailing list