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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-10-03 18:46:08 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2015-01-20 11:30:03 +0300
commit173bdfe05eba14a4e2cf06c6aed03afe46b24c7d (patch)
tree479be919404990012f1de2b6f81dc8c8081dbd74 /source/blender/editors/space_view3d
parentacf4506299f2118a41482468312418086e6f150a (diff)
Guide hair drawing for hair particles.
Without this the particle system only shows the actual non-simulated hairs ("guide hairs") during edit mode. These hairs are used for goals as well, so showing them in the regular viewport is pretty important. Also the usual hair curves are interpolated along the entire length, which makes it very difficult to see exact vertex positions, unless using exact powers of 2 for the segment number and match the display steps. Conflicts: source/blender/blenkernel/intern/particle.c
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/drawobject.c28
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 e44012279b4..d42d56e614e 100644
--- a/source/blender/editors/space_view3d/drawobject.c
+++ b/source/blender/editors/space_view3d/drawobject.c
@@ -5159,6 +5159,34 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv
glDrawArrays(GL_LINE_STRIP, 0, path->steps + 1);
}
}
+
+ if (part->type == PART_HAIR) {
+ if (part->draw & PART_DRAW_GUIDE_HAIRS) {
+ 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;
+
+ glVertexPointer(3, GL_FLOAT, sizeof(HairKey), hkey->world_co);
+
+ // XXX use proper theme color here
+// UI_ThemeColor(TH_NORMAL);
+ glColor3f(0.58f, 0.67f, 1.0f);
+
+ glDrawArrays(GL_LINE_STRIP, 0, pa->totkey);
+ }
+ }
+ glEnable(GL_LIGHTING);
+ glEnable(GL_COLOR_MATERIAL);
+ glEnableClientState(GL_NORMAL_ARRAY);
+ if ((dflag & DRAW_CONSTCOLOR) == 0)
+ if (part->draw_col == PART_DRAW_COL_MAT)
+ glEnableClientState(GL_COLOR_ARRAY);
+ }
+ }
/* draw child particles */
cache = psys->childcache;