diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/curve/curve_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_object.h | 3 | ||||
-rw-r--r-- | source/blender/editors/mesh/mesh_ops.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_ops.c | 23 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_edit.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_ops.c | 25 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 4 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 5 |
12 files changed, 82 insertions, 9 deletions
diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index a71ff8347e8..929e3514990 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -248,5 +248,7 @@ void ED_keymap_curve(wmKeyConfig *keyconf) RNA_enum_set(WM_keymap_add_item(keymap, "CURVE_OT_hide", HKEY, KM_PRESS, KM_ALT|KM_SHIFT, 0)->ptr, "unselected", 1); WM_keymap_add_item(keymap, "CURVE_OT_specials_menu", WKEY, KM_PRESS, 0, 0); + + ED_object_generic_keymap(keyconf, keymap, TRUE); } diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index e19fc806404..3d0d776f549 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -47,6 +47,9 @@ void ED_operatortypes_object(void); void ED_operatormacros_object(void); void ED_keymap_object(struct wmKeyConfig *keyconf); +/* generic editmode keys like pet */ +void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet); + /* send your own notifier for select! */ void ED_base_object_select(struct Base *base, short mode); /* includes notifier */ diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index 8c24dda4da7..3a3e4f54915 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -291,5 +291,7 @@ void ED_keymap_mesh(wmKeyConfig *keyconf) /* UV's */ WM_keymap_add_item(keymap, "UV_OT_mapping_menu", UKEY, KM_PRESS, 0, 0); + + ED_object_generic_keymap(keyconf, keymap, TRUE); } diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 9869d15a69c..4f9a3d22f3b 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -273,3 +273,26 @@ void ED_keymap_object(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "LATTICE_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0); } +void ED_object_generic_keymap(struct wmKeyConfig *keyconf, struct wmKeyMap *keymap, int do_pet) +{ + wmKeyMapItem *km; + + /* used by mesh, curve & lattice only */ + if(do_pet) { + /* context ops */ + km = WM_keymap_add_item(keymap, "WM_OT_context_cycle_enum", OKEY, KM_PRESS, KM_SHIFT, 0); + RNA_string_set(km->ptr, "path", "scene.tool_settings.proportional_editing_falloff"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_toggle_values", OKEY, KM_PRESS, 0, 0); + RNA_string_set(km->ptr, "path", "scene.tool_settings.proportional_editing"); + RNA_string_set(km->ptr, "value_1", "'DISABLED'"); + RNA_string_set(km->ptr, "value_2", "'ENABLED'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_toggle_values", OKEY, KM_PRESS, KM_ALT, 0); + RNA_string_set(km->ptr, "path", "scene.tool_settings.proportional_editing"); + RNA_string_set(km->ptr, "value_1", "'DISABLED'"); + RNA_string_set(km->ptr, "value_2", "'CONNECTED'"); + } + +} + diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index e3f54158fbb..d4a180e2427 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -2908,7 +2908,7 @@ static void brush_add(PEData *data, short number) ParticleSimulationData sim = {scene, ob, psys, psmd}; ParticleEditSettings *pset= PE_settings(scene); int i, k, n= 0, totpart= psys->totpart; - short mco[2]; + float mco[2]; short dmx= 0, dmy= 0; float co1[3], co2[3], min_d, imat[4][4]; float framestep, timestep= psys_get_timestep(&sim); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index e160b85e233..74303e8a6a3 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3410,10 +3410,7 @@ void ED_keymap_screen(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0); /* user prefs */ - #ifdef __APPLE__ - WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_OSKEY, 0); - #endif - WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", UKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); /* Anim Playback ------------------------------------------------ */ diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index 74074a04188..758bf803fb8 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -221,6 +221,31 @@ void view3d_keymap(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0); + /* context ops */ + km = WM_keymap_add_item(keymap, "WM_OT_context_set", COMMAKEY, KM_PRESS, 0, 0); + RNA_string_set(km->ptr, "path", "space_data.pivot_point"); + RNA_string_set(km->ptr, "value", "'BOUNDING_BOX_CENTER'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", COMMAKEY, KM_PRESS, KM_CTRL, 0); /* 2.4x allowed Comma+Shift too, rather not use both */ + RNA_string_set(km->ptr, "path", "space_data.pivot_point"); + RNA_string_set(km->ptr, "value", "'MEDIAN_POINT'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", COMMAKEY, KM_PRESS, KM_ALT, 0); /* new in 2.5 */ + RNA_string_set(km->ptr, "path", "space_data.pivot_point_align"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", PERIODKEY, KM_PRESS, 0, 0); + RNA_string_set(km->ptr, "path", "space_data.pivot_point"); + RNA_string_set(km->ptr, "value", "'CURSOR'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", PERIODKEY, KM_PRESS, KM_CTRL, 0); + RNA_string_set(km->ptr, "path", "space_data.pivot_point"); + RNA_string_set(km->ptr, "value", "'INDIVIDUAL_CENTERS'"); + + km = WM_keymap_add_item(keymap, "WM_OT_context_set", PERIODKEY, KM_PRESS, KM_ALT, 0); + RNA_string_set(km->ptr, "path", "space_data.pivot_point"); + RNA_string_set(km->ptr, "value", "'ACTIVE_ELEMENT'"); + + transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D); fly_modal_keymap(keyconf); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index c8066f03abf..5fe9db3915f 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -995,10 +995,10 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } else { - if ((t->options & CTX_NO_PET) == 0 && (ts->proportional)) { + if ((t->options & CTX_NO_PET) == 0 && (ts->proportional != PROP_EDIT_OFF)) { t->flag |= T_PROP_EDIT; - if(ts->proportional == 2) + if(ts->proportional == PROP_EDIT_CONNECTED) t->flag |= T_PROP_CONNECTED; // yes i know, has to become define } } diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 0f79420d3a7..9b3cb581c88 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -3129,6 +3129,8 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "UV_OT_cursor_set", ACTIONMOUSE, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "UV_OT_tile_set", ACTIONMOUSE, KM_PRESS, KM_SHIFT, 0); + ED_object_generic_keymap(keyconf, keymap, TRUE); + transform_keymap_for_space(keyconf, keymap, SPACE_IMAGE); } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index e069136d46a..d2e88408f6b 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1016,6 +1016,11 @@ typedef struct Scene { #define PROP_CONST 5 #define PROP_RANDOM 6 +/* toolsettings->proportional */ +#define PROP_EDIT_OFF 0 +#define PROP_EDIT_ON 1 +#define PROP_EDIT_CONNECTED 2 + /* sce->flag */ #define SCE_DS_SELECTED (1<<0) #define SCE_DS_COLLAPSED (1<<1) diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 29fb9e4deb2..7831f6acd11 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -502,6 +502,12 @@ static void rna_def_tool_settings(BlenderRNA *brna) {AUTOKEY_MODE_EDITKEYS, "REPLACE_KEYS", 0, "Replace", ""}, {0, NULL, 0, NULL, NULL}}; + static EnumPropertyItem proportional_editing_items[] = { + {PROP_EDIT_OFF, "DISABLED", 0, "Disable", ""}, + {PROP_EDIT_ON, "ENABLED", 0, "Enable", ""}, + {PROP_EDIT_CONNECTED, "CONNECTED", 0, "Connected", ""}, + {0, NULL, 0, NULL, NULL}}; + srna= RNA_def_struct(brna, "ToolSettings", NULL); RNA_def_struct_ui_text(srna, "Tool Settings", ""); @@ -526,14 +532,17 @@ static void rna_def_tool_settings(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Particle Edit", ""); /* Transform */ - prop= RNA_def_property(srna, "proportional_editing", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "proportional", 0); + prop= RNA_def_property(srna, "proportional_editing", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "proportional"); + RNA_def_property_enum_items(prop, proportional_editing_items); RNA_def_property_ui_text(prop, "Proportional Editing", "Proportional editing mode."); + RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */ prop= RNA_def_property(srna, "proportional_editing_falloff", PROP_ENUM, PROP_NONE); RNA_def_property_enum_sdna(prop, NULL, "prop_mode"); RNA_def_property_enum_items(prop, prop_mode_items); RNA_def_property_ui_text(prop, "Proportional Editing Falloff", "Falloff type for proportional editing mode."); + RNA_def_property_update(prop, NC_SCENE|ND_MODE, NULL); /* header redraw */ prop= RNA_def_property(srna, "normal_size", PROP_FLOAT, PROP_DISTANCE); RNA_def_property_float_sdna(prop, NULL, "normalsize"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 99ee3e653f0..7d77660db6d 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -766,6 +766,11 @@ static void rna_def_space_3dview(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pivot Point", "Pivot center for rotation/scaling."); RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "pivot_point_align", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "flag", V3D_ALIGN); + RNA_def_property_ui_text(prop, "Align", "Manipulate object centers only."); + RNA_def_property_update(prop, NC_SPACE|ND_SPACE_VIEW3D, NULL); + prop= RNA_def_property(srna, "manipulator", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "twflag", V3D_USE_MANIPULATOR); RNA_def_property_ui_text(prop, "Manipulator", "Use a 3D manipulator widget for controlling transforms."); |