[Bf-blender-cvs] [7316aeb433a] lanpr-under-gp: LineArt: Do not block the process when applying modifier with auto update turned off.

YimingWu noreply at git.blender.org
Wed Jul 15 16:49:43 CEST 2020


Commit: 7316aeb433aaf3ea6d9bf5f65d54c49530346ac7
Author: YimingWu
Date:   Wed Jul 15 22:49:17 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB7316aeb433aaf3ea6d9bf5f65d54c49530346ac7

LineArt: Do not block the process when applying modifier with auto update turned off.

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

M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c

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

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 3e40c42ded8..0b150079a04 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -166,6 +166,7 @@ static void bakeModifier(Main *UNUSED(bmain),
 
   bGPdata *gpd = ob->data;
   LineartGpencilModifierData *lmd = (LineartGpencilModifierData *)md;
+  Scene *scene = DEG_get_evaluated_scene(depsgraph);
 
   bGPDlayer *gpl = BKE_gpencil_layer_get_by_name(gpd, lmd->target_layer, 1);
   if (gpl == NULL) {
@@ -176,10 +177,18 @@ static void bakeModifier(Main *UNUSED(bmain),
     return;
   }
 
-  while (ED_lineart_modifier_sync_flag_check(LRT_SYNC_WAITING)) {
-    ; /* TODO: Should use a "poll" callback to stop it from applying.
-       *For now just wait for it's done. */
+  if (scene->lineart.flags & LRT_AUTO_UPDATE) {
+    while (ED_lineart_modifier_sync_flag_check(LRT_SYNC_WAITING)) {
+      ; /* If auto update is on, line art would be running if  LRT_SYNC_WAITING is set, we just
+           wait for it's done.*/
+    }
+  }
+  else if (!ED_lineart_modifier_sync_flag_check(LRT_SYNC_FRESH) ||
+           !ED_lineart_modifier_sync_flag_check(LRT_SYNC_IDLE)) {
+    /* If not auto updating, and the cache isn't available, then do not generate strokes. */
+    return;
   }
+
   generate_strokes_actual(md, depsgraph, ob, gpl, gpf);
 }



More information about the Bf-blender-cvs mailing list