diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-30 20:09:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-03-30 20:09:12 +0400 |
commit | d5ffec12a078050dc2572d5c85b9ba2b235f92aa (patch) | |
tree | c9e802f3d23f334a2d68d73efed8031f8b2b95af /source/blender | |
parent | f469e0652aa3152752845834477f2939c40f908d (diff) |
Image editor: shortcuts 1-key to 8-key for switching between render slots, patch
by Damir Prebeg.
Also changed back J-key slot switching to only cycle through used slots, not used
slots + 1. This is much more useful to compare two renders easily, rather than being
shown an empty slot each time.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 3ed115be345..ad4921d225c 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2350,10 +2350,6 @@ static int image_cycle_render_slot_exec(bContext *C, wmOperator *op) ima->render_slot = slot; break; } - else if ((slot - 1) == ima->last_render_slot && slot < IMA_MAX_RENDER_SLOT) { - ima->render_slot = slot; - break; - } } if (a == IMA_MAX_RENDER_SLOT) diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index b743038f74f..c6d36842207 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -497,6 +497,7 @@ static void image_keymap(struct wmKeyConfig *keyconf) { wmKeyMap *keymap = WM_keymap_find(keyconf, "Image Generic", SPACE_IMAGE, 0); wmKeyMapItem *kmi; + int i; WM_keymap_add_item(keymap, "IMAGE_OT_new", NKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "IMAGE_OT_open", OKEY, KM_PRESS, KM_ALT, 0); @@ -543,6 +544,13 @@ static void image_keymap(struct wmKeyConfig *keyconf) kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0); RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT); RNA_boolean_set(kmi->ptr, "toggle", TRUE); + + /* fast switch to render slots */ + for(i = 0; i < MAX2(IMA_MAX_RENDER_SLOT, 9); i++) { + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY+i, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", i); + } } /* dropboxes */ |