From 14a68d3a5f325373e575c28405064c4782a8ff97 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 19 Jun 2012 14:09:44 +0000 Subject: Mark context as const when it's possible and avoid typecasts from const bContext* to bContext* --- source/blender/editors/mask/mask_edit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/mask/mask_edit.c') diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 52711c8da55..3396f664820 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -76,7 +76,7 @@ int ED_maskedit_mask_poll(bContext *C) /********************** registration *********************/ -void ED_mask_mouse_pos(bContext *C, wmEvent *event, float co[2]) +void ED_mask_mouse_pos(const bContext *C, wmEvent *event, float co[2]) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -92,7 +92,7 @@ void ED_mask_mouse_pos(bContext *C, wmEvent *event, float co[2]) /* input: x/y - mval space * output: xr/yr - mask point space */ -void ED_mask_point_pos(bContext *C, float x, float y, float *xr, float *yr) +void ED_mask_point_pos(const bContext *C, float x, float y, float *xr, float *yr) { SpaceClip *sc = CTX_wm_space_clip(C); float co[2]; @@ -110,7 +110,7 @@ void ED_mask_point_pos(bContext *C, float x, float y, float *xr, float *yr) *yr = co[1]; } -void ED_mask_point_pos__reverse(bContext *C, float x, float y, float *xr, float *yr) +void ED_mask_point_pos__reverse(const bContext *C, float x, float y, float *xr, float *yr) { SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); @@ -132,7 +132,7 @@ void ED_mask_point_pos__reverse(bContext *C, float x, float y, float *xr, float *yr = co[1]; } -void ED_mask_size(bContext *C, int *width, int *height) +void ED_mask_size(const bContext *C, int *width, int *height) { ScrArea *sa = CTX_wm_area(C); if (sa && sa->spacedata.first) { @@ -154,7 +154,7 @@ void ED_mask_size(bContext *C, int *width, int *height) *height = 0; } -void ED_mask_aspect(bContext *C, float *aspx, float *aspy) +void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) { SpaceClip *sc = CTX_wm_space_clip(C); @@ -168,7 +168,7 @@ void ED_mask_aspect(bContext *C, float *aspx, float *aspy) } } -void ED_mask_pixelspace_factor(bContext *C, float *scalex, float *scaley) +void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) { SpaceClip *sc = CTX_wm_space_clip(C); -- cgit v1.2.3 From 4f044f4ec1b682fb5b13f5aa62201314d855477b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 19 Jun 2012 14:26:29 +0000 Subject: Changes in clip editor's public api to make it's more clear whether getting of some property happens or this property is being changed. Also made it more clear whether affecting property belongs to clip or mask datablock. --- source/blender/editors/mask/mask_edit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/mask/mask_edit.c') diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 3396f664820..fdf72043464 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -138,7 +138,7 @@ void ED_mask_size(const bContext *C, int *width, int *height) if (sa && sa->spacedata.first) { if (sa->spacetype == SPACE_CLIP) { SpaceClip *sc = sa->spacedata.first; - ED_space_clip_mask_size(sc, width, height); + ED_space_clip_get_mask_size(sc, width, height); return; } else if (sa->spacetype == SPACE_SEQ) { @@ -159,7 +159,7 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - ED_space_clip_mask_aspect(sc, aspx, aspy); + ED_space_clip_get_mask_aspect(sc, aspx, aspy); } else { /* possible other spaces from which mask editing is available */ @@ -177,9 +177,9 @@ void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) int width, height; float zoomx, zoomy, aspx, aspy; - ED_space_clip_size(sc, &width, &height); - ED_space_clip_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_aspect(sc, &aspx, &aspy); + ED_space_clip_get_clip_size(sc, &width, &height); + ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + ED_space_clip_get_clip_aspect(sc, &aspx, &aspy); *scalex = ((float)width * aspx) * zoomx; *scaley = ((float)height * aspy) * zoomy; -- cgit v1.2.3 From 4b955a60eda06526e3a793fd9bb3c942b641d877 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 20 Jun 2012 10:28:51 +0000 Subject: Cleanup up space clip API: - Remove clip/mask specific size/aspect getters, they shall just use the same size/aspect ratio. - Made size getter (and some other public functions) accept context instead of SpaceClip. Currently only SpaceClip is being get from this context, but later it'll be helpful when adding support of editing mask without opening clip in clip editor (in this case using render resolution for mask would be ideal, but this requires knowing scene in size getter). - Rearrange some functions in clip_editor.c for easier navigation in the file. --- source/blender/editors/mask/mask_edit.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'source/blender/editors/mask/mask_edit.c') diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index fdf72043464..76fc7126cf2 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -121,7 +121,7 @@ void ED_mask_point_pos__reverse(const bContext *C, float x, float y, float *xr, co[0] = x; co[1] = y; BKE_mask_coord_to_movieclip(sc->clip, &sc->user, co, co); - ED_clip_point_stable_pos__reverse(sc, ar, co, co); + ED_clip_point_stable_pos__reverse(C, co, co); } else { /* possible other spaces from which mask editing is available */ @@ -137,8 +137,7 @@ void ED_mask_size(const bContext *C, int *width, int *height) ScrArea *sa = CTX_wm_area(C); if (sa && sa->spacedata.first) { if (sa->spacetype == SPACE_CLIP) { - SpaceClip *sc = sa->spacedata.first; - ED_space_clip_get_mask_size(sc, width, height); + ED_space_clip_get_size(C, width, height); return; } else if (sa->spacetype == SPACE_SEQ) { @@ -159,7 +158,7 @@ void ED_mask_aspect(const bContext *C, float *aspx, float *aspy) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - ED_space_clip_get_mask_aspect(sc, aspx, aspy); + ED_space_clip_get_aspect(sc, aspx, aspy); } else { /* possible other spaces from which mask editing is available */ @@ -173,13 +172,12 @@ void ED_mask_pixelspace_factor(const bContext *C, float *scalex, float *scaley) SpaceClip *sc = CTX_wm_space_clip(C); if (sc) { - ARegion *ar = CTX_wm_region(C); int width, height; float zoomx, zoomy, aspx, aspy; - ED_space_clip_get_clip_size(sc, &width, &height); - ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); - ED_space_clip_get_clip_aspect(sc, &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); *scalex = ((float)width * aspx) * zoomx; *scaley = ((float)height * aspy) * zoomy; -- cgit v1.2.3 From 238d3fa4bbd63e58538b67ff00fd655fbebc8b49 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 22 Jun 2012 11:53:49 +0000 Subject: mask re-key feature - mango request. ability to reset selected points shape key data. useful if you add many keys to one part of a curve, then later want to key another part - but dont want to continuously make the same corrections. --- source/blender/editors/mask/mask_edit.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/editors/mask/mask_edit.c') diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 76fc7126cf2..6e0da5fd756 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -237,6 +237,7 @@ void ED_operatortypes_mask(void) WM_operatortype_append(MASK_OT_shape_key_insert); WM_operatortype_append(MASK_OT_shape_key_clear); WM_operatortype_append(MASK_OT_shape_key_feather_reset); + WM_operatortype_append(MASK_OT_shape_key_rekey); } void ED_keymap_mask(wmKeyConfig *keyconf) -- cgit v1.2.3