diff --git a/CHANGELOG.md b/CHANGELOG.md index f61bc88..fec207e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,10 @@ Activate / deactivate layer opaticty according to prefix Activate / deactivate all masks using MA layers --> +0.5.3 + +- fix: manage output : activate only some viewlayer take context.scene instead of render.scene + 0.5.2 - fix: `rename lowercase` also change modifier layer target names (else target was broken) diff --git a/OP_manage_outputs.py b/OP_manage_outputs.py index b3acee6..187cb38 100644 --- a/OP_manage_outputs.py +++ b/OP_manage_outputs.py @@ -174,12 +174,13 @@ class GPEXP_OT_enable_all_viewlayers(bpy.types.Operator): bl_options = {"REGISTER"} def execute(self, context): - rd_scn = bpy.data.scenes.get('Render') - if not rd_scn: - print('SKIP, no Render scene') - return {"CANCELLED"} + # scn = bpy.data.scenes.get('Render') + # if not scn: + # print('SKIP, no Render scene') + # return {"CANCELLED"} + scn = context.scene - vl_list = [vl for vl in rd_scn.view_layers if not vl.use and vl.name not in {'View Layer', 'exclude'}] + vl_list = [vl for vl in scn.view_layers if not vl.use and vl.name not in {'View Layer', 'exclude'}] for v in vl_list: v.use = True @@ -193,19 +194,20 @@ class GPEXP_OT_activate_only_selected_layers(bpy.types.Operator): bl_options = {"REGISTER"} def execute(self, context): - rd_scn = bpy.data.scenes.get('Render') - if not rd_scn: - print('SKIP, no Render scene') - return {"CANCELLED"} - - nodes = rd_scn.node_tree.nodes + # scn = bpy.data.scenes.get('Render') + # if not scn: + # print('SKIP, no Render scene') + # return {"CANCELLED"} + scn = context.scene + + nodes = scn.node_tree.nodes rlayers_nodes = [n for n in nodes if n.select and n.type == 'R_LAYERS'] - vls = [rd_scn.view_layers.get(n.layer) for n in rlayers_nodes if rd_scn.view_layers.get(n.layer)] - for v in rd_scn.view_layers: + vls = [scn.view_layers.get(n.layer) for n in rlayers_nodes if scn.view_layers.get(n.layer)] + for v in scn.view_layers: v.use = v in vls - self.report({"INFO"}, f'Now only {len(vls)} viewlayer active (/{len(rd_scn.view_layers)})') + self.report({"INFO"}, f'Now only {len(vls)} viewlayer active (/{len(scn.view_layers)})') return {"FINISHED"} diff --git a/__init__.py b/__init__.py index 39291da..db8040c 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": (0, 5, 2), + "version": (0, 5, 3), "blender": (2, 93, 0), "location": "View3D", "warning": "",