diff --git a/CHANGELOG.md b/CHANGELOG.md index e9d9d82..74e3c2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,11 @@ Activate / deactivate layer opacity according to prefix Activate / deactivate all masks using MA layers --> +1.4.1 + +- added: expose button for output file de-numbering +- changed: denumbering and exclude layer based on current scene instead of render scene only + 1.4.0 - added: split selection to scenes individually diff --git a/OP_manage_outputs.py b/OP_manage_outputs.py index 7472f01..8eeb776 100644 --- a/OP_manage_outputs.py +++ b/OP_manage_outputs.py @@ -35,20 +35,23 @@ class GPEXP_OT_number_outputs(bpy.types.Operator): return True mode : bpy.props.StringProperty(default='SELECTED', options={'SKIP_SAVE'}) - # ctrl : bpy.props.StringProperty(default=False, options={'SKIP_SAVE'}) # no need + clear : bpy.props.BoolProperty(default=False, options={'SKIP_SAVE'}) def invoke(self, context, event): - self.ctrl = event.ctrl + # use clear with Ctrl + Click + if event.ctrl: + self.clear = True return self.execute(context) def execute(self, context): - render = bpy.data.scenes.get('Render') - if not render: - print('SKIP, no Render scene') - return {"CANCELLED"} + scn = context.scene + # scn = bpy.data.scenes.get('Render') + # if not scn: + # print('SKIP, no Render scene') + # return {"CANCELLED"} ct = 0 - nodes = render.node_tree.nodes + nodes = scn.node_tree.nodes for fo in nodes: if fo.type != 'OUTPUT_FILE': continue @@ -56,13 +59,13 @@ class GPEXP_OT_number_outputs(bpy.types.Operator): continue # print(f'numbering {fo.name}') ct += 1 - if self.ctrl: + if self.clear: fn.delete_numbering(fo) else: fn.renumber_keep_existing(fo) # fn.renumber(fo) - txt = 'de-numbered' if self.ctrl else 're-numbered' + txt = 'de-numbered' if self.clear else 're-numbered' if ct: self.report({'INFO'}, f'{ct} output nodes {txt}') else: diff --git a/OP_merge_layers.py b/OP_merge_layers.py index fb0f246..3ee29a3 100644 --- a/OP_merge_layers.py +++ b/OP_merge_layers.py @@ -308,10 +308,11 @@ class GPEXP_OT_remove_viewlayer_on_selected(bpy.types.Operator): ob = context.object ## Force use of render scene (?) - rd_scn = bpy.data.scenes.get('Render') - if not rd_scn: - self.report({'ERROR'}, 'No render scene found') - return {'CANCELLED'} + rd_scn = context.scene + # rd_scn = bpy.data.scenes.get('Render') + # if not rd_scn: + # self.report({'ERROR'}, 'No render scene found') + # return {'CANCELLED'} if self.remove_all_hidden: if self.multi_object: diff --git a/__init__.py b/__init__.py index b1d14cf..2387d40 100644 --- a/__init__.py +++ b/__init__.py @@ -2,7 +2,7 @@ bl_info = { "name": "GP Render", "description": "Organise export of gp layers through compositor output", "author": "Samuel Bernou", - "version": (1, 4, 0), + "version": (1, 4, 1), "blender": (3, 0, 0), "location": "View3D", "warning": "", diff --git a/ui.py b/ui.py index 425ba69..bdbbc92 100644 --- a/ui.py +++ b/ui.py @@ -116,8 +116,14 @@ class GPEXP_PT_gp_node_ui(Panel): txt = f'Renumber {ct} Selected Outputs' subcol = col.column() subcol.enabled = bool(ct) - subcol.operator('gp.number_outputs', icon='LINENUMBERS_ON', text=txt).mode = 'SELECTED' + row = subcol.row(align=True) + row.operator('gp.number_outputs', icon='LINENUMBERS_ON', text=txt).mode = 'SELECTED' + op = row.operator('gp.number_outputs', icon='X', text='') + op.mode = 'SELECTED' + op.clear = True + + ## Set / remove preview row=layout.row(align=True) row.operator('gp.merge_preview_ouput', icon='NODETREE', text='Set Preview') row.operator('gp.merge_preview_ouput', icon='X', text='').clear = True