Revision: 49214
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49214
Author: campbellbarton
Date: 2012-07-25 16:30:53 +0000 (Wed, 25 Jul 2012)
Log Message:
-----------
match function names for clip/image spaces
Modified Paths:
--------------
trunk/blender/source/blender/editors/include/ED_image.h
trunk/blender/source/blender/editors/mask/mask_edit.c
trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
trunk/blender/source/blender/editors/sculpt_paint/sculpt_uv.c
trunk/blender/source/blender/editors/space_image/image_draw.c
trunk/blender/source/blender/editors/space_image/image_edit.c
trunk/blender/source/blender/editors/space_image/image_ops.c
trunk/blender/source/blender/editors/space_image/space_image.c
trunk/blender/source/blender/editors/transform/transform.c
trunk/blender/source/blender/editors/transform/transform_constraints.c
trunk/blender/source/blender/editors/transform/transform_conversions.c
trunk/blender/source/blender/editors/transform/transform_generics.c
trunk/blender/source/blender/editors/transform/transform_snap.c
trunk/blender/source/blender/editors/uvedit/uvedit_buttons.c
trunk/blender/source/blender/editors/uvedit/uvedit_draw.c
trunk/blender/source/blender/editors/uvedit/uvedit_ops.c
trunk/blender/source/blender/editors/uvedit/uvedit_unwrap_ops.c
trunk/blender/source/blender/makesrna/intern/rna_space.c
trunk/blender/source/blenderplayer/bad_level_call_stubs/stubs.c
Modified: trunk/blender/source/blender/editors/include/ED_image.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_image.h 2012-07-25
16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/include/ED_image.h 2012-07-25
16:30:53 UTC (rev 49214)
@@ -50,17 +50,17 @@
void ED_space_image_release_buffer(struct SpaceImage *sima, void *lock);
int ED_space_image_has_buffer(struct SpaceImage *sima);
-void ED_space_image_size(struct SpaceImage *sima, int *width, int *height);
-void ED_space_image_aspect(struct SpaceImage *sima, float *aspx, float *aspy);
-void ED_space_image_zoom(struct SpaceImage *sima, struct ARegion *ar, float
*zoomx, float *zoomy);
-void ED_space_image_uv_aspect(struct SpaceImage *sima, float *aspx, float
*aspy);
+void ED_space_image_get_size(struct SpaceImage *sima, int *width, int *height);
+void ED_space_image_get_aspect(struct SpaceImage *sima, float *aspx, float
*aspy);
+void ED_space_image_get_zoom(struct SpaceImage *sima, struct ARegion *ar,
float *zoomx, float *zoomy);
+void ED_space_image_get_uv_aspect(struct SpaceImage *sima, float *aspx, float
*aspy);
void ED_space_image_paint_update(struct wmWindowManager *wm, struct
ToolSettings *settings);
void ED_space_image_uv_sculpt_update(struct wmWindowManager *wm, struct
ToolSettings *settings);
-void ED_image_size(struct Image *ima, int *width, int *height);
-void ED_image_aspect(struct Image *ima, float *aspx, float *aspy);
-void ED_image_uv_aspect(struct Image *ima, float *aspx, float *aspy);
+void ED_image_get_size(struct Image *ima, int *width, int *height);
+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);
int ED_space_image_show_render(struct SpaceImage *sima);
int ED_space_image_show_paint(struct SpaceImage *sima);
Modified: trunk/blender/source/blender/editors/mask/mask_edit.c
===================================================================
--- trunk/blender/source/blender/editors/mask/mask_edit.c 2012-07-25
16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/mask/mask_edit.c 2012-07-25
16:30:53 UTC (rev 49214)
@@ -226,7 +226,7 @@
case SPACE_IMAGE:
{
SpaceImage *sima = sa->spacedata.first;
- ED_space_image_size(sima, width, height);
+ ED_space_image_get_size(sima, width, height);
break;
}
default:
@@ -263,7 +263,7 @@
case SPACE_IMAGE:
{
SpaceImage *sima = sa->spacedata.first;
- ED_space_image_uv_aspect(sima, aspx, aspy);
+ ED_space_image_get_uv_aspect(sima, aspx, aspy);
break;
}
default:
@@ -281,25 +281,53 @@
void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley)
{
- SpaceClip *sc = CTX_wm_space_clip(C);
+ ScrArea *sa = CTX_wm_area(C);
+ if (sa && sa->spacedata.first) {
+ switch (sa->spacetype) {
+ case SPACE_CLIP:
+ {
+ SpaceClip *sc = sa->spacedata.first;
+ int width, height;
+ float zoomx, zoomy, aspx, aspy;
- /* MASKTODO */
+ ED_space_clip_get_size(C, &width, &height);
+ ED_space_clip_get_zoom(C, &zoomx, &zoomy);
+ ED_space_clip_get_aspect(sc, &aspx, &aspy);
- if (sc) {
- int width, height;
- float zoomx, zoomy, aspx, aspy;
+ *scalex = ((float)width * aspx) * zoomx;
+ *scaley = ((float)height * aspy) * zoomy;
+ break;
+ }
+ case SPACE_SEQ:
+ {
+ *scalex = *scaley = 1.0f; /* MASKTODO? */
+ break;
+ }
+ case SPACE_IMAGE:
+ {
+ SpaceImage *sima = sa->spacedata.first;
+ ARegion *ar = CTX_wm_region(C);
+ int width, height;
+ float zoomx, zoomy, aspx, aspy;
- ED_space_clip_get_size(C, &width, &height);
- ED_space_clip_get_zoom(C, &zoomx, &zoomy);
- ED_space_clip_get_aspect(sc, &aspx, &aspy);
+ ED_space_image_get_size(sima, &width, &height);
+ ED_space_image_get_zoom(sima, ar, &zoomx,
&zoomy);
+ ED_space_image_get_uv_aspect(sima, &aspx,
&aspy);
- *scalex = ((float)width * aspx) * zoomx;
- *scaley = ((float)height * aspy) * zoomy;
+ *scalex = ((float)width * aspx) * zoomx;
+ *scaley = ((float)height * aspy) * zoomy;
+ break;
+ }
+ default:
+ /* possible other spaces from which mask
editing is available */
+ BLI_assert(0);
+ *scalex = *scaley = 1.0f;
+ break;
+ }
}
else {
- /* possible other spaces from which mask editing is available */
- *scalex = 1.0f;
- *scaley = 1.0f;
+ BLI_assert(0);
+ *scalex = *scaley = 1.0f;
}
}
Modified: trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
2012-07-25 16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/sculpt_paint/paint_image.c
2012-07-25 16:30:53 UTC (rev 49214)
@@ -5201,7 +5201,7 @@
SpaceImage *sima = CTX_wm_space_image(C);
ARegion *ar = CTX_wm_region(C);
- ED_space_image_zoom(sima, ar, zoomx, zoomy);
+ ED_space_image_get_zoom(sima, ar, zoomx, zoomy);
return 1;
}
Modified: trunk/blender/source/blender/editors/sculpt_paint/sculpt_uv.c
===================================================================
--- trunk/blender/source/blender/editors/sculpt_paint/sculpt_uv.c
2012-07-25 16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/sculpt_paint/sculpt_uv.c
2012-07-25 16:30:53 UTC (rev 49214)
@@ -315,8 +315,8 @@
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1],
&co[0], &co[1]);
sima = CTX_wm_space_image(C);
- ED_space_image_size(sima, &width, &height);
- ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+ ED_space_image_get_size(sima, &width, &height);
+ ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
radius = BKE_brush_size_get(scene, brush) / (width * zoomx);
aspectRatio = width / (float)height;
@@ -683,8 +683,8 @@
radius = BKE_brush_size_get(scene, brush);
sima = CTX_wm_space_image(C);
- ED_space_image_size(sima, &width, &height);
- ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+ ED_space_image_get_size(sima, &width, &height);
+ ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
aspectRatio = width / (float)height;
radius /= (width * zoomx);
Modified: trunk/blender/source/blender/editors/space_image/image_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_draw.c
2012-07-25 16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/space_image/image_draw.c
2012-07-25 16:30:53 UTC (rev 49214)
@@ -710,7 +710,7 @@
what_image(sima);
if (sima->image) {
- ED_image_aspect(sima->image, &xuser_asp, &yuser_asp);
+ ED_image_get_aspect(sima->image, &xuser_asp, &yuser_asp);
/* UGLY hack? until now iusers worked fine... but for flipbook
viewer we need this */
if (sima->image->type == IMA_TYPE_COMPOSITE) {
@@ -727,7 +727,7 @@
/* retrieve the image and information about it */
ima = ED_space_image(sima);
- ED_space_image_zoom(sima, ar, &zoomx, &zoomy);
+ ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy);
show_viewer = (ima && ima->source == IMA_SRC_VIEWER);
show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT);
Modified: trunk/blender/source/blender/editors/space_image/image_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_edit.c
2012-07-25 16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/space_image/image_edit.c
2012-07-25 16:30:53 UTC (rev 49214)
@@ -136,7 +136,7 @@
return has_buffer;
}
-void ED_image_size(Image *ima, int *width, int *height)
+void ED_image_get_size(Image *ima, int *width, int *height)
{
ImBuf *ibuf = NULL;
void *lock;
@@ -157,7 +157,7 @@
BKE_image_release_ibuf(ima, lock);
}
-void ED_space_image_size(SpaceImage *sima, int *width, int *height)
+void ED_space_image_get_size(SpaceImage *sima, int *width, int *height)
{
Scene *scene = sima->iuser.scene;
ImBuf *ibuf;
@@ -190,7 +190,7 @@
ED_space_image_release_buffer(sima, lock);
}
-void ED_image_aspect(Image *ima, float *aspx, float *aspy)
+void ED_image_get_aspect(Image *ima, float *aspx, float *aspy)
{
*aspx = *aspy = 1.0;
@@ -204,27 +204,27 @@
*aspy = ima->aspy / ima->aspx;
}
-void ED_space_image_aspect(SpaceImage *sima, float *aspx, float *aspy)
+void ED_space_image_get_aspect(SpaceImage *sima, float *aspx, float *aspy)
{
- ED_image_aspect(ED_space_image(sima), aspx, aspy);
+ ED_image_get_aspect(ED_space_image(sima), aspx, aspy);
}
-void ED_space_image_zoom(SpaceImage *sima, ARegion *ar, float *zoomx, float
*zoomy)
+void ED_space_image_get_zoom(SpaceImage *sima, ARegion *ar, float *zoomx,
float *zoomy)
{
int width, height;
- ED_space_image_size(sima, &width, &height);
+ ED_space_image_get_size(sima, &width, &height);
*zoomx = (float)(ar->winrct.xmax - ar->winrct.xmin + 1) /
(float)((ar->v2d.cur.xmax - ar->v2d.cur.xmin) * width);
*zoomy = (float)(ar->winrct.ymax - ar->winrct.ymin + 1) /
(float)((ar->v2d.cur.ymax - ar->v2d.cur.ymin) * height);
}
-void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
+void ED_space_image_get_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
{
int w, h;
- ED_space_image_aspect(sima, aspx, aspy);
- ED_space_image_size(sima, &w, &h);
+ ED_space_image_get_aspect(sima, aspx, aspy);
+ ED_space_image_get_size(sima, &w, &h);
*aspx *= (float)w;
*aspy *= (float)h;
@@ -239,12 +239,12 @@
}
}
-void ED_image_uv_aspect(Image *ima, float *aspx, float *aspy)
+void ED_image_get_uv_aspect(Image *ima, float *aspx, float *aspy)
{
int w, h;
- ED_image_aspect(ima, aspx, aspy);
- ED_image_size(ima, &w, &h);
+ ED_image_get_aspect(ima, aspx, aspy);
+ ED_image_get_size(ima, &w, &h);
*aspx *= (float)w;
*aspy *= (float)h;
Modified: trunk/blender/source/blender/editors/space_image/image_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_image/image_ops.c
2012-07-25 16:03:08 UTC (rev 49213)
+++ trunk/blender/source/blender/editors/space_image/image_ops.c
2012-07-25 16:30:53 UTC (rev 49214)
@@ -91,7 +91,7 @@
if (sima->zoom < 0.1f || sima->zoom > 4.0f) {
/* check zoom limits */
- ED_space_image_size(sima, &width, &height);
+ ED_space_image_get_size(sima, &width, &height);
width *= sima->zoom;
height *= sima->zoom;
@@ -107,8 +107,8 @@
@@ Diff output truncated at 10240 characters. @@
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs