[Bf-blender-cvs] [ea2fc5b] master: Fix for particle path drawing with black tips.

Lukas Tönne noreply at git.blender.org
Tue Feb 17 15:22:11 CET 2015


Commit: ea2fc5b9d6000a61dba5e8c37a36231a2f22e6d4
Author: Lukas Tönne
Date:   Tue Feb 17 15:20:51 2015 +0100
Branches: master
https://developer.blender.org/rBea2fc5b9d6000a61dba5e8c37a36231a2f22e6d4

Fix for particle path drawing with black tips.

The last path segment can be shortended due to randomized path length.
In that case the last segment's color vector was not defined.

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

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

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

diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c
index 33541c3..7b2e07e 100644
--- a/source/blender/blenkernel/intern/particle_child.c
+++ b/source/blender/blenkernel/intern/particle_child.c
@@ -367,16 +367,22 @@ void psys_apply_child_modifiers(ParticleThreadContext *ctx, struct ListBase *mod
 				if (ma && draw_col_ma)
 					get_strand_normal(ma, ornor, cur_length, (key-1)->vel);
 			}
-			if (k == totkeys-1) {
-				/* last key */
-				sub_v3_v3v3(key->vel, key->co, (key-1)->co);
-			}
 			
 			if (use_length_check && k > 1) {
 				float dvec[3];
 				/* check if path needs to be cut before actual end of data points */
-				if (!check_path_length(k, keys, key, max_length, step_length, &cur_length, dvec))
+				if (!check_path_length(k, keys, key, max_length, step_length, &cur_length, dvec)) {
+					/* last key */
+					sub_v3_v3v3(key->vel, key->co, (key-1)->co);
+					if (ma && draw_col_ma) {
+						copy_v3_v3(key->col, &ma->r);
+					}
 					break;
+				}
+			}
+			if (k == totkeys-1) {
+				/* last key */
+				sub_v3_v3v3(key->vel, key->co, (key-1)->co);
 			}
 			
 			if (ma && draw_col_ma) {




More information about the Bf-blender-cvs mailing list