Page MenuHome

resflip.patch

resflip.patch

Index: source/blender/editors/space_buttons/buttons_intern.h
===================================================================
--- source/blender/editors/space_buttons/buttons_intern.h (revision 32175)
+++ source/blender/editors/space_buttons/buttons_intern.h (working copy)
@@ -68,6 +68,7 @@ struct ID *buttons_context_id_path(const struct bContext *C);
/* buttons_ops.c */
void BUTTONS_OT_file_browse(struct wmOperatorType *ot);
void BUTTONS_OT_toolbox(struct wmOperatorType *ot);
+void BUTTONS_OT_resflip(struct wmOperatorType *ot);
#endif /* ED_BUTTONS_INTERN_H */
Index: source/blender/editors/space_buttons/buttons_ops.c
===================================================================
--- source/blender/editors/space_buttons/buttons_ops.c (revision 32175)
+++ source/blender/editors/space_buttons/buttons_ops.c (working copy)
@@ -31,6 +31,7 @@
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
+#include "DNA_scene_types.h"
#include "BLI_fileops.h"
#include "BLI_path_util.h"
@@ -83,6 +84,34 @@ void BUTTONS_OT_toolbox(wmOperatorType *ot)
ot->poll= ED_operator_buttons_active;
}
+/********************** resflip operator *********************/
+
+static int resflip_invoke(bContext *C, wmOperator *op, wmEvent *event)
+{
+ Scene *sce= CTX_data_scene(C);
+ int tmpres;
+
+ tmpres= sce->r.xsch;
+ sce->r.xsch= sce->r.ysch;
+ sce->r.ysch= tmpres;
+
+ WM_event_add_notifier(C, NC_SCENE|ND_SPACE_PROPERTIES, CTX_data_active_object(C));
+
+ return OPERATOR_FINISHED;
+}
+
+void BUTTONS_OT_resflip(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Resolution Flip";
+ ot->description="Swap horiz and vert resolutions - switch portrait/landscape.";
+ ot->idname= "BUTTONS_OT_resflip";
+
+ /* api callbacks */
+ ot->invoke= resflip_invoke;
+ ot->poll= ED_operator_buttons_active;
+}
+
/********************** filebrowse operator *********************/
typedef struct FileBrowseOp {
Index: source/blender/editors/space_buttons/space_buttons.c
===================================================================
--- source/blender/editors/space_buttons/space_buttons.c (revision 32175)
+++ source/blender/editors/space_buttons/space_buttons.c (working copy)
@@ -181,6 +181,7 @@ void buttons_operatortypes(void)
{
WM_operatortype_append(BUTTONS_OT_toolbox);
WM_operatortype_append(BUTTONS_OT_file_browse);
+ WM_operatortype_append(BUTTONS_OT_resflip);
}
void buttons_keymap(struct wmKeyConfig *keyconf)
@@ -188,6 +189,7 @@ void buttons_keymap(struct wmKeyConfig *keyconf)
wmKeyMap *keymap= WM_keymap_find(keyconf, "Property Editor", SPACE_BUTS, 0);
WM_keymap_add_item(keymap, "BUTTONS_OT_toolbox", RIGHTMOUSE, KM_PRESS, 0, 0);
+ WM_keymap_add_item(keymap, "BUTTONS_OT_resflip", FKEY, KM_PRESS, 0, 0);
}
/* add handlers, stuff you only do once or on area/region changes */

File Metadata

Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
86/7b/d9dbf57308437144d3534e254079

Event Timeline