[Bf-blender-cvs] [d142b5605e9] lanpr-under-gp: LineArt: Chaning lookup in near by bounding areas.

YimingWu noreply at git.blender.org
Mon Oct 19 14:25:56 CEST 2020


Commit: d142b5605e9518255fb4fe104c3cb0e30a866c7e
Author: YimingWu
Date:   Mon Oct 19 20:25:40 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rBd142b5605e9518255fb4fe104c3cb0e30a866c7e

LineArt: Chaning lookup in near by bounding areas.

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

M	source/blender/editors/lineart/lineart_chain.c

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

diff --git a/source/blender/editors/lineart/lineart_chain.c b/source/blender/editors/lineart/lineart_chain.c
index f4e0434b292..b2ca98e9a0b 100644
--- a/source/blender/editors/lineart/lineart_chain.c
+++ b/source/blender/editors/lineart/lineart_chain.c
@@ -770,6 +770,28 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartRenderBuf
       }
     }
   }
+  float adjacent_new_len=dist; /* We want a closer point anyway. So using modified dist is fine. */
+  LineartChainRegisterEntry* adjacent_closest;
+
+#define LRT_TEST_ADJACENT_AREAS(dist_to, list)\
+  if(dist_to<dist && dist_to>0){\
+    LISTBASE_FOREACH(LinkData* ,ld,list){\
+      adjacent_closest = lineart_chain_get_closest_cre(rb,(LineartBoundingArea*)ld->data,rlc,rlci,occlusion,transparency_mask,dist,do_geometry_space,&adjacent_new_len);\
+      if(adjacent_new_len < dist){\
+        dist=  adjacent_new_len;\
+        closest_cre = adjacent_closest;\
+      }\
+    }\
+  }
+  if(!do_geometry_space){
+    LRT_TEST_ADJACENT_AREAS(rlci->pos[0] - ba->l, &ba->lp);
+    LRT_TEST_ADJACENT_AREAS(ba->r - rlci->pos[0], &ba->rp);
+    LRT_TEST_ADJACENT_AREAS(ba->u - rlci->pos[1], &ba->up);
+    LRT_TEST_ADJACENT_AREAS(rlci->pos[1] - ba->b, &ba->bp);
+  }
+  if (result_new_len) {
+    (*result_new_len) = dist;
+  }
   return closest_cre;
 }



More information about the Bf-blender-cvs mailing list