diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_clip.py | 19 | ||||
-rw-r--r-- | source/blender/editors/space_clip/space_clip.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 34 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 8 |
4 files changed, 40 insertions, 23 deletions
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py index 42ad9daafa5..7ee46934a1c 100644 --- a/release/scripts/startup/bl_ui/space_clip.py +++ b/release/scripts/startup/bl_ui/space_clip.py @@ -124,17 +124,18 @@ class CLIP_HT_header(Header): layout.prop(sc, "mode", text="") - row = layout.row() - row.template_ID(sc, "mask", new="mask.new") + if clip: + row = layout.row() + row.template_ID(sc, "mask", new="mask.new") - layout.prop(sc, "pivot_point", text="", icon_only=True) + layout.prop(sc, "pivot_point", text="", icon_only=True) - row = layout.row(align=True) - row.prop(toolsettings, "use_proportional_edit_mask", - text="", icon_only=True) - if toolsettings.use_proportional_edit_mask: - row.prop(toolsettings, "proportional_edit_falloff", - text="", icon_only=True) + row = layout.row(align=True) + row.prop(toolsettings, "use_proportional_edit_mask", + text="", icon_only=True) + if toolsettings.use_proportional_edit_mask: + row.prop(toolsettings, "proportional_edit_falloff", + text="", icon_only=True) def draw(self, context): layout = self.layout diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c index 886b38d39a1..624ced55bb9 100644 --- a/source/blender/editors/space_clip/space_clip.c +++ b/source/blender/editors/space_clip/space_clip.c @@ -1186,7 +1186,7 @@ static void clip_main_area_draw(const bContext *C, ARegion *ar) if (sc->mode == SC_MODE_MASKEDIT) { Mask *mask = CTX_data_edit_mask(C); - if (mask) { + if (mask && clip) { ScrArea *sa = CTX_wm_area(C); int mask_width, mask_height; ED_mask_get_size(sa, &mask_width, &mask_height); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 4269e18734e..e5c8877f076 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -414,26 +414,34 @@ void projectIntViewEx(TransInfo *t, const float vec[3], int adr[2], const eV3DPr SpaceClip *sc = t->sa->spacedata.first; if (t->options & CTX_MASK) { - /* not working quite right, TODO (see above too) */ - float aspx, aspy; - float v[2]; + MovieClip *clip = ED_space_clip_get_clip(sc); - ED_space_clip_get_aspect(sc, &aspx, &aspy); + if (clip) { + /* not working quite right, TODO (see above too) */ + float aspx, aspy; + float v[2]; - copy_v2_v2(v, vec); + ED_space_clip_get_aspect(sc, &aspx, &aspy); - v[0] = v[0] / aspx; - v[1] = v[1] / aspy; + copy_v2_v2(v, vec); - BKE_mask_coord_to_movieclip(sc->clip, &sc->user, v, v); + v[0] = v[0] / aspx; + v[1] = v[1] / aspy; - v[0] = v[0] / aspx; - v[1] = v[1] / aspy; + BKE_mask_coord_to_movieclip(sc->clip, &sc->user, v, v); - ED_clip_point_stable_pos__reverse(sc, t->ar, v, v); + v[0] = v[0] / aspx; + v[1] = v[1] / aspy; - adr[0] = v[0]; - adr[1] = v[1]; + ED_clip_point_stable_pos__reverse(sc, t->ar, v, v); + + adr[0] = v[0]; + adr[1] = v[1]; + } + else { + adr[0] = 0; + adr[1] = 0; + } } else if (t->options & CTX_MOVIECLIP) { float v[2], aspx, aspy; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 95fe8beb76a..31123827c4c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -6763,6 +6763,14 @@ static void createTransMaskingData(bContext *C, TransInfo *t) if (!mask) return; + if (t->spacetype == SPACE_CLIP) { + SpaceClip *sc = t->sa->spacedata.first; + MovieClip *clip = ED_space_clip_get_clip(sc); + if (!clip) { + return; + } + } + /* count */ for (masklay = mask->masklayers.first; masklay; masklay = masklay->next) { MaskSpline *spline; |