diff --git a/CHANGELOG.md b/CHANGELOG.md index caa7822..074ea7a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Activate / deactivate all masks using MA layers 1.3.5 - added: button to exclude viewlayers and nodes by selection or by hided layers +- fixed: `delete view layer` error in merge, when fusing multiple view layer 1.3.4 diff --git a/fn.py b/fn.py index b075625..f2910c4 100644 --- a/fn.py +++ b/fn.py @@ -476,9 +476,11 @@ def merge_gplayer_viewlayers(ob=None, act=None, layers=None): if not act.viewlayer_render: return ({'ERROR'}, f'Active layer {act.info} has no viewlayer assigned') - # list layers and viewlayers + # List layers and viewlayers vls = [rd_scn.view_layers.get(l.viewlayer_render) for l in layers if l.viewlayer_render and l.viewlayer_render != act.viewlayer_render and rd_scn.view_layers.get(l.viewlayer_render)] + # Remove duplication + vls = list(set(vls)) # Remove viewlayer related nodes remove_nodes_by_viewlayer(vls, rd_scn) @@ -490,6 +492,8 @@ def merge_gplayer_viewlayers(ob=None, act=None, layers=None): ## Delete unused viewlayers () used_vl_name = [n.layer for n in rd_scn.node_tree.nodes if n.type == 'R_LAYERS' and n.layer] + used_vl_name = list(set(used_vl_name)) + for vl in vls: # rd_scn.view_layers.remove(vl) if vl.name == 'exclude':