[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34024] trunk/blender/source/blender/ editors/space_view3d/drawobject.c: dont draw lamp volume when its being used as the view camera, would flicker annoyingly when flying the lamp about to position it.

Campbell Barton ideasman42 at gmail.com
Mon Jan 3 07:45:50 CET 2011


Revision: 34024
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=34024
Author:   campbellbarton
Date:     2011-01-03 07:45:47 +0100 (Mon, 03 Jan 2011)

Log Message:
-----------
dont draw lamp volume when its being used as the view camera, would flicker annoyingly when flying the lamp about to position it.

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

Modified: trunk/blender/source/blender/editors/space_view3d/drawobject.c
===================================================================
--- trunk/blender/source/blender/editors/space_view3d/drawobject.c	2011-01-03 06:13:50 UTC (rev 34023)
+++ trunk/blender/source/blender/editors/space_view3d/drawobject.c	2011-01-03 06:45:47 UTC (rev 34024)
@@ -919,11 +919,10 @@
 	float lampsize;
 	float imat[4][4], curcol[4];
 	unsigned char col[4];
-	int drawcone= (dt>OB_WIRE && !(G.f & G_PICKSEL) && la->type == LA_SPOT && (la->mode & LA_SHOW_CONE));
-
 	/* cone can't be drawn for duplicated lamps, because duplilist would be freed to */
 	/* the moment of view3d_draw_transp() call */
-	drawcone&= (base->flag & OB_FROMDUPLI)==0;
+	const short is_view= (rv3d->persp==RV3D_CAMOB && v3d->camera == base->object);
+	const short drawcone= (dt>OB_WIRE && !(G.f & G_PICKSEL) && (la->type == LA_SPOT) && (la->mode & LA_SHOW_CONE) && !(base->flag & OB_FROMDUPLI) && !is_view);
 
 	if(drawcone && !v3d->transp) {
 		/* in this case we need to draw delayed */
@@ -1028,7 +1027,10 @@
 	glPopMatrix();	/* back in object space */
 	zero_v3(vec);
 	
-	if ((la->type==LA_SPOT) || (la->type==LA_YF_PHOTON)) {	
+	if(is_view) {
+		/* skip drawing extra info */
+	}
+	else if ((la->type==LA_SPOT) || (la->type==LA_YF_PHOTON)) {
 		lvec[0]=lvec[1]= 0.0; 
 		lvec[2] = 1.0;
 		x = rv3d->persmat[0][2];
@@ -1171,7 +1173,7 @@
 
 	setlinestyle(0);
 	
-	if(la->type==LA_SPOT && (la->mode & LA_SHAD_BUF) ) {
+	if((la->type == LA_SPOT) && (la->mode & LA_SHAD_BUF) && (is_view == FALSE)) {
 		drawshadbuflimits(la, ob->obmat);
 	}
 	





More information about the Bf-blender-cvs mailing list