[Bf-blender-cvs] [185ef25243c] functions: temporarily remove unnecessary emitter sockets
Jacques Lucke
noreply at git.blender.org
Wed Sep 4 19:43:09 CEST 2019
Commit: 185ef25243cc27417109172b5fc61da911155808
Author: Jacques Lucke
Date: Wed Sep 4 11:41:26 2019 +0200
Branches: functions
https://developer.blender.org/rB185ef25243cc27417109172b5fc61da911155808
temporarily remove unnecessary emitter sockets
===================================================================
M release/scripts/startup/nodes/bparticle_nodes/mesh_emitter.py
M source/blender/simulations/bparticles/emitters.cpp
M source/blender/simulations/bparticles/emitters.hpp
M source/blender/simulations/bparticles/node_frontend.cpp
===================================================================
diff --git a/release/scripts/startup/nodes/bparticle_nodes/mesh_emitter.py b/release/scripts/startup/nodes/bparticle_nodes/mesh_emitter.py
index 37f24856997..c4301204eb5 100644
--- a/release/scripts/startup/nodes/bparticle_nodes/mesh_emitter.py
+++ b/release/scripts/startup/nodes/bparticle_nodes/mesh_emitter.py
@@ -12,9 +12,6 @@ class MeshEmitterNode(bpy.types.Node, BParticlesNode):
def declaration(self, builder: NodeBuilder):
builder.fixed_input("object", "Object", "Object")
builder.fixed_input("rate", "Rate", "Float", default=10)
- builder.fixed_input("normal_velocity", "Normal Velocity", "Float", default=1)
- builder.fixed_input("emitter_velocity", "Emitter Velocity", "Float", default=0)
- builder.fixed_input("size", "Size", "Float", default=0.05)
builder.fixed_input("density_vertex_group", "Density Group", "Text")
builder.execute_input("execute_on_birth", "Execute on Birth", "execute_on_birth__prop")
builder.particle_effector_output("emitter", "Emitter")
diff --git a/source/blender/simulations/bparticles/emitters.cpp b/source/blender/simulations/bparticles/emitters.cpp
index 00466405e10..ffd17d8f49a 100644
--- a/source/blender/simulations/bparticles/emitters.cpp
+++ b/source/blender/simulations/bparticles/emitters.cpp
@@ -290,45 +290,22 @@ void SurfaceEmitter::emit(EmitterInterface &interface)
TemporaryArray<float3> local_normals(particles_to_emit);
sample_looptris(mesh, triangles, triangles_to_sample, local_positions, local_normals);
- float epsilon = 0.01f;
TemporaryArray<float4x4> transforms_at_birth(particles_to_emit);
- TemporaryArray<float4x4> transforms_before_birth(particles_to_emit);
m_transform.interpolate(birth_moments, 0.0f, transforms_at_birth);
- m_transform.interpolate(birth_moments, -epsilon, transforms_before_birth);
TemporaryArray<float3> positions_at_birth(particles_to_emit);
float4x4::transform_positions(transforms_at_birth, local_positions, positions_at_birth);
- TemporaryArray<float3> positions_before_birth(particles_to_emit);
- float4x4::transform_positions(transforms_before_birth, local_positions, positions_before_birth);
-
TemporaryArray<float3> world_normals(particles_to_emit);
float4x4::transform_directions(transforms_at_birth, local_normals, world_normals);
- TemporaryArray<float> sizes(particles_to_emit);
- sizes.fill(m_size);
-
TemporaryArray<float> birth_times(particles_to_emit);
interface.time_span().interpolate(birth_moments, birth_times);
- TemporaryArray<float3> velocities(particles_to_emit);
-
- for (uint i = 0; i < particles_to_emit; i++) {
- float3 point_at_birth = positions_at_birth[i];
- float3 point_before_birth = positions_before_birth[i];
-
- float3 normal_velocity = world_normals[i];
- float3 emitter_velocity = (point_at_birth - point_before_birth) / epsilon;
-
- velocities[i] = normal_velocity * m_normal_velocity + emitter_velocity * m_emitter_velocity;
- }
-
for (StringRef type_name : m_types_to_emit) {
auto new_particles = interface.particle_allocator().request(type_name,
positions_at_birth.size());
new_particles.set<float3>("Position", positions_at_birth);
- new_particles.set<float3>("Velocity", velocities);
- new_particles.set<float>("Size", sizes);
new_particles.set<float>("Birth Time", birth_times);
MeshEmitterContext emitter_context(m_object,
diff --git a/source/blender/simulations/bparticles/emitters.hpp b/source/blender/simulations/bparticles/emitters.hpp
index 4a12525acd7..4fb193fe780 100644
--- a/source/blender/simulations/bparticles/emitters.hpp
+++ b/source/blender/simulations/bparticles/emitters.hpp
@@ -19,9 +19,6 @@ class SurfaceEmitter : public Emitter {
Object *m_object;
VaryingFloat4x4 m_transform;
float m_rate;
- float m_normal_velocity;
- float m_emitter_velocity;
- float m_size;
std::string m_density_group;
public:
@@ -30,18 +27,12 @@ class SurfaceEmitter : public Emitter {
Object *object,
VaryingFloat4x4 transform,
float rate,
- float normal_velocity,
- float emitter_velocity,
- float size,
StringRef density_group)
: m_types_to_emit(std::move(types_to_emit)),
m_on_birth_action(std::move(on_birth_action)),
m_object(object),
m_transform(transform),
m_rate(rate),
- m_normal_velocity(normal_velocity),
- m_emitter_velocity(emitter_velocity),
- m_size(size),
m_density_group(density_group)
{
}
diff --git a/source/blender/simulations/bparticles/node_frontend.cpp b/source/blender/simulations/bparticles/node_frontend.cpp
index 48e4deba78d..d896c166275 100644
--- a/source/blender/simulations/bparticles/node_frontend.cpp
+++ b/source/blender/simulations/bparticles/node_frontend.cpp
@@ -309,10 +309,7 @@ static void PARSE_mesh_emitter(BehaviorCollector &collector,
object,
transform,
body.get_output<float>(fn_out, 1, "Rate"),
- body.get_output<float>(fn_out, 2, "Normal Velocity"),
- body.get_output<float>(fn_out, 3, "Emitter Velocity"),
- body.get_output<float>(fn_out, 4, "Size"),
- StringRef(fn_out.relocate_out<FN::Types::MyString>(5)));
+ StringRef(fn_out.relocate_out<FN::Types::MyString>(2)));
collector.m_emitters.append(emitter);
}
More information about the Bf-blender-cvs
mailing list