diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 8 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 34 | ||||
-rw-r--r-- | source/blender/editors/physics/physics_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 13 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 21 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 2 |
8 files changed, 57 insertions, 27 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index d650cecdc3e..47b1fee3cf6 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -233,6 +233,6 @@ void ED_keymap_curve(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_object_generic_keymap(keyconf, keymap, 3); } diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index a03cd135f1c..efa5d6c5dad 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -55,7 +55,13 @@ void ED_operatortypes_object(void); void ED_operatormacros_object(void); void ED_keymap_object(struct wmKeyConfig *keyconf); -/* generic editmode keys like pet */ +/* generic editmode keys like pet + * do_pet + * 0: No + * 1: Object + * 2: Edit + * 3: Edit with connected + * */ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet); /* send your own notifier for select! */ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index e143e4859f5..9eac347c893 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -314,6 +314,6 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) WM_keymap_add_menu(keymap, "VIEW3D_MT_uv_map", UKEY, KM_PRESS, 0, 0); WM_keymap_add_menu(keymap, "VIEW3D_MT_vertex_group", GKEY, KM_PRESS, KM_CTRL, 0); - ED_object_generic_keymap(keyconf, keymap, 2); + ED_object_generic_keymap(keyconf, keymap, 3); } diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index e1ea7924916..610a82d964c 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -364,7 +364,10 @@ void ED_keymap_object(wmKeyConfig *keyconf) RNA_int_set(kmi->ptr, "level", i); } - /* Lattice -------------------------------------------------------------------- */ + /* ############################################################################ */ + /* ################################ LATTICE ################################### */ + /* ############################################################################ */ + keymap= WM_keymap_find(keyconf, "Lattice", 0, 0); keymap->poll= ED_operator_editlattice; @@ -375,7 +378,7 @@ 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, 1); + ED_object_generic_keymap(keyconf, keymap, 2); } void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet) @@ -383,22 +386,31 @@ void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keym wmKeyMapItem *kmi; /* used by mesh, curve & lattice only */ - if(do_pet > 0) { + 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_editing_falloff"); - 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_editing"); - RNA_string_set(kmi->ptr, "value_1", "DISABLED"); - RNA_string_set(kmi->ptr, "value_2", "ENABLED"); + // Object mode + if (do_pet == 1) { + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle", OKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "tool_settings.proportional_editing_objects"); + + } else { // Edit mode - /* for modes/object types that allow 'conencted' mode, add the Alt O key */ - if (do_pet > 1) { - kmi = WM_keymap_add_item(keymap, "WM_OT_context_toggle_enum", OKEY, KM_PRESS, KM_ALT, 0); + 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_editing"); RNA_string_set(kmi->ptr, "value_1", "DISABLED"); - RNA_string_set(kmi->ptr, "value_2", "CONNECTED"); + 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_editing"); + RNA_string_set(kmi->ptr, "value_1", "DISABLED"); + RNA_string_set(kmi->ptr, "value_2", "CONNECTED"); + } } } } diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 5a51c36cd09..2b7f8e9d5a2 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -114,7 +114,7 @@ static void keymap_particle(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "PARTICLE_OT_weight_set", KKEY, KM_PRESS, KM_SHIFT, 0); - ED_object_generic_keymap(keyconf, keymap, 1); + ED_object_generic_keymap(keyconf, keymap, 2); } /******************************* boids *************************************/ diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9743a4ef0f5..926d8ffd007 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1367,17 +1367,17 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } } - /* XXX convert stupid flag to enum */ + /* convert flag to enum */ switch(t->flag & (T_PROP_EDIT|T_PROP_CONNECTED)) { case (T_PROP_EDIT|T_PROP_CONNECTED): - proportional = 2; + proportional = PROP_EDIT_CONNECTED; break; case T_PROP_EDIT: - proportional = 1; + proportional = PROP_EDIT_ON; break; default: - proportional = 0; + proportional = PROP_EDIT_OFF; } // If modal, save settings back in scene if not set as operator argument @@ -1385,7 +1385,10 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) /* save settings if not set in operator */ if (RNA_struct_find_property(op->ptr, "proportional") && !RNA_property_is_set(op->ptr, "proportional")) { - ts->proportional = proportional; + if (t->obedit) + ts->proportional = proportional; + else + ts->proportional_objects = (proportional != PROP_EDIT_OFF); } if (RNA_struct_find_property(op->ptr, "proportional_size") && !RNA_property_is_set(op->ptr, "proportional_size")) { diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 8d98255d3d9..920c5c12ea1 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -38,6 +38,7 @@ #include "DNA_armature_types.h" #include "DNA_lattice_types.h" #include "DNA_screen_types.h" +#include "DNA_scene_types.h" #include "DNA_space_types.h" #include "DNA_view3d_types.h" @@ -1033,9 +1034,9 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) { switch(RNA_enum_get(op->ptr, "proportional")) { - case 2: /* XXX connected constant */ + case PROP_EDIT_CONNECTED: t->flag |= T_PROP_CONNECTED; - case 1: /* XXX prop on constant */ + case PROP_EDIT_ON: t->flag |= T_PROP_EDIT; break; } @@ -1045,11 +1046,19 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) /* use settings from scene only if modal */ if (t->flag & T_MODAL) { - if ((t->options & CTX_NO_PET) == 0 && (ts->proportional != PROP_EDIT_OFF)) { - t->flag |= T_PROP_EDIT; + if ((t->options & CTX_NO_PET) == 0) + { + if (t->obedit && ts->proportional != PROP_EDIT_OFF) + { + t->flag |= T_PROP_EDIT; - if(ts->proportional == PROP_EDIT_CONNECTED) - t->flag |= T_PROP_CONNECTED; + if(ts->proportional == PROP_EDIT_CONNECTED) + t->flag |= T_PROP_CONNECTED; + } + else if (t->obedit == NULL && ts->proportional_objects) + { + t->flag |= T_PROP_EDIT; + } } } } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index bae8d4b7fcf..cbc0eb41f84 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3241,7 +3241,7 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) /* menus */ WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_snap", SKEY, KM_PRESS, KM_SHIFT, 0); - ED_object_generic_keymap(keyconf, keymap, 1); + ED_object_generic_keymap(keyconf, keymap, 2); transform_keymap_for_space(keyconf, keymap, SPACE_IMAGE); } |