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:
Diffstat (limited to 'source/blender/blenkernel/intern/particle.c')
-rw-r--r--source/blender/blenkernel/intern/particle.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 63d681cce0b..006e05370b1 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2999,8 +2999,8 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* should init_particle_interpolation set this ? */
if(pset->brushtype==PE_BRUSH_WEIGHT){
- pind.hkey[0] = pa->hair;
- pind.hkey[1] = pa->hair + 1;
+ pind.hkey[0] = NULL;
+ pind.hkey[1] = pa->hair;
}
@@ -3036,12 +3036,6 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
do_particle_interpolation(psys, i, pa, t, frs_sec, &pind, &result);
- /* should init_particle_interpolation set this ? */
- if(pset->brushtype==PE_BRUSH_WEIGHT){
- pind.hkey[0] = pind.hkey[1];
- pind.hkey[1]++;
- }
-
/* non-hair points are already in global space */
if(psys && !(psys->flag & PSYS_GLOBAL_HAIR)) {
mul_m4_v3(hairmat, result.co);
@@ -3099,10 +3093,17 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
/* selection coloring in edit mode */
if(pset->brushtype==PE_BRUSH_WEIGHT){
- if(k==steps)
+ if(k==0)
+ weight_to_rgb(pind.hkey[1]->weight, ca->col, ca->col+1, ca->col+2);
+ else if(k >= steps - 1)
weight_to_rgb(pind.hkey[0]->weight, ca->col, ca->col+1, ca->col+2);
else
weight_to_rgb((1.0f - keytime) * pind.hkey[0]->weight + keytime * pind.hkey[1]->weight, ca->col, ca->col+1, ca->col+2);
+
+ /* at the moment this is only used for weight painting.
+ * will need to move out of this check if its used elsewhere. */
+ pind.hkey[0] = pind.hkey[1];
+ pind.hkey[1]++;
}
else {
if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){