forked from bartvdbraak/blender
obscure sounding feature thats actually useful: isolate render type
Select lamp, isolate, all other visible lamps are disabled.
This commit is contained in:
parent
f051cd2e89
commit
4d6d68bfa1
@ -507,6 +507,26 @@ class MakeDupliFace(bpy.types.Operator):
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
class IsolateTypeRender(bpy.types.Operator):
|
||||
'''Select object matching a naming pattern'''
|
||||
bl_idname = "object.isolate_type_render"
|
||||
bl_label = "Isolate Render Selection"
|
||||
bl_options = {'REGISTER', 'UNDO'}
|
||||
|
||||
def execute(self, context):
|
||||
act_type = context.object.type
|
||||
|
||||
for obj in context.visible_objects:
|
||||
|
||||
if obj.selected:
|
||||
obj.restrict_render = False
|
||||
else:
|
||||
if obj.type == act_type:
|
||||
obj.restrict_render = True
|
||||
|
||||
return {'FINISHED'}
|
||||
|
||||
|
||||
classes = [
|
||||
SelectPattern,
|
||||
SelectCamera,
|
||||
@ -514,6 +534,7 @@ classes = [
|
||||
SubdivisionSet,
|
||||
ShapeTransfer,
|
||||
JoinUVs,
|
||||
IsolateTypeRender,
|
||||
MakeDupliFace]
|
||||
|
||||
|
||||
|
@ -706,14 +706,13 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
|
||||
|
||||
def poll(self, context):
|
||||
# add more special types
|
||||
obj = context.object
|
||||
return bool(obj and obj.type == 'LAMP')
|
||||
return context.object
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
obj = context.object
|
||||
if obj and obj.type == 'LAMP':
|
||||
if obj.type == 'LAMP':
|
||||
layout.operator_context = 'INVOKE_REGION_WIN'
|
||||
|
||||
props = layout.operator("wm.context_modal_mouse", text="Spot Size")
|
||||
@ -736,6 +735,10 @@ class VIEW3D_MT_object_specials(bpy.types.Menu):
|
||||
props.path_item = "data.shadow_buffer_clip_end"
|
||||
props.input_scale = 0.05
|
||||
|
||||
layout.separator()
|
||||
|
||||
props = layout.operator("object.isolate_type_render")
|
||||
|
||||
|
||||
class VIEW3D_MT_object_apply(bpy.types.Menu):
|
||||
bl_label = "Apply"
|
||||
|
Loading…
Reference in New Issue
Block a user