[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49242] branches/soc-2011-tomato: Merging r49239 through r49241 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Thu Jul 26 12:06:56 CEST 2012


Revision: 49242
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49242
Author:   nazgul
Date:     2012-07-26 10:06:56 +0000 (Thu, 26 Jul 2012)
Log Message:
-----------
Merging r49239 through r49241 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49239
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49241

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py
    branches/soc-2011-tomato/source/blender/editors/include/ED_image.h
    branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h
    branches/soc-2011-tomato/source/blender/editors/include/ED_uvedit.h
    branches/soc-2011-tomato/source/blender/editors/mask/mask_edit.c
    branches/soc-2011-tomato/source/blender/editors/mask/mask_intern.h
    branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c
    branches/soc-2011-tomato/source/blender/editors/space_clip/tracking_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_image/image_edit.c
    branches/soc-2011-tomato/source/blender/editors/space_image/space_image.c
    branches/soc-2011-tomato/source/blender/editors/uvedit/uvedit_draw.c
    branches/soc-2011-tomato/source/blender/makesdna/DNA_space_types.h

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49238
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49241

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_image.py	2012-07-26 10:06:56 UTC (rev 49242)
@@ -409,6 +409,10 @@
             row = layout.row()
             row.template_ID(sima, "mask", new="mask.new")
 
+            # reused for mask
+            uvedit = sima.uv_editor
+            layout.prop(uvedit, "pivot_point", text="", icon_only=True)
+
         if ima:
             # layers
             layout.template_image_layers(ima, iuser)

Modified: branches/soc-2011-tomato/source/blender/editors/include/ED_image.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/include/ED_image.h	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/include/ED_image.h	2012-07-26 10:06:56 UTC (rev 49242)
@@ -63,6 +63,8 @@
 void ED_image_get_aspect(struct Image *ima, float *aspx, float *aspy);
 void ED_image_get_uv_aspect(struct Image *ima, float *aspx, float *aspy);
 void ED_image_mouse_pos(struct SpaceImage *sima, struct ARegion *ar, struct wmEvent *event, float co[2]);
+void ED_image_point_pos(struct SpaceImage *sima, struct ARegion *ar, float x, float y, float *xr, float *yr);
+void ED_image_point_pos__reverse(struct SpaceImage *sima, struct ARegion *ar, const float co[2], float r_co[2]);
 
 int ED_space_image_show_render(struct SpaceImage *sima);
 int ED_space_image_show_paint(struct SpaceImage *sima);

Modified: branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/include/ED_mask.h	2012-07-26 10:06:56 UTC (rev 49242)
@@ -37,6 +37,7 @@
 
 /* mask_edit.c */
 void ED_mask_size(const struct bContext *C, int *width, int *height);
+void ED_mask_zoom(const struct bContext *C, float *zoomx, float *zoomy);
 void ED_mask_aspect(const struct bContext *C, float *aspx, float *aspy);
 
 void ED_operatortypes_mask(void);

Modified: branches/soc-2011-tomato/source/blender/editors/include/ED_uvedit.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/include/ED_uvedit.h	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/include/ED_uvedit.h	2012-07-26 10:06:56 UTC (rev 49242)
@@ -85,6 +85,7 @@
 void ED_unwrap_lscm(struct Scene *scene, struct Object *obedit, const short sel);
 
 /* uvedit_draw.c */
+void draw_image_cursor(struct SpaceImage *sima, struct ARegion *ar);
 void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit, struct Object *obact);
 
 /* uvedit_buttons.c */


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49238
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49241

Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_edit.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_edit.c	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_edit.c	2012-07-26 10:06:56 UTC (rev 49242)
@@ -155,8 +155,15 @@
 				break;
 			case SPACE_IMAGE:
 			{
-				//SpaceImage *sima = sa->spacedata.first;
-				zero_v2(co); /* MASKTODO */
+				int width, height;
+				float frame_size[2];
+				SpaceImage *sima = sa->spacedata.first;
+				ARegion *ar = CTX_wm_region(C);
+				ED_space_image_get_size(sima, &width, &height);
+				frame_size[0] = width;
+				frame_size[1] = height;
+				ED_image_point_pos(sima, ar, x, y, &co[0], &co[1]);
+				BKE_mask_coord_from_frame(co, co, frame_size);
 				break;
 			}
 			default:
@@ -195,8 +202,21 @@
 				zero_v2(co); /* MASKTODO */
 				break;
 			case SPACE_IMAGE:
-				zero_v2(co); /* MASKTODO */
+			{
+				int width, height;
+				float frame_size[2];
+				SpaceImage *sima = sa->spacedata.first;
+				ARegion *ar = CTX_wm_region(C);
+				ED_space_image_get_size(sima, &width, &height);
+				frame_size[0] = width;
+				frame_size[1] = height;
+
+				co[0] = x;
+				co[1] = y;
+				BKE_mask_coord_to_frame(co, co, frame_size);
+				ED_image_point_pos__reverse(sima, ar, co, co);
 				break;
+			}
 			default:
 				/* possible other spaces from which mask editing is available */
 				BLI_assert(0);
@@ -251,6 +271,41 @@
 	}
 }
 
+void ED_mask_zoom(const bContext *C, float *zoomx, float *zoomy)
+{
+	ScrArea *sa = CTX_wm_area(C);
+	if (sa && sa->spacedata.first) {
+		switch (sa->spacetype) {
+			case SPACE_CLIP:
+			{
+				ED_space_clip_get_zoom(C, zoomx, zoomy);
+				break;
+			}
+			case SPACE_SEQ:
+			{
+				*zoomx = *zoomy = 1.0f;
+				break;
+			}
+			case SPACE_IMAGE:
+			{
+				SpaceImage *sima = sa->spacedata.first;
+				ARegion *ar = CTX_wm_region(C);
+				ED_space_image_get_zoom(sima, ar, zoomx, zoomy);
+				break;
+			}
+			default:
+				/* possible other spaces from which mask editing is available */
+				BLI_assert(0);
+				*zoomx = *zoomy = 1.0f;
+				break;
+		}
+	}
+	else {
+		BLI_assert(0);
+		*zoomx = *zoomy = 1.0f;
+	}
+}
+
 void ED_mask_aspect(const bContext *C, float *aspx, float *aspy)
 {
 	ScrArea *sa = CTX_wm_area(C);
@@ -472,6 +527,8 @@
 	WM_keymap_add_item(keymap, "MASK_OT_shape_key_insert", IKEY, KM_PRESS, 0, 0);
 	WM_keymap_add_item(keymap, "MASK_OT_shape_key_clear", IKEY, KM_PRESS, KM_ALT, 0);
 
+	/* for image editor only */
+	WM_keymap_add_item(keymap, "UV_OT_cursor_set", ACTIONMOUSE, KM_PRESS, 0, 0);
 
 	transform_keymap_for_space(keyconf, keymap, SPACE_CLIP);
 }

Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_intern.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_intern.h	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_intern.h	2012-07-26 10:06:56 UTC (rev 49242)
@@ -105,6 +105,9 @@
 void ED_mask_point_pos(const struct bContext *C, float x, float y, float *xr, float *yr);
 void ED_mask_point_pos__reverse(const struct bContext *C, float x, float y, float *xr, float *yr);
 
+void ED_mask_get_zoom(const bContext *C, float *zoomx, float *zoomy);
+void ED_mask_get_size(const bContext *C, float *zoomx, float *zoomy);
+
 /* mask_shapekey.c */
 void MASK_OT_shape_key_insert(struct wmOperatorType *ot);
 void MASK_OT_shape_key_clear(struct wmOperatorType *ot);

Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c	2012-07-26 10:06:56 UTC (rev 49242)
@@ -592,10 +592,9 @@
 
 	mode = RNA_int_get(op->ptr, "gesture_mode");
 
-	/* TODO - make generic! - this is SpaceClip only! */
 	/* compute ellipse and position in unified coordinates */
-	ED_space_clip_get_size(C, &width, &height);
-	ED_space_clip_get_zoom(C, &zoomx, &zoomy);
+	ED_mask_size(C, &width, &height);
+	ED_mask_zoom(C, &zoomx, &zoomy);
 	width = height = MAX2(width, height);
 
 	ellipse[0] = width * zoomx / radius;
@@ -639,7 +638,6 @@
 	return OPERATOR_CANCELLED;
 }
 
-/* MASKTODO - image space */
 void MASK_OT_select_circle(wmOperatorType *ot)
 {
 	/* identifiers */

Modified: branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c	2012-07-26 10:06:08 UTC (rev 49241)
+++ branches/soc-2011-tomato/source/blender/editors/space_clip/space_clip.c	2012-07-26 10:06:56 UTC (rev 49242)
@@ -570,10 +570,10 @@
 
 	WM_keymap_add_item(keymap, "CLIP_OT_solve_camera", SKEY, KM_PRESS, KM_SHIFT, 0);
 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list