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:
authorClément Foucault <foucault.clem@gmail.com>2020-01-28 20:28:10 +0300
committerClément Foucault <foucault.clem@gmail.com>2020-01-28 20:28:48 +0300
commitb2034c6ba245e131e6ecabe33ca9afa1e6394247 (patch)
treebd9fc02d009315d946f20bbf64d0df1f3e2eba1a /source/blender/blenkernel
parentca572e99708e1c59067fbeea09f2feca777caff9 (diff)
Fix T62730 Overlay: Selected edit hair points highlight is incorrect
This was due to the fact the drawing code was expecting the editpoints to be equaly spaced. Reuse the code in particle.c to output the select mask in red color channel of the particle (which is unused in new code).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/particle.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 244ffb674a4..6b87cf2df81 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -3246,22 +3246,24 @@ static void psys_cache_edit_paths_iter(void *__restrict iter_data_v,
}
}
else {
+ /* HACK(fclem): Instead of setting the color we pass the select state in the red channel.
+ * This is then picked up in DRW and the gpu shader will do the color interpolation. */
if ((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT) {
if ((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
- copy_v3_v3(ca->col, iter_data->sel_col);
+ ca->col[0] = 1.0f;
}
else {
keytime = (t - (*pind.ekey[0]->time)) / ((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
- interp_v3_v3v3(ca->col, iter_data->sel_col, iter_data->nosel_col, keytime);
+ ca->col[0] = 1.0f - keytime;
}
}
else {
if ((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT) {
keytime = (t - (*pind.ekey[0]->time)) / ((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
- interp_v3_v3v3(ca->col, iter_data->nosel_col, iter_data->sel_col, keytime);
+ ca->col[0] = keytime;
}
else {
- copy_v3_v3(ca->col, iter_data->nosel_col);
+ ca->col[0] = 0.0f;
}
}
}