Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/startup/nodes/bparticle_nodes/forces.py1
-rw-r--r--source/blender/simulations/bparticles/forces.cpp7
-rw-r--r--source/blender/simulations/bparticles/node_frontend.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/release/scripts/startup/nodes/bparticle_nodes/forces.py b/release/scripts/startup/nodes/bparticle_nodes/forces.py
index 452fffb21dd..bf025c6bb90 100644
--- a/release/scripts/startup/nodes/bparticle_nodes/forces.py
+++ b/release/scripts/startup/nodes/bparticle_nodes/forces.py
@@ -10,6 +10,7 @@ class TurbulenceForceNode(bpy.types.Node, BParticlesNode):
def declaration(self, builder: NodeBuilder):
builder.fixed_input("strength", "Strength", "Vector", default=(1, 1, 1))
+ builder.fixed_input("size", "Size", "Float", default=0.5)
builder.fixed_input("falloff", "Falloff", "Falloff")
builder.particle_effector_output("force", "Force")
diff --git a/source/blender/simulations/bparticles/forces.cpp b/source/blender/simulations/bparticles/forces.cpp
index ffd16aca14c..fed9dc35a8c 100644
--- a/source/blender/simulations/bparticles/forces.cpp
+++ b/source/blender/simulations/bparticles/forces.cpp
@@ -37,10 +37,11 @@ void TurbulenceForce::add_force(ForceInterface &interface)
for (uint pindex : interface.pindices()) {
float3 pos = positions[pindex];
float3 strength = inputs->get<float3>("Strength", 0, pindex);
+ float size = inputs->get<float>("Size", 1, pindex);
float weight = weights[pindex];
- float x = (BLI_gNoise(0.5f, pos.x, pos.y, pos.z + 1000.0f, false, 1) - 0.5f) * strength.x;
- float y = (BLI_gNoise(0.5f, pos.x, pos.y + 1000.0f, pos.z, false, 1) - 0.5f) * strength.y;
- float z = (BLI_gNoise(0.5f, pos.x + 1000.0f, pos.y, pos.z, false, 1) - 0.5f) * strength.z;
+ float x = (BLI_gNoise(size, pos.x, pos.y, pos.z + 1000.0f, false, 1) - 0.5f) * strength.x;
+ float y = (BLI_gNoise(size, pos.x, pos.y + 1000.0f, pos.z, false, 1) - 0.5f) * strength.y;
+ float z = (BLI_gNoise(size, pos.x + 1000.0f, pos.y, pos.z, false, 1) - 0.5f) * strength.z;
destination[pindex] += float3(x, y, z) * weight;
}
}
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp b/source/blender/simulations/bparticles/node_frontend.cpp
index 852bb3f7697..7bbe28e69ff 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -546,7 +546,7 @@ static void PARSE_turbulence_force(BehaviorCollector &collector,
WorldTransition &UNUSED(world_transition),
VirtualNode *vnode)
{
- FN::TupleCallBody &body = vtree_data.function_body_for_inputs(vnode, {1});
+ FN::TupleCallBody &body = vtree_data.function_body_for_inputs(vnode, {2});
FN_TUPLE_CALL_ALLOC_TUPLES(body, fn_in, fn_out);
body.call__setup_execution_context(fn_in, fn_out);