tweak startup, add multi layer merge
1.3.4 - added: multi object merge - changed: little tweak on GP render startupmain
parent
04d6349d1c
commit
bc5a046bec
|
@ -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.3.4
|
||||||
|
|
||||||
|
- added: multi object merge
|
||||||
|
- changed: little tweak on GP render startup
|
||||||
|
|
||||||
1.3.3
|
1.3.3
|
||||||
|
|
||||||
- fixed: problem evaluating broken modifier target
|
- fixed: problem evaluating broken modifier target
|
||||||
|
|
|
@ -247,10 +247,16 @@ class GPEXP_OT_merge_viewlayers_to_active(bpy.types.Operator):
|
||||||
def poll(cls, context):
|
def poll(cls, context):
|
||||||
return context.object and context.object.type == 'GPENCIL'
|
return context.object and context.object.type == 'GPENCIL'
|
||||||
|
|
||||||
|
multi_object_merge : bpy.props.BoolProperty(default=False, options={'SKIP_SAVE'})
|
||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
ob = bpy.context.object
|
ob = context.object
|
||||||
# layers = [l for l in ob.data.layers if l.select and not l.hide]
|
|
||||||
act = ob.data.layers.active
|
act = ob.data.layers.active
|
||||||
|
|
||||||
|
if self.multi_object_merge:
|
||||||
|
|
||||||
|
layers = [l for ob in context.selected_objects if ob.type == 'GPENCIL' for l in ob.data.layers if l.select and l != act]
|
||||||
|
else:
|
||||||
layers = [l for l in ob.data.layers if l.select and l != act]
|
layers = [l for l in ob.data.layers if l.select and l != act]
|
||||||
|
|
||||||
## Tested in func
|
## Tested in func
|
||||||
|
|
|
@ -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, 3, 3),
|
"version": (1, 3, 4),
|
||||||
"blender": (2, 93, 0),
|
"blender": (2, 93, 0),
|
||||||
"location": "View3D",
|
"location": "View3D",
|
||||||
"warning": "",
|
"warning": "",
|
||||||
|
|
Binary file not shown.
5
fn.py
5
fn.py
|
@ -413,7 +413,10 @@ def get_frames_bbox(node_tree):
|
||||||
|
|
||||||
## -- nodes helper functions
|
## -- nodes helper functions
|
||||||
|
|
||||||
def merge_gplayer_viewlayers(ob, act=None, layers=None):
|
def merge_gplayer_viewlayers(ob=None, act=None, layers=None):
|
||||||
|
'''ob is not needed if active and layers are passed'''
|
||||||
|
if ob is None:
|
||||||
|
ob = bpy.context.object
|
||||||
if act is None:
|
if act is None:
|
||||||
act = ob.data.layers.active
|
act = ob.data.layers.active
|
||||||
if layers is None:
|
if layers is None:
|
||||||
|
|
5
ui.py
5
ui.py
|
@ -206,7 +206,10 @@ class GPEXP_PT_gp_dopesheet_ui(Panel):
|
||||||
ct = len([l for l in context.object.data.layers if l.select])
|
ct = len([l for l in context.object.data.layers if l.select])
|
||||||
txt = f'Merge {ct} layers'
|
txt = f'Merge {ct} layers'
|
||||||
# merge layers from dopesheet
|
# merge layers from dopesheet
|
||||||
row.operator('gp.merge_viewlayers_to_active', text=txt, icon='SELECT_EXTEND')
|
row.operator('gp.merge_viewlayers_to_active', text=txt, icon='SELECT_EXTEND').multi_object_merge = True
|
||||||
|
ct = len([l for ob in context.selected_objects if ob.type == 'GPENCIL' for l in ob.data.layers if l.select])
|
||||||
|
txt = f'Multi: {ct} layers'
|
||||||
|
row.operator('gp.merge_viewlayers_to_active', text=txt, icon='SELECT_EXTEND').multi_object_merge = True
|
||||||
row.enabled= ct > 1
|
row.enabled= ct > 1
|
||||||
|
|
||||||
col.operator('gpexp.auto_merge_adjacent_prefix', icon='SELECT_EXTEND')
|
col.operator('gpexp.auto_merge_adjacent_prefix', icon='SELECT_EXTEND')
|
||||||
|
|
Loading…
Reference in New Issue