[Bf-blender-cvs] [8374e08] strand_gpu: Mesh sampling system for unified point-on-mesh handling.

Lukas Tönne noreply at git.blender.org
Tue Jul 5 09:56:39 CEST 2016


Commit: 8374e088942203397adae89f587b4d5ecd8ca42f
Author: Lukas Tönne
Date:   Mon Dec 1 14:42:18 2014 +0100
Branches: strand_gpu
https://developer.blender.org/rB8374e088942203397adae89f587b4d5ecd8ca42f

Mesh sampling system for unified point-on-mesh handling.

This code is not yet used by any feature in master, but has proved very useful in the Gooseberry branch and several WIP patches. Inclusion into master was requested to avoid diverging code in branches and get part of the Gooseberry code merged early on.

The core idea is to have a common way of identifying points on mesh surfaces. Efficient evaluation of such points after deformation and mappable modifiers (e.g. subdivision) tracks positions, normals and other surface attributes. This is used extensively in the particle/hair systems and could be useful for certain tools, duplicators, etc.. Currently the particle systems in particular are very fragile and succeptible to mesh changes because of the unreliable way mesh surface mapping is sto [...]

In addition to evaluating surface samples the system also provides a central place to implement surface sampling algorithms, such as random sampling, ray casting, paint-like tools, etc.

Differential Revision: https://developer.blender.org/D922

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

M	source/blender/blenkernel/intern/mesh_sample.c

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

diff --git a/source/blender/blenkernel/intern/mesh_sample.c b/source/blender/blenkernel/intern/mesh_sample.c
index 895b64c..ae49668 100644
--- a/source/blender/blenkernel/intern/mesh_sample.c
+++ b/source/blender/blenkernel/intern/mesh_sample.c
@@ -91,6 +91,7 @@ bool BKE_mesh_sample_shapekey(Key *key, KeyBlock *kb, const MSurfaceSample *samp
 	v2 = (float *)kb->data + sample->orig_verts[1] * 3;
 	v3 = (float *)kb->data + sample->orig_verts[2] * 3;
 	
+	zero_v3(loc);
 	madd_v3_v3fl(loc, v1, sample->orig_weights[0]);
 	madd_v3_v3fl(loc, v2, sample->orig_weights[1]);
 	madd_v3_v3fl(loc, v3, sample->orig_weights[2]);




More information about the Bf-blender-cvs mailing list