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.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user