Context operators for adjusting context values directly to avoid adding operators...
[blender.git] / source / blender / editors / space_view3d / view3d_ops.c
index 74074a041883c4a37efed4773861a8b9bb1e046b..758bf803fb87cae83ca50379b39e7fb663211162 100644 (file)
@@ -221,6 +221,31 @@ void view3d_keymap(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0);
 
        
        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);
        transform_keymap_for_space(keyconf, keymap, SPACE_VIEW3D);
 
        fly_modal_keymap(keyconf);