patch [#33738] Extend Selection option unified and added to few operators

from Sebastian Nell (codemanx), with minor edits
This commit is contained in:
Campbell Barton
2013-01-12 10:48:10 +00:00
parent 45c453c9b1
commit 5e6917a18e
6 changed files with 30 additions and 7 deletions

View File

@@ -110,6 +110,12 @@ class SelectCamera(Operator):
bl_label = "Select Camera"
bl_options = {'REGISTER', 'UNDO'}
extend = BoolProperty(
name="Extend",
description="Extend the selection",
default=False
)
def execute(self, context):
scene = context.scene
view = context.space_data
@@ -123,6 +129,8 @@ class SelectCamera(Operator):
elif camera.name not in scene.objects:
self.report({'WARNING'}, "Active camera is not in this scene")
else:
if not self.extend:
bpy.ops.object.select_all(action='DESELECT')
context.scene.objects.active = camera
camera.select = True
return {'FINISHED'}