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
This commit is contained in:
2021-02-04 18:03:42 +01:00
parent faf45091b4
commit 7d874b0343
4 changed files with 131 additions and 0 deletions

View File

@@ -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,