Commit: 120d78d6d50f24047bc512b6bc18fe88eb342b56
Author: Lukas Tönne
Date:   Thu Nov 13 15:15:02 2014 +0100
Branches: hair_immediate_fixes
https://developer.blender.org/rB120d78d6d50f24047bc512b6bc18fe88eb342b56

Draw actual hair keys when the "Guide Hair" setting is enabled.

Without this certain debug tasks become very hard to visualize.

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

M       source/blender/editors/space_view3d/drawobject.c

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

diff --git a/source/blender/editors/space_view3d/drawobject.c 
b/source/blender/editors/space_view3d/drawobject.c
index 42e0510..e33c51b 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5161,10 +5161,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;
@@ -5178,6 +5181,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);

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to