[Bf-blender-cvs] [789f6b7] temp_merge_gooseberry_hair: Draw actual hair keys when the "Guide Hair" setting is enabled.
Lukas Tönne
noreply at git.blender.org
Mon Jan 19 20:50:52 CET 2015
Commit: 789f6b75155e6d7cc0cd7d0a278533d1e137f16e
Author: Lukas Tönne
Date: Thu Nov 13 15:15:02 2014 +0100
Branches: temp_merge_gooseberry_hair
https://developer.blender.org/rB789f6b75155e6d7cc0cd7d0a278533d1e137f16e
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 3e2c89d..d2b6d7a 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);
More information about the Bf-blender-cvs
mailing list