diff options
author | Pullusb <bernou.samuel@gmail.com> | 2022-03-15 00:53:28 +0300 |
---|---|---|
committer | Pullusb <bernou.samuel@gmail.com> | 2022-03-15 00:53:28 +0300 |
commit | 80c14a2adc06c92620471b226a64a3540718dd71 (patch) | |
tree | 43c726380020cc2cfe447f953285705183677d34 /greasepencil_tools/draw_tools.py | |
parent | 82d7d6b8bdec8dfc47c5366607f40b8ff219a718 (diff) |
GPencil Tools: Added mirror flip
New button in menu to flip view horizontally within camera by inverting x-scale
Diffstat (limited to 'greasepencil_tools/draw_tools.py')
-rw-r--r-- | greasepencil_tools/draw_tools.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/greasepencil_tools/draw_tools.py b/greasepencil_tools/draw_tools.py new file mode 100644 index 00000000..6d2cf3a9 --- /dev/null +++ b/greasepencil_tools/draw_tools.py @@ -0,0 +1,23 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +import bpy + +class GP_OT_camera_flip_x(bpy.types.Operator): + bl_idname = "gp.camera_flip_x" + bl_label = "Camera Flip X" + bl_description = "Invert active camera scale.x to flip view horizontally" + bl_options = {"REGISTER"} + + @classmethod + def poll(cls, context): + return context.space_data.region_3d.view_perspective == 'CAMERA' + + def execute(self, context): + context.scene.camera.scale.x *= -1 + return {"FINISHED"} + +def register(): + bpy.utils.register_class(GP_OT_camera_flip_x) + +def unregister(): + bpy.utils.unregister_class(GP_OT_camera_flip_x) |