add invisible material hide in check layers func
parent
7abb626a05
commit
2f4afd7584
|
@ -184,10 +184,16 @@ class GPEXP_OT_layers_state(bpy.types.Operator):
|
||||||
default=True, description='Check/Set blend mode to regular') # , options={'SKIP_SAVE'}
|
default=True, description='Check/Set blend mode to regular') # , options={'SKIP_SAVE'}
|
||||||
|
|
||||||
clear_frame_out_of_range : BoolProperty(name='Clear Frames Out Of Scene Range',
|
clear_frame_out_of_range : BoolProperty(name='Clear Frames Out Of Scene Range',
|
||||||
default=False, description='Delete frames that before scene start and after scene end range\nWith a tolerance of one frame to avoid problem\nAffect all layers)') # , options={'SKIP_SAVE'}
|
default=False, description='Delete frames that before scene start and after scene end range\
|
||||||
|
\nWith a tolerance of one frame to avoid problem\
|
||||||
|
\nAffect all layers)') # , options={'SKIP_SAVE'}
|
||||||
|
|
||||||
opacity_exclude_list : StringProperty(name='Skip',
|
opacity_exclude_list : StringProperty(name='Skip',
|
||||||
default='MA', description='Skip prefixes from this list when changing opacity\nSeparate multiple value with a comma (ex: MA,IN)') # , options={'SKIP_SAVE'}
|
default='MA', description='Skip prefixes from this list when changing opacity\
|
||||||
|
\nSeparate multiple value with a comma (ex: MAIN)') # , options={'SKIP_SAVE'}
|
||||||
|
|
||||||
|
hide_invisible_materials : BoolProperty(name='Hide Materials named invisible',
|
||||||
|
default=True, description='Hide material with name starting with "invisible"') # , options={'SKIP_SAVE'}
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
@ -222,6 +228,7 @@ class GPEXP_OT_layers_state(bpy.types.Operator):
|
||||||
row.prop(self, 'opacity_exclude_list')
|
row.prop(self, 'opacity_exclude_list')
|
||||||
layout.prop(self, 'set_use_lights')
|
layout.prop(self, 'set_use_lights')
|
||||||
layout.prop(self, 'set_blend_mode')
|
layout.prop(self, 'set_blend_mode')
|
||||||
|
layout.prop(self, 'hide_invisible_materials')
|
||||||
# layout.prop(self, 'clear_unused_view_layers')
|
# layout.prop(self, 'clear_unused_view_layers')
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
|
@ -312,6 +319,14 @@ class GPEXP_OT_layers_state(bpy.types.Operator):
|
||||||
if gp_mu_edit_ct:
|
if gp_mu_edit_ct:
|
||||||
changes.append(f'{gp_mu_edit_ct} multiframe-edit mode disabled')
|
changes.append(f'{gp_mu_edit_ct} multiframe-edit mode disabled')
|
||||||
|
|
||||||
|
## Hide invisible named materials
|
||||||
|
if self.hide_invisible_materials:
|
||||||
|
for m in bpy.data.materials:
|
||||||
|
if m.is_grease_pencil and m.name.lower().startswith('invisible'):
|
||||||
|
if not m.grease_pencil.hide:
|
||||||
|
print(f'Hiding gp material {m.name}')
|
||||||
|
m.grease_pencil.hide = True
|
||||||
|
changes.append(f'{m.name} material hidden')
|
||||||
|
|
||||||
fn.show_message_box(_message=changes, _title="Layers Check Report", _icon='INFO')
|
fn.show_message_box(_message=changes, _title="Layers Check Report", _icon='INFO')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue