Fix #24531: UV editor: setting rotating/scaling pivot with [ , ] [ . ] not working.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 4 Nov 2010 11:45:30 +0000 (11:45 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Thu, 4 Nov 2010 11:45:30 +0000 (11:45 +0000)
Patch by M.G. Kishalmi, thanks!

source/blender/editors/uvedit/uvedit_ops.c

index d311733e945a8bf36692568ef9df999e3219b89b..d8c618d4d07396688456ff305dee26c0e11837cb 100644 (file)
@@ -3182,6 +3182,7 @@ void ED_operatortypes_uvedit(void)
 void ED_keymap_uvedit(wmKeyConfig *keyconf)
 {
        wmKeyMap *keymap;
+       wmKeyMapItem *kmi;
        
        keymap= WM_keymap_find(keyconf, "UV Editor", 0, 0);
        keymap->poll= ED_operator_uvedit;
@@ -3234,6 +3235,19 @@ void ED_keymap_uvedit(wmKeyConfig *keyconf)
        WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_snap", SKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_menu(keymap, "IMAGE_MT_uvs_select_mode", TABKEY, KM_PRESS, KM_CTRL, 0);
 
+       /* pivot */
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.uv_editor.pivot_point");
+       RNA_string_set(kmi->ptr, "value", "CENTER");
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", COMMAKEY, KM_PRESS, KM_CTRL, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.uv_editor.pivot_point");
+       RNA_string_set(kmi->ptr, "value", "MEDIAN");
+
+       kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_enum", PERIODKEY, KM_PRESS, 0, 0);
+       RNA_string_set(kmi->ptr, "data_path", "space_data.uv_editor.pivot_point");
+       RNA_string_set(kmi->ptr, "value", "CURSOR");
+
        ED_object_generic_keymap(keyconf, keymap, 2);
 
        transform_keymap_for_space(keyconf, keymap, SPACE_IMAGE);