[Bf-blender-cvs] [6caf9be863f] functions: remove variation input of age reached node

Jacques Lucke noreply at git.blender.org
Thu Dec 19 15:59:19 CET 2019


Commit: 6caf9be863f038bbd0d17491c003d5ba90727002
Author: Jacques Lucke
Date:   Thu Dec 19 14:35:40 2019 +0100
Branches: functions
https://developer.blender.org/rB6caf9be863f038bbd0d17491c003d5ba90727002

remove variation input of age reached node

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

M	release/scripts/startup/nodes/bparticle_nodes/events.py
M	source/blender/simulations/bparticles/events.cpp

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

diff --git a/release/scripts/startup/nodes/bparticle_nodes/events.py b/release/scripts/startup/nodes/bparticle_nodes/events.py
index 581dbfdd34f..8c4a30565ed 100644
--- a/release/scripts/startup/nodes/bparticle_nodes/events.py
+++ b/release/scripts/startup/nodes/bparticle_nodes/events.py
@@ -12,7 +12,6 @@ class AgeReachedEventNode(bpy.types.Node, SimulationNode):
 
     def declaration(self, builder: NodeBuilder):
         builder.fixed_input("age", "Age", "Float", default=3)
-        builder.fixed_input("variation", "Variation", "Float")
         builder.execute_input("execute_on_event", "Execute on Event", "execute_on_event__prop")
 
         builder.influences_output("event", "Event")
diff --git a/source/blender/simulations/bparticles/events.cpp b/source/blender/simulations/bparticles/events.cpp
index 3ff0af6f594..b17b780ed6c 100644
--- a/source/blender/simulations/bparticles/events.cpp
+++ b/source/blender/simulations/bparticles/events.cpp
@@ -13,20 +13,10 @@ using BLI::LargeScopedVector;
 void AgeReachedEvent::filter(EventFilterInterface &interface)
 {
   AttributesRef attributes = interface.attributes();
-  auto ids = attributes.get<int32_t>("ID");
 
   auto inputs = ParticleFunctionResult::Compute(
       *m_inputs_fn, interface.pindices(), interface.attributes());
 
-  LargeScopedArray<float> trigger_ages(attributes.size());
-  for (uint pindex : interface.pindices()) {
-    float age = inputs.get_single<float>("Age", 0, pindex);
-    float variation = inputs.get_single<float>("Variation", 1, pindex);
-    int32_t id = ids[pindex];
-    float random_factor = BLI_hash_int_01(id);
-    trigger_ages[pindex] = age + random_factor * variation;
-  }
-
   float end_time = interface.step_end_time();
   auto birth_times = attributes.get<float>("Birth Time");
   auto was_activated_before = attributes.get<bool>(m_is_triggered_attribute);
@@ -36,7 +26,7 @@ void AgeReachedEvent::filter(EventFilterInterface &interface)
       continue;
     }
 
-    float trigger_age = trigger_ages[pindex];
+    float trigger_age = inputs.get_single<float>("Age", 0, pindex);
     float birth_time = birth_times[pindex];
     float age_at_end = end_time - birth_time;



More information about the Bf-blender-cvs mailing list