From af2d8e1ad462684170e8d1c46a85e1b51a944162 Mon Sep 17 00:00:00 2001 From: pullusb Date: Wed, 2 Apr 2025 15:55:34 +0200 Subject: [PATCH] Exclude GP using is_background in autobuild by default 1.8.15 - changed: exclude background GP by default in autobuild (`is_background` is a custom property set on some GP by the addon "Background Plane Manager") - added: autobuild bool argument `exclude_background_gp` (Default to True). --- CHANGELOG.md | 6 ++++++ OP_auto_build.py | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ad41aae..d7b7c50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,12 @@ Activate / deactivate layer opacity according to prefix Activate / deactivate all masks using MA layers --> +1.8.15 + +- changed: exclude background GP by default in autobuild (`is_background` is a custom property set on some GP by the addon "Background Plane Manager") +- added: autobuild bool argument `exclude_background_gp` (Default to True). +- fixed: clean name in file output gernerator + 1.8.14 - fixed: error when trying remove a viewlayer diff --git a/OP_auto_build.py b/OP_auto_build.py index 2ccdf80..ed5b0f3 100644 --- a/OP_auto_build.py +++ b/OP_auto_build.py @@ -129,6 +129,9 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator): add_preview : BoolProperty(name='Add Preview', default=True, description='Create preview with stacked alpha over on render layers') + exclude_background_gp : BoolProperty(name='Exclude Background GP', default=True, + description='Exclude GP object with boolean custom property "is_background" at True (created by "Background Plane Manager" addon)') + # File output templates base_path : bpy.props.StringProperty(name='Base Path', default='', options={'SKIP_SAVE'}) file_slot : bpy.props.StringProperty(name='File Slot', default='', options={'SKIP_SAVE'}) @@ -200,6 +203,10 @@ class GPEXP_OT_render_auto_build(bpy.types.Operator): scn.gp_render_settings.render_scene = render_scn.name all_gp_objects = [o for o in context.scene.objects if o.type == 'GPENCIL'] + + ## Exclude Background GP (is_background is a custom property set by the addon "Background Plane Manager") + if self.exclude_background_gp: + all_gp_objects = [o for o in all_gp_objects if not o.get('is_background')] ## Clean name and visibility if self.clean_name_and_visibility: