add a no_popup arg in check layer for autobuild background mode
parent
747638eca9
commit
734714be09
|
@ -255,7 +255,7 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator):
|
||||||
|
|
||||||
## Reset layer states -> 100% opacity (except mask layer 'MA' by default), remove use light, set default blend mode, hide material named "invisible".
|
## Reset layer states -> 100% opacity (except mask layer 'MA' by default), remove use light, set default blend mode, hide material named "invisible".
|
||||||
if self.reset_layers_state:
|
if self.reset_layers_state:
|
||||||
bpy.ops.gp.layers_state('EXEC_DEFAULT')
|
bpy.ops.gp.layers_state('EXEC_DEFAULT', no_popup=True)
|
||||||
|
|
||||||
## Set GP object data to single user (Individual viewlayers)
|
## Set GP object data to single user (Individual viewlayers)
|
||||||
if self.make_gp_single_user:
|
if self.make_gp_single_user:
|
||||||
|
|
|
@ -171,6 +171,9 @@ class GPEXP_OT_layers_state(bpy.types.Operator):
|
||||||
# description="Delete view layer that aren't used in the nodetree anymore",
|
# description="Delete view layer that aren't used in the nodetree anymore",
|
||||||
# default=True)
|
# default=True)
|
||||||
|
|
||||||
|
no_popup : BoolProperty(name='No Popup',
|
||||||
|
default=False, description='To use for call in CLI or from other operators', options={'SKIP_SAVE'})
|
||||||
|
|
||||||
all_objects : BoolProperty(name='On All Object',
|
all_objects : BoolProperty(name='On All Object',
|
||||||
default=True, description='On All object, else use selected objects') # , options={'SKIP_SAVE'}
|
default=True, description='On All object, else use selected objects') # , options={'SKIP_SAVE'}
|
||||||
|
|
||||||
|
@ -200,13 +203,13 @@ class GPEXP_OT_layers_state(bpy.types.Operator):
|
||||||
# return context.object
|
# return context.object
|
||||||
|
|
||||||
def invoke(self, context, event):
|
def invoke(self, context, event):
|
||||||
|
|
||||||
## if no existing infos.json generated, call ops
|
## if no existing infos.json generated, call ops
|
||||||
l_infos = Path(bpy.data.filepath).parent / 'render' / 'infos.json'
|
l_infos = Path(bpy.data.filepath).parent / 'render' / 'infos.json'
|
||||||
if not l_infos.exists(): # only if infos not created
|
if not l_infos.exists(): # only if infos not created
|
||||||
bpy.ops.gp.export_infos_for_compo('INVOKE_DEFAULT')
|
bpy.ops.gp.export_infos_for_compo('INVOKE_DEFAULT')
|
||||||
|
|
||||||
# return self.execute(context)
|
if self.no_popup:
|
||||||
|
return self.execute(context)
|
||||||
return context.window_manager.invoke_props_dialog(self)
|
return context.window_manager.invoke_props_dialog(self)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
|
@ -327,7 +330,8 @@ class GPEXP_OT_layers_state(bpy.types.Operator):
|
||||||
m.grease_pencil.hide = True
|
m.grease_pencil.hide = True
|
||||||
changes.append(f'{m.name} material hidden')
|
changes.append(f'{m.name} material hidden')
|
||||||
|
|
||||||
fn.show_message_box(_message=changes, _title="Layers Check Report", _icon='INFO')
|
if not self.no_popup:
|
||||||
|
fn.show_message_box(_message=changes, _title="Layers Check Report", _icon='INFO')
|
||||||
|
|
||||||
return {"FINISHED"}
|
return {"FINISHED"}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue