Changeset View
Changeset View
Standalone View
Standalone View
space_view3d_display_tools/select_tools.py
| Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | def execute(self, context): | ||||
| if i.hide: | if i.hide: | ||||
| i.hide = False | i.hide = False | ||||
| i.hide_select = False | i.hide_select = False | ||||
| i.hide_render = False | i.hide_render = False | ||||
| else: | else: | ||||
| i.hide = True | i.hide = True | ||||
| i.select = False | i.select = False | ||||
| if i.type not in ['CAMERA', 'LAMP']: | if i.type not in ['CAMERA', 'LIGHT']: | ||||
| i.hide_render = True | i.hide_render = True | ||||
| except: | except: | ||||
| continue | continue | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| class ShowAllObjects(Operator): | class ShowAllObjects(Operator): | ||||
| Show All 21 Lines | class HideAllObjects(Operator): | ||||
| bl_options = {'REGISTER', 'UNDO'} | bl_options = {'REGISTER', 'UNDO'} | ||||
| def execute(self, context): | def execute(self, context): | ||||
| if context.object is None: | if context.object is None: | ||||
| for i in bpy.data.objects: | for i in bpy.data.objects: | ||||
| i.hide = True | i.hide = True | ||||
| i.select = False | i.select = False | ||||
| if i.type not in ['CAMERA', 'LAMP']: | if i.type not in ['CAMERA', 'LIGHT']: | ||||
| i.hide_render = True | i.hide_render = True | ||||
| else: | else: | ||||
| obj_name = context.object.name | obj_name = context.object.name | ||||
| for i in bpy.data.objects: | for i in bpy.data.objects: | ||||
| if i.name != obj_name: | if i.name != obj_name: | ||||
| i.hide = True | i.hide = True | ||||
| i.select = False | i.select = False | ||||
| if i.type not in ['CAMERA', 'LAMP']: | if i.type not in ['CAMERA', 'LIGHT']: | ||||
| i.hide_render = True | i.hide_render = True | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| class SelectAll(Operator): | class SelectAll(Operator): | ||||
| bl_idname = "opr.select_all" | bl_idname = "opr.select_all" | ||||
| bl_label = "(De)select All" | bl_label = "(De)select All" | ||||
| ▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | type = EnumProperty( | ||||
| ('CURVE', 'Curve', ''), | ('CURVE', 'Curve', ''), | ||||
| ('SURFACE', 'Surface', ''), | ('SURFACE', 'Surface', ''), | ||||
| ('META', 'Meta', ''), | ('META', 'Meta', ''), | ||||
| ('FONT', 'Font', ''), | ('FONT', 'Font', ''), | ||||
| ('ARMATURE', 'Armature', ''), | ('ARMATURE', 'Armature', ''), | ||||
| ('LATTICE', 'Lattice', ''), | ('LATTICE', 'Lattice', ''), | ||||
| ('EMPTY', 'Empty', ''), | ('EMPTY', 'Empty', ''), | ||||
| ('CAMERA', 'Camera', ''), | ('CAMERA', 'Camera', ''), | ||||
| ('LAMP', 'Lamp', ''), | ('LIGHT', 'Lamp', ''), | ||||
| ('ALL', 'All', '')), | ('ALL', 'All', '')), | ||||
| name="Type", | name="Type", | ||||
| description="Type", | description="Type", | ||||
| default='LAMP', | default='LIGHT', | ||||
| options={'ANIMATABLE'} | options={'ANIMATABLE'} | ||||
| ) | ) | ||||
| def execute(self, context): | def execute(self, context): | ||||
| scene = bpy.context.scene | scene = bpy.context.scene | ||||
| objects = [] | objects = [] | ||||
| eligible_objects = [] | eligible_objects = [] | ||||
| ▲ Show 20 Lines • Show All 91 Lines • Show Last 20 Lines | |||||