Reviewers: bf-codereview_blender.org, bf-committers_blender.org, Description: Except rudimentary Render layer cycling there was no way to fast switch between 1st and 5th layer without mouse. This patch corrects that thanks to Campbell who has exposed render_slot through RNA.
Now under Image editor one can switch render layers with 1-8 keys. Please review this at http://codereview.appspot.com/5938049/ Affected files: source/blender/editors/space_image/space_image.c Index: source/blender/editors/space_image/space_image.c =================================================================== --- source/blender/editors/space_image/space_image.c (revision 45241) +++ source/blender/editors/space_image/space_image.c (working copy) @@ -543,6 +543,40 @@ 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 1-8*/ + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", ONEKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 0); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", TWOKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 1); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", THREEKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 2); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", FOURKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 3); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", FIVEKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 4); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", SIXKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 5); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", SEVENKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 6); + + kmi = WM_keymap_add_item(keymap, "WM_OT_context_set_int", EIGHTKEY, KM_PRESS, 0, 0); + RNA_string_set(kmi->ptr, "data_path", "space_data.image.render_slot"); + RNA_int_set(kmi->ptr, "value", 7); + } /* dropboxes */ _______________________________________________ Bf-committers mailing list [email protected] http://lists.blender.org/mailman/listinfo/bf-committers
