Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-05-30 12:02:49 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-30 12:02:49 +0400
commit47584648dc1b31ae8c8745269d04938b4671a200 (patch)
treed2d5fa6af36c4612118da804b736eaf40308ac45 /source/blender/editors/object/object_ops.c
parent22982e93511095d21d74d374fee978ca2d3bd910 (diff)
split up proportional editing keymap functions (adding this in tomato branch was messy)
Diffstat (limited to 'source/blender/editors/object/object_ops.c')
-rw-r--r--source/blender/editors/object/object_ops.c65
1 files changed, 33 insertions, 32 deletions
diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c
index 01f6b641709..6e653eff57c 100644
--- a/source/blender/editors/object/object_ops.c
+++ b/source/blender/editors/object/object_ops.c
@@ -297,7 +297,8 @@ void ED_keymap_object(wmKeyConfig *keyconf)
keymap->poll = object_mode_poll;
/* object mode supports PET now */
- ED_object_generic_keymap(keyconf, keymap, 1);
+ ED_keymap_proportional_cycle(keyconf, keymap);
+ ED_keymap_proportional_obmode(keyconf, keymap);
WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
@@ -420,41 +421,41 @@ void ED_keymap_object(wmKeyConfig *keyconf)
/* menus */
WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
- ED_object_generic_keymap(keyconf, keymap, 2);
+ ED_keymap_proportional_cycle(keyconf, keymap);
+ ED_keymap_proportional_editmode(keyconf, keymap, FALSE);
}
-void ED_object_generic_keymap(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap, int do_pet)
+void ED_keymap_proportional_cycle(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap)
{
wmKeyMapItem *kmi;
- /* used by mesh, curve & lattice only */
- if (do_pet) {
- /* context ops */
- kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
- RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff");
-
- // Object mode
- if (do_pet == TRUE) {
-
- 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_objects");
-
- }
- else { // Edit mode
-
- kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
- RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
- RNA_string_set(kmi->ptr, "value_1", "DISABLED");
- RNA_string_set(kmi->ptr, "value_2", "ENABLED");
-
- /* for modes/object types that allow 'connected' mode, add the Alt O key */
- if (do_pet == 3) {
- kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
- RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
- RNA_string_set(kmi->ptr, "value_1", "DISABLED");
- RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
- }
- }
- }
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0);
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit_falloff");
+}
+
+void ED_keymap_proportional_obmode(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_objects");
}
+void ED_keymap_proportional_editmode(struct wmKeyConfig *UNUSED(keyconf), struct wmKeyMap *keymap,
+ const short do_connected)
+{
+ wmKeyMapItem *kmi;
+
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, 0, 0);
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
+ RNA_string_set(kmi->ptr, "value_1", "DISABLED");
+ RNA_string_set(kmi->ptr, "value_2", "ENABLED");
+
+ /* for modes/object types that allow 'connected' mode, add the Alt O key */
+ if (do_connected) {
+ kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0);
+ RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_edit");
+ RNA_string_set(kmi->ptr, "value_1", "DISABLED");
+ RNA_string_set(kmi->ptr, "value_2", "CONNECTED");
+ }
+}