Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-04-28 14:09:58 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-04-28 14:09:58 +0400
commita434572654d95b2910324f3c6125580f4ee28afe (patch)
treefca1e17899feedc1e51a49f66f9c0c27461d64ff /source/blender/editors/space_image
parent54911f52d87be169bf62ffc8088c81d3b7580681 (diff)
Camera tracking: if there's no image for current frame display default grid
and allow to interact with tracks for operators which doesn't require image. Merged from tomato branch: svn merge ^/branches/soc-2011-tomato -r45624:45625
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_draw.c61
1 files changed, 1 insertions, 60 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 29bd5f5117d..793e5712c8c 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -334,65 +334,6 @@ void ED_image_draw_info(ARegion *ar, int color_manage, int channels, int x, int
/* image drawing */
-static void draw_image_grid(ARegion *ar, float zoomx, float zoomy)
-{
- float gridsize, gridstep = 1.0f / 32.0f;
- float fac, blendfac;
- int x1, y1, x2, y2;
-
- /* the image is located inside (0,0),(1, 1) as set by view2d */
- UI_ThemeColorShade(TH_BACK, 20);
-
- UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x1, &y1);
- UI_view2d_to_region_no_clip(&ar->v2d, 1.0f, 1.0f, &x2, &y2);
- glRectf(x1, y1, x2, y2);
-
- /* gridsize adapted to zoom level */
- gridsize = 0.5f * (zoomx + zoomy);
- if (gridsize <= 0.0f) return;
-
- if (gridsize < 1.0f) {
- while (gridsize < 1.0f) {
- gridsize *= 4.0f;
- gridstep *= 4.0f;
- }
- }
- else {
- while (gridsize >= 4.0f) {
- gridsize /= 4.0f;
- gridstep /= 4.0f;
- }
- }
-
- /* the fine resolution level */
- blendfac = 0.25f * gridsize - floorf(0.25f * gridsize);
- CLAMP(blendfac, 0.0f, 1.0f);
- UI_ThemeColorShade(TH_BACK, (int)(20.0f * (1.0f - blendfac)));
-
- fac = 0.0f;
- glBegin(GL_LINES);
- while (fac < 1.0f) {
- glVertex2f(x1, y1 * (1.0f - fac) + y2 * fac);
- glVertex2f(x2, y1 * (1.0f - fac) + y2 * fac);
- glVertex2f(x1 * (1.0f - fac) + x2 * fac, y1);
- glVertex2f(x1 * (1.0f - fac) + x2 * fac, y2);
- fac += gridstep;
- }
-
- /* the large resolution level */
- UI_ThemeColor(TH_BACK);
-
- fac = 0.0f;
- while (fac < 1.0f) {
- glVertex2f(x1, y1 * (1.0f - fac) + y2 * fac);
- glVertex2f(x2, y1 * (1.0f - fac) + y2 * fac);
- glVertex2f(x1 * (1.0f - fac) + x2 * fac, y1);
- glVertex2f(x1 * (1.0f - fac) + x2 * fac, y2);
- fac += 4.0f * gridstep;
- }
- glEnd();
-}
-
static void sima_draw_alpha_pixels(float x1, float y1, int rectx, int recty, unsigned int *recti)
{
@@ -781,7 +722,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene)
/* draw the image or grid */
if (ibuf == NULL)
- draw_image_grid(ar, zoomx, zoomy);
+ ED_region_grid_draw(ar, zoomx, zoomy);
else if (sima->flag & SI_DRAW_TILE)
draw_image_buffer_repeated(sima, ar, scene, ima, ibuf, zoomx, zoomy);
else if (ima && (ima->tpageflag & IMA_TILES))