renumber and exclude layer use current scene
1.4.1 - added: expose button for output file de-numbering - changed: denumbering and exclude layer based on current scene instead of render scene onlymain
parent
f6be9c056d
commit
7abb626a05
|
@ -14,6 +14,11 @@ Activate / deactivate layer opacity according to prefix
|
||||||
Activate / deactivate all masks using MA layers
|
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
|
1.4.0
|
||||||
|
|
||||||
- added: split selection to scenes individually
|
- added: split selection to scenes individually
|
||||||
|
|
|
@ -35,20 +35,23 @@ class GPEXP_OT_number_outputs(bpy.types.Operator):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
mode : bpy.props.StringProperty(default='SELECTED', options={'SKIP_SAVE'})
|
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):
|
def invoke(self, context, event):
|
||||||
self.ctrl = event.ctrl
|
# use clear with Ctrl + Click
|
||||||
|
if event.ctrl:
|
||||||
|
self.clear = True
|
||||||
return self.execute(context)
|
return self.execute(context)
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
render = bpy.data.scenes.get('Render')
|
scn = context.scene
|
||||||
if not render:
|
# scn = bpy.data.scenes.get('Render')
|
||||||
print('SKIP, no Render scene')
|
# if not scn:
|
||||||
return {"CANCELLED"}
|
# print('SKIP, no Render scene')
|
||||||
|
# return {"CANCELLED"}
|
||||||
|
|
||||||
ct = 0
|
ct = 0
|
||||||
nodes = render.node_tree.nodes
|
nodes = scn.node_tree.nodes
|
||||||
for fo in nodes:
|
for fo in nodes:
|
||||||
if fo.type != 'OUTPUT_FILE':
|
if fo.type != 'OUTPUT_FILE':
|
||||||
continue
|
continue
|
||||||
|
@ -56,13 +59,13 @@ class GPEXP_OT_number_outputs(bpy.types.Operator):
|
||||||
continue
|
continue
|
||||||
# print(f'numbering {fo.name}')
|
# print(f'numbering {fo.name}')
|
||||||
ct += 1
|
ct += 1
|
||||||
if self.ctrl:
|
if self.clear:
|
||||||
fn.delete_numbering(fo)
|
fn.delete_numbering(fo)
|
||||||
else:
|
else:
|
||||||
fn.renumber_keep_existing(fo)
|
fn.renumber_keep_existing(fo)
|
||||||
# fn.renumber(fo)
|
# fn.renumber(fo)
|
||||||
|
|
||||||
txt = 'de-numbered' if self.ctrl else 're-numbered'
|
txt = 'de-numbered' if self.clear else 're-numbered'
|
||||||
if ct:
|
if ct:
|
||||||
self.report({'INFO'}, f'{ct} output nodes {txt}')
|
self.report({'INFO'}, f'{ct} output nodes {txt}')
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -308,10 +308,11 @@ class GPEXP_OT_remove_viewlayer_on_selected(bpy.types.Operator):
|
||||||
ob = context.object
|
ob = context.object
|
||||||
|
|
||||||
## Force use of render scene (?)
|
## Force use of render scene (?)
|
||||||
rd_scn = bpy.data.scenes.get('Render')
|
rd_scn = context.scene
|
||||||
if not rd_scn:
|
# rd_scn = bpy.data.scenes.get('Render')
|
||||||
self.report({'ERROR'}, 'No render scene found')
|
# if not rd_scn:
|
||||||
return {'CANCELLED'}
|
# self.report({'ERROR'}, 'No render scene found')
|
||||||
|
# return {'CANCELLED'}
|
||||||
|
|
||||||
if self.remove_all_hidden:
|
if self.remove_all_hidden:
|
||||||
if self.multi_object:
|
if self.multi_object:
|
||||||
|
|
|
@ -2,7 +2,7 @@ bl_info = {
|
||||||
"name": "GP Render",
|
"name": "GP Render",
|
||||||
"description": "Organise export of gp layers through compositor output",
|
"description": "Organise export of gp layers through compositor output",
|
||||||
"author": "Samuel Bernou",
|
"author": "Samuel Bernou",
|
||||||
"version": (1, 4, 0),
|
"version": (1, 4, 1),
|
||||||
"blender": (3, 0, 0),
|
"blender": (3, 0, 0),
|
||||||
"location": "View3D",
|
"location": "View3D",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
|
|
8
ui.py
8
ui.py
|
@ -116,8 +116,14 @@ class GPEXP_PT_gp_node_ui(Panel):
|
||||||
txt = f'Renumber {ct} Selected Outputs'
|
txt = f'Renumber {ct} Selected Outputs'
|
||||||
subcol = col.column()
|
subcol = col.column()
|
||||||
subcol.enabled = bool(ct)
|
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=layout.row(align=True)
|
||||||
row.operator('gp.merge_preview_ouput', icon='NODETREE', text='Set Preview')
|
row.operator('gp.merge_preview_ouput', icon='NODETREE', text='Set Preview')
|
||||||
row.operator('gp.merge_preview_ouput', icon='X', text='').clear = True
|
row.operator('gp.merge_preview_ouput', icon='X', text='').clear = True
|
||||||
|
|
Loading…
Reference in New Issue