[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43276] trunk/blender/source/blender/ editors/object/object_edit.c: remove spot_interactive() which is now handled by generic py operator.

Campbell Barton ideasman42 at gmail.com
Wed Jan 11 03:25:49 CET 2012


Revision: 43276
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43276
Author:   campbellbarton
Date:     2012-01-11 02:25:43 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
remove spot_interactive() which is now handled by generic py operator.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_edit.c

Modified: trunk/blender/source/blender/editors/object/object_edit.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_edit.c	2012-01-11 02:13:09 UTC (rev 43275)
+++ trunk/blender/source/blender/editors/object/object_edit.c	2012-01-11 02:25:43 UTC (rev 43276)
@@ -595,132 +595,6 @@
 	ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
-/* *********************** */
-
-#if 0
-// XXX should be in view3d?
-
-/* context: ob = lamp */
-/* code should be replaced with proper (custom) transform handles for lamp properties */
-static void spot_interactive(Object *ob, int mode)
-{
-	Lamp *la= ob->data;
-	float transfac, dx, dy, ratio, origval;
-	int keep_running= 1, center2d[2];
-	int mval[2], mvalo[2];
-	
-//	getmouseco_areawin(mval);
-//	getmouseco_areawin(mvalo);
-	
-	project_int(ob->obmat[3], center2d);
-	if( center2d[0] > 100000 ) {		/* behind camera */
-//		center2d[0]= curarea->winx/2;
-//		center2d[1]= curarea->winy/2;
-	}
-
-//	helpline(mval, center2d);
-	
-	/* ratio is like scaling */
-	dx = (float)(center2d[0] - mval[0]);
-	dy = (float)(center2d[1] - mval[1]);
-	transfac = (float)sqrt( dx*dx + dy*dy);
-	if(transfac==0.0f) transfac= 1.0f;
-	
-	if(mode==1)	
-		origval= la->spotsize;
-	else if(mode==2)	
-		origval= la->dist;
-	else if(mode==3)	
-		origval= la->clipsta;
-	else	
-		origval= la->clipend;
-	
-	while (keep_running>0) {
-		
-//		getmouseco_areawin(mval);
-		
-		/* essential for idling subloop */
-		if(mval[0]==mvalo[0] && mval[1]==mvalo[1]) {
-			PIL_sleep_ms(2);
-		}
-		else {
-			char str[32];
-			
-			dx = (float)(center2d[0] - mval[0]);
-			dy = (float)(center2d[1] - mval[1]);
-			ratio = (float)(sqrt( dx*dx + dy*dy))/transfac;
-			
-			/* do the trick */
-			
-			if(mode==1) {	/* spot */
-				la->spotsize = ratio*origval;
-				CLAMP(la->spotsize, 1.0f, 180.0f);
-				sprintf(str, "Spot size %.2f\n", la->spotsize);
-			}
-			else if(mode==2) {	/* dist */
-				la->dist = ratio*origval;
-				CLAMP(la->dist, 0.01f, 5000.0f);
-				sprintf(str, "Distance %.2f\n", la->dist);
-			}
-			else if(mode==3) {	/* sta */
-				la->clipsta = ratio*origval;
-				CLAMP(la->clipsta, 0.001f, 5000.0f);
-				sprintf(str, "Distance %.2f\n", la->clipsta);
-			}
-			else if(mode==4) {	/* end */
-				la->clipend = ratio*origval;
-				CLAMP(la->clipend, 0.1f, 5000.0f);
-				sprintf(str, "Clip End %.2f\n", la->clipend);
-			}
-
-			/* cleanup */
-			mvalo[0]= mval[0];
-			mvalo[1]= mval[1];
-			
-			/* handle shaded mode */
-// XXX			shade_buttons_change_3d();
-
-			/* DRAW */	
-			headerprint(str);
-			force_draw_plus(SPACE_BUTS, 0);
-
-//			helpline(mval, center2d);
-		}
-		
-		while( qtest() ) {
-			short val;
-			unsigned short event= extern_qread(&val);
-			
-			switch (event){
-				case ESCKEY:
-				case RIGHTMOUSE:
-					keep_running= 0;
-					break;
-				case LEFTMOUSE:
-				case SPACEKEY:
-				case PADENTER:
-				case RETKEY:
-					if(val)
-						keep_running= -1;
-					break;
-			}
-		}
-	}
-
-	if(keep_running==0) {
-		if(mode==1)	
-			la->spotsize= origval;
-		else if(mode==2)	
-			la->dist= origval;
-		else if(mode==3)	
-			la->clipsta= origval;
-		else	
-			la->clipend= origval;
-	}
-
-}
-#endif
-
 static void copymenu_properties(Scene *scene, View3D *v3d, Object *ob)
 {	
 //XXX no longer used - to be removed - replaced by game_properties_copy_exec



More information about the Bf-blender-cvs mailing list