diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-11-13 17:15:02 +0300 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2015-01-20 11:30:07 +0300 |
commit | e56bda4a02c5de5e2d0af0fcfa95c6f5929ac99a (patch) | |
tree | d35f1ea5b0f9255c942b9e7cc7ef7042b9555de7 /source/blender/editors/space_view3d | |
parent | 62d9aa05ab3db2c682184ecc500ef67ff8a5bd3b (diff) |
Draw actual hair keys when the "Guide Hair" setting is enabled.
Without this certain debug tasks become very hard to visualize.
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 4b566b6f519..da075419890 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5162,10 +5162,13 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv if (part->type == PART_HAIR) { if (part->draw & PART_DRAW_GUIDE_HAIRS) { + DerivedMesh *hair_dm = psys->hair_out_dm; + glDisable(GL_LIGHTING); glDisable(GL_COLOR_MATERIAL); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_COLOR_ARRAY); + for (a = 0, pa = psys->particles; a < totpart; a++, pa++) { if (pa->totkey > 1) { HairKey *hkey = pa->hair; @@ -5179,6 +5182,31 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv glDrawArrays(GL_LINE_STRIP, 0, pa->totkey); } } + + if (hair_dm) { + MVert *mvert = hair_dm->getVertArray(hair_dm); + int i; + + glColor3f(0.9f, 0.4f, 0.4f); + + glBegin(GL_LINES); + for (a = 0, pa = psys->particles; a < totpart; a++, pa++) { + for (i = 1; i < pa->totkey; ++i) { + float v1[3], v2[3]; + + copy_v3_v3(v1, mvert[pa->hair_index + i - 1].co); + copy_v3_v3(v2, mvert[pa->hair_index + i].co); + + mul_m4_v3(ob->obmat, v1); + mul_m4_v3(ob->obmat, v2); + + glVertex3fv(v1); + glVertex3fv(v2); + } + } + glEnd(); + } + glEnable(GL_LIGHTING); glEnable(GL_COLOR_MATERIAL); glEnableClientState(GL_NORMAL_ARRAY); |