diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-22 19:02:23 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-06-22 19:02:23 +0400 |
commit | 50a8d1803b558c04abc23e882464faa45befcef0 (patch) | |
tree | 160586f05d6206745775a361ff30299fdb34231b /source/blender/editors/space_view3d/drawobject.c | |
parent | 096c4ddea43950d606f55184f93dcaaec35cff20 (diff) |
Make hair particles also support drawing their number next
to them, previously this only worked for regular particles.
(merge from render25 branch)
Diffstat (limited to 'source/blender/editors/space_view3d/drawobject.c')
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 45bab2ed16e..7cae427112b 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -3927,6 +3927,20 @@ static void draw_new_particle_system(Scene *scene, View3D *v3d, RegionView3D *rv cd2=cdata2=0; glLineWidth(1.0f); + + if((part->draw & PART_DRAW_NUM) && (v3d->flag2 & V3D_RENDER_OVERRIDE)==0){ + cache=psys->pathcache; + + for(a=0, pa=psys->particles; a<totpart; a++, pa++){ + float vec_txt[3]; + val[0]= '\0'; + + sprintf(val, "%i", a); + /* use worldspace beause object matrix is alredy applied */ + mul_v3_m4v3(vec_txt, ob->imat, cache[a]->co); + view3d_cached_text_draw_add(vec_txt[0], vec_txt[1], vec_txt[2], val, 10, V3D_CACHE_TEXT_WORLDSPACE); + } + } } else if(pdd && ELEM(draw_as, 0, PART_DRAW_CIRC)==0){ glDisableClientState(GL_COLOR_ARRAY); |