[Bf-blender-cvs] [0a42b85fc47] lanpr-under-gp: Lineart: fixing Bounding area issues.

YimingWu noreply at git.blender.org
Tue Sep 22 08:15:36 CEST 2020


Commit: 0a42b85fc47487675527dcaf96c971e6c9afba09
Author: YimingWu
Date:   Tue Sep 22 14:15:14 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB0a42b85fc47487675527dcaf96c971e6c9afba09

Lineart: fixing Bounding area issues.

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

M	source/blender/editors/lineart/lineart_cpu.c
M	source/blender/makesdna/DNA_lineart_types.h

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

diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index e47844c3dce..8c07b3e289f 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -869,10 +869,13 @@ static void lineart_main_cull_triangles(LineartRenderBuffer *rb, bool clip_far)
 #define REMOVE_ORIGINAL_LINES \
   BLI_remlink(&rb->all_render_lines, (void *)rt->rl[0]); \
   rt->rl[0]->next = rt->rl[0]->prev = 0; \
+  rt->rl[0]->flags |= LRT_EDGE_FLAG_CHAIN_PICKED; \
   BLI_remlink(&rb->all_render_lines, (void *)rt->rl[1]); \
   rt->rl[1]->next = rt->rl[1]->prev = 0; \
+  rt->rl[1]->flags |= LRT_EDGE_FLAG_CHAIN_PICKED; \
   BLI_remlink(&rb->all_render_lines, (void *)rt->rl[2]); \
-  rt->rl[2]->next = rt->rl[2]->prev = 0;
+  rt->rl[2]->next = rt->rl[2]->prev = 0; \
+  rt->rl[2]->flags |= LRT_EDGE_FLAG_CHAIN_PICKED;
 
       switch (in0 + in1 + in2) {
         case 0: /* ignore this triangle. */
@@ -1698,7 +1701,7 @@ int ED_lineart_object_collection_usage_check(Collection *c, Object *ob)
   }
 
   if (c->children.first == NULL) {
-    if (BKE_collection_has_object(c, ob)) {
+    if (BKE_collection_has_object(c, ob->id.orig_id)) {
       if (ob->lineart.usage == OBJECT_LRT_INHERENT) {
         if (c->lineart_usage == COLLECTION_LRT_OCCLUSION_ONLY) {
           return OBJECT_LRT_OCCLUSION_ONLY;
@@ -2436,7 +2439,7 @@ static void lineart_main_compute_scene_contours(LineartRenderBuffer *rb)
       dot_1 = 0;
       dot_2 = 0;
 
-      if (!rl->next && !rl->prev) {
+      if ((rl->flags & LRT_EDGE_FLAG_CHAIN_PICKED) || (!rl->l) || (!rl->r)) {
         continue;
       }
 
diff --git a/source/blender/makesdna/DNA_lineart_types.h b/source/blender/makesdna/DNA_lineart_types.h
index 46bfdf15c6a..f5d6b26193e 100644
--- a/source/blender/makesdna/DNA_lineart_types.h
+++ b/source/blender/makesdna/DNA_lineart_types.h
@@ -50,6 +50,7 @@ typedef enum eLineartEdgeFlag {
   LRT_EDGE_FLAG_INTERSECTION = (1 << 4),
   /**  floating edge, unimplemented yet */
   LRT_EDGE_FLAG_FLOATING = (1 << 5),
+  /**  also used as discarded line mark */
   LRT_EDGE_FLAG_CHAIN_PICKED = (1 << 6),
   LRT_EDGE_FLAG_CLIPPED = (1 << 7),
   /* Maxed out for 8 bits, DON'T ADD ANYMORE until improvements on the data structure. */



More information about the Bf-blender-cvs mailing list