[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39128] branches/soc-2011-tomato/source/ blender/editors/space_clip: Camera tracking integration

Sergey Sharybin g.ulairi at gmail.com
Sun Aug 7 13:11:08 CEST 2011


Revision: 39128
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39128
Author:   nazgul
Date:     2011-08-07 11:11:07 +0000 (Sun, 07 Aug 2011)
Log Message:
-----------
Camera tracking integration
===========================

Switch from UI_DrawString to BLF_draw. No functional changes.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt
    branches/soc-2011-tomato/source/blender/editors/space_clip/SConscript
    branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c

Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt	2011-08-07 11:06:03 UTC (rev 39127)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/CMakeLists.txt	2011-08-07 11:11:07 UTC (rev 39128)
@@ -26,6 +26,7 @@
 	../include
 	../../blenkernel
 	../../blenloader
+	../../blenfont
 	../../blenlib
 	../../imbuf
 	../../makesdna

Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/SConscript
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/SConscript	2011-08-07 11:06:03 UTC (rev 39127)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/SConscript	2011-08-07 11:11:07 UTC (rev 39128)
@@ -3,7 +3,7 @@
 
 sources = env.Glob('*.c')
 defs = []
-incs = '../include ../../blenkernel ../../blenloader ../../blenlib ../../imbuf ../../makesdna'
+incs = '../include ../../blenkernel ../../blenloader ../../blenfont ../../blenlib ../../imbuf ../../makesdna'
 incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
 
 env.BlenderLib ( 'bf_editors_space_clip', sources, Split(incs), defs, libtype=['core'], priority=[95] )

Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c	2011-08-07 11:06:03 UTC (rev 39127)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/clip_draw.c	2011-08-07 11:11:07 UTC (rev 39128)
@@ -58,12 +58,13 @@
 #include "WM_api.h"
 #include "WM_types.h"
 
-#include "UI_interface.h"
 #include "UI_resources.h"
 #include "UI_view2d.h"
 
 #include "RNA_access.h"
 
+#include "BLF_api.h"
+
 #include "clip_intern.h"	// own include
 
 /*********************** main area drawing *************************/
@@ -684,11 +685,16 @@
 			int width, int height, float zoomx, float zoomy)
 {
 	char str[128]= {0}, state[64]= {0};
-	float x, y, dx= 0.f, dy= 0.f;
+	float x, y, dx= 0.f, dy= 0.f, fontsize;
+	uiStyle *style= U.uistyles.first;
+	int fontid= style->widget.uifont_id;
 
 	if(!TRACK_VIEW_SELECTED(sc, track))
 		return;
 
+	BLF_size(fontid, 11.f, U.dpi);
+	fontsize= BLF_height_max(fontid);
+
 	if(marker->flag&MARKER_DISABLED) {
 		if(act) UI_ThemeColor(TH_ACT_MARKER);
 		else UI_ThemeColorShade(TH_DIS_MARKER, 128);
@@ -706,7 +712,7 @@
 	}
 
 	x= (marker->pos[0]+dx)*width*sc->scale*zoomx+sc->loc[0]*zoomx;
-	y= (marker->pos[1]+dy)*height*sc->scale*zoomy-14.f*UI_DPI_FAC+sc->loc[1]*zoomy;
+	y= (marker->pos[1]+dy)*height*sc->scale*zoomy-fontsize+sc->loc[1]*zoomy;
 
 	if(marker->flag&MARKER_DISABLED) strcpy(state, "disabled");
 	else if(marker->framenr!=sc->user.framenr) strcpy(state, "estimated");
@@ -718,17 +724,20 @@
 	else
 		BLI_snprintf(str, sizeof(str), "%s", track->name);
 
-	UI_DrawString(x, y, str);
-	y-= 12.f*UI_DPI_FAC;
+	BLF_position(fontid, x, y, 0.f);
+	BLF_draw(fontid, str, strlen(str));
+	y-= fontsize;
 
 	if(track->flag&TRACK_HAS_BUNDLE) {
 		BLI_snprintf(str, sizeof(str), "Average error: %.3f", track->error);
-		UI_DrawString(x, y, str);
-		y-= 12.f*UI_DPI_FAC;
+		BLF_position(fontid, x, y, 0.f);
+		BLF_draw(fontid, str, strlen(str));
+		y-= fontsize;
 	}
 
 	if(track->flag&TRACK_LOCKED) {
-		UI_DrawString(x, y, "locked");
+		BLF_position(fontid, x, y, 0.f);
+		BLF_draw(fontid, "locked", 6);
 	}
 }
 




More information about the Bf-blender-cvs mailing list