1 # SPDX-FileCopyrightText: 2022-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
7 class VIEW3D_OT_camera_flip_x(bpy
.types
.Operator
):
8 bl_idname
= "view3d.camera_flip_x"
9 bl_label
= "Camera Flip X"
10 bl_description
= "Invert active camera scale.x to flip view horizontally"
11 bl_options
= {"REGISTER", "UNDO_GROUPED"}
14 def poll(cls
, context
):
15 return context
.area
.type == 'VIEW_3D' \
16 and context
.space_data
.region_3d
.view_perspective
== 'CAMERA'
18 def execute(self
, context
):
19 context
.scene
.camera
.scale
.x
*= -1
23 bpy
.utils
.register_class(VIEW3D_OT_camera_flip_x
)
26 bpy
.utils
.unregister_class(VIEW3D_OT_camera_flip_x
)