[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29005] branches/render25/source/blender/ editors/space_view3d/drawobject.c: Render Branch: make hair particles also support drawing their number next

Brecht Van Lommel brecht at blender.org
Wed May 26 18:04:11 CEST 2010


Revision: 29005
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29005
Author:   blendix
Date:     2010-05-26 18:04:11 +0200 (Wed, 26 May 2010)

Log Message:
-----------
Render Branch: make hair particles also support drawing their number next
to them, previously this only worked for regular particles.

Modified Paths:
--------------
    branches/render25/source/blender/editors/space_view3d/drawobject.c

Modified: branches/render25/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- branches/render25/source/blender/editors/space_view3d/drawobject.c	2010-05-26 15:59:45 UTC (rev 29004)
+++ branches/render25/source/blender/editors/space_view3d/drawobject.c	2010-05-26 16:04:11 UTC (rev 29005)
@@ -3960,6 +3960,20 @@
 		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);





More information about the Bf-blender-cvs mailing list