Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2022-01-17 12:20:47 +0300
committerYimingWu <xp8110@outlook.com>2022-01-17 12:22:09 +0300
commit40c8e23d481cbee683ea890a6bf49129e7fcf5df (patch)
tree1935ed569bb14592375f6de8e6524f7468ebc0a2 /source/blender/gpencil_modifiers
parente1e3043a51a6f88b3a79b935678464a06c2e469f (diff)
LineArt: Invert collection option.
Allows conveniently selecting an inverse of a collection. Reviewed By: Antonio Vazquez (antoniov) Differential Revision: https://developer.blender.org/D13846
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c4
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index b35ebd4be9a..59937bb0757 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -314,7 +314,9 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel)
uiItemR(layout, ptr, "source_object", 0, NULL, ICON_OBJECT_DATA);
}
else if (source_type == LRT_SOURCE_COLLECTION) {
- uiItemR(layout, ptr, "source_collection", 0, NULL, ICON_OUTLINER_COLLECTION);
+ uiLayout *sub = uiLayoutRow(layout, true);
+ uiItemR(sub, ptr, "source_collection", 0, NULL, ICON_OUTLINER_COLLECTION);
+ uiItemR(sub, ptr, "use_invert_collection", 0, "", ICON_ARROW_LEFTRIGHT);
}
else {
/* Source is Scene. */
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index f08d35891ce..5461b80cad1 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -4363,8 +4363,15 @@ static void lineart_gpencil_generate(LineartCache *cache,
continue;
}
if (orig_col && ec->object_ref) {
- if (!BKE_collection_has_object_recursive_instanced(orig_col, (Object *)ec->object_ref)) {
- continue;
+ if (BKE_collection_has_object_recursive_instanced(orig_col, (Object *)ec->object_ref)) {
+ if (modifier_flags & LRT_GPENCIL_INVERT_COLLECTION) {
+ continue;
+ }
+ }
+ else {
+ if (!(modifier_flags & LRT_GPENCIL_INVERT_COLLECTION)) {
+ continue;
+ }
}
}
if (mask_switches & LRT_GPENCIL_MATERIAL_MASK_ENABLE) {