[Bf-blender-cvs] [c4e0c136046] temp-lineart-contained: LineArt: Allow intersection in object selection mode.

YimingWu noreply at git.blender.org
Mon May 24 15:56:37 CEST 2021


Commit: c4e0c136046122baf94eb21e27ef66e022a16ed2
Author: YimingWu
Date:   Mon May 24 21:56:19 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rBc4e0c136046122baf94eb21e27ef66e022a16ed2

LineArt: Allow intersection in object selection mode.

===================================================================

M	source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c

===================================================================

diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 493e93e14d4..51664d70432 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -345,7 +345,7 @@ typedef struct LineartCache {
   /** Cache only contains edge types specified in this variable.
    * TODO: it's a fixed value (LRT_EDGE_FLAG_ALL_TYPE) right now, allow further selections in the
    * future. */
-  char rb_edge_types;
+  unsigned char rb_edge_types;
 } LineartCache;
 
 #define DBL_TRIANGLE_LIM 1e-8
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 853f9e6c161..e41becaf126 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -4242,7 +4242,7 @@ static void lineart_gpencil_generate(LineartCache *cache,
     if (rlc->level > level_end || rlc->level < level_start) {
       continue;
     }
-    if (orig_ob && orig_ob != rlc->object_ref) {
+    if (orig_ob && orig_ob != rlc->object_ref && rlc->type != LRT_EDGE_FLAG_INTERSECTION) {
       continue;
     }
     if (orig_col && rlc->object_ref) {
@@ -4385,26 +4385,20 @@ void MOD_lineart_gpencil_generate(LineartCache *cache,
 
   Object *source_object = NULL;
   Collection *source_collection = NULL;
-  short use_types = 0;
+  short use_types = edge_types;
   if (source_type == LRT_SOURCE_OBJECT) {
     if (!source_reference) {
       return;
     }
     source_object = (Object *)source_reference;
-    /* Note that intersection lines will only be in collection. */
-    use_types = edge_types & (~LRT_EDGE_FLAG_INTERSECTION);
   }
   else if (source_type == LRT_SOURCE_COLLECTION) {
     if (!source_reference) {
       return;
     }
     source_collection = (Collection *)source_reference;
-    use_types = edge_types;
-  }
-  else {
-    /* Whole scene. */
-    use_types = edge_types;
   }
+
   float gp_obmat_inverse[4][4];
   invert_m4_m4(gp_obmat_inverse, ob->obmat);
   lineart_gpencil_generate(cache,



More information about the Bf-blender-cvs mailing list