From 7d874b03433d19695f9e4e4bffb297d02c66c6eb Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Thu, 4 Feb 2021 18:03:42 +0100 Subject: Image: Flip image operator This implements an operator to flip the contents of an image buffer. It supports flipping the image horizontally and vertically. Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D10310 --- release/scripts/startup/bl_ui/space_image.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'release') diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 342b72acb8c..73cc674858c 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -235,6 +235,7 @@ class IMAGE_MT_image(Menu): layout.menu("IMAGE_MT_image_invert") layout.operator("image.resize", text="Resize") + layout.menu("IMAGE_MT_image_flip") if ima and not show_render: if ima.packed_file: @@ -250,6 +251,13 @@ class IMAGE_MT_image(Menu): layout.operator("palette.extract_from_image", text="Extract Palette") layout.operator("gpencil.image_to_grease_pencil", text="Generate Grease Pencil") +class IMAGE_MT_image_flip(Menu): + bl_label = "Flip" + + def draw(self, _context): + layout = self.layout + layout.operator("image.flip", text="Horizontally").use_flip_horizontal = True + layout.operator("image.flip", text="Vertically").use_flip_vertical = True class IMAGE_MT_image_invert(Menu): bl_label = "Invert" @@ -1584,6 +1592,7 @@ classes = ( IMAGE_MT_select, IMAGE_MT_select_linked, IMAGE_MT_image, + IMAGE_MT_image_flip, IMAGE_MT_image_invert, IMAGE_MT_uvs, IMAGE_MT_uvs_showhide, -- cgit v1.2.3