Brushstroke Tools: Initial Version #328
@ -1128,6 +1128,27 @@ class BSBST_OT_render_setup(bpy.types.Operator):
|
||||
def invoke(self, context, event):
|
||||
return context.window_manager.invoke_props_dialog(self)
|
||||
|
||||
class BSBST_OT_view_all(bpy.types.Operator):
|
||||
"""
|
||||
Enable/disable all brushstrokes for the viewport.
|
||||
"""
|
||||
bl_idname = "brushstroke_tools.view_all"
|
||||
bl_label = "Enable/Disable All"
|
||||
bl_description = "Enable/disable all brushstrokes for the viewport"
|
||||
bl_options = {"REGISTER", "UNDO"}
|
||||
|
||||
disable: bpy.props.BoolProperty(default=False)
|
||||
|
||||
def execute(self, context):
|
||||
for ob in bpy.data.objects:
|
||||
if not utils.is_brushstrokes_object(ob):
|
||||
continue
|
||||
if ob.hide_viewport == self.disable:
|
||||
continue
|
||||
else:
|
||||
ob.hide_viewport = self.disable
|
||||
return {"FINISHED"}
|
||||
|
||||
class BSBST_OT_new_material(bpy.types.Operator):
|
||||
"""
|
||||
"""
|
||||
@ -1163,6 +1184,7 @@ classes = [
|
||||
BSBST_OT_preset_remove_mod,
|
||||
BSBST_OT_preset_toggle_attribute,
|
||||
BSBST_OT_brushstrokes_toggle_attribute,
|
||||
BSBST_OT_view_all,
|
||||
BSBST_OT_render_setup,
|
||||
BSBST_OT_new_material,
|
||||
]
|
||||
|
@ -427,6 +427,15 @@ class BSBST_PT_brushstroke_tools_panel(bpy.types.Panel):
|
||||
bl_label = "Brushstroke Tools"
|
||||
bl_category = "Brushstroke Tools"
|
||||
|
||||
def draw_header_preset(self,context):
|
||||
layout = self.layout
|
||||
row = layout.row(align=True)
|
||||
|
||||
op = row.operator('brushstroke_tools.view_all', icon='RESTRICT_VIEW_OFF', text='')
|
||||
op.disable = False
|
||||
op = row.operator('brushstroke_tools.view_all', icon='RESTRICT_VIEW_ON', text='')
|
||||
op.disable = True
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user