proportional editing keys now work when editing masks.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 30 May 2012 08:20:20 +0000 (08:20 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 30 May 2012 08:20:20 +0000 (08:20 +0000)
source/blender/editors/include/ED_object.h
source/blender/editors/mask/mask_editor.c
source/blender/editors/object/object_ops.c
source/blender/editors/space_clip/space_clip.c

index 8dc83df297712fa246ea28d5376f53d171a4618e..9c10a270ef8fd432d927f52c690cd98be5f115fe 100644 (file)
@@ -90,6 +90,7 @@ struct Base *ED_object_scene_link(struct Scene *scene, struct Object *ob);
 
 void ED_keymap_proportional_cycle(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap);
 void ED_keymap_proportional_obmode(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap);
+void ED_keymap_proportional_maskmode(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap);
 void ED_keymap_proportional_editmode(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap,
                                      const short do_connected);
 
index aa8a9cbddcc1f82b5c8e50d821331e4d72341a6d..a0b47be8ea3a025ec86b17117f3d14b4b8ffa4e8 100644 (file)
@@ -42,6 +42,7 @@
 
 #include "ED_screen.h"
 #include "ED_mask.h"
+#include "ED_object.h" /* ED_keymap_proportional_maskmode only */
 #include "ED_clip.h"
 #include "ED_transform.h"
 
@@ -232,6 +233,10 @@ void ED_keymap_mask(wmKeyConfig *keyconf)
 
        WM_keymap_add_item(keymap, "MASK_OT_new", NKEY, KM_PRESS, KM_ALT, 0);
 
+       /* mask mode supports PET now */
+       ED_keymap_proportional_cycle(keyconf, keymap);
+       ED_keymap_proportional_maskmode(keyconf, keymap);
+
        /* geometry */
        WM_keymap_add_item(keymap, "MASK_OT_add_vertex_slide", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
        WM_keymap_add_item(keymap, "MASK_OT_add_feather_vertex_slide", LEFTMOUSE, KM_PRESS, KM_SHIFT, 0);
index 6e653eff57c1d4e140031585b02efe9ea2f08496..d0a93302b7fdb28b500eb82f19869e7faf994769 100644 (file)
@@ -441,6 +441,14 @@ void ED_keymap_proportional_obmode(struct wmKeyConfig *UNUSED(keyconf), struct w
        RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_objects");
 }
 
+void ED_keymap_proportional_maskmode(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap)
+{
+       wmKeyMapItem *kmi;
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "tool_settings.use_proportional_edit_mask");
+}
+
 void ED_keymap_proportional_editmode(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap,
                                      const short do_connected)
 {
index 7f77dcb56590218c73be923b5e6e318dda1085be..8c5ae38011dc2b84d112e67133bd39de2878d050 100644 (file)
@@ -1317,6 +1317,26 @@ static void clip_header_area_draw(const bContext *C, ARegion *ar)
        ED_region_header(C, ar);
 }
 
+static void clip_header_area_listener(ARegion *ar, wmNotifier *wmn)
+{
+       /* context changes */
+       switch (wmn->category) {
+               case NC_SCENE:
+                       switch (wmn->data) {
+                               /* for proportional editmode only */
+                               case ND_TOOLSETTINGS:
+                                       /* TODO - should do this when in mask mode only but no datas available */
+                                       // if(sc->mode == SC_MODE_MASKEDITING)
+                                       {
+                                               ED_region_tag_redraw(ar);
+                                       }
+                                       break;
+                       }
+                       break;
+       }
+}
+
+
 /****************** tools region ******************/
 
 /* add handlers, stuff you only do once or on area/region changes */
@@ -1478,6 +1498,7 @@ void ED_spacetype_clip(void)
 
        art->init = clip_header_area_init;
        art->draw = clip_header_area_draw;
+       art->listener = clip_header_area_listener;
 
        BLI_addhead(&st->regiontypes, art);