proportional editing keys now work when editing masks.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user