[Bf-blender-cvs] [64218999ef9] temp_lineart_contained: LineArt: Cmake stuff migration.

YimingWu noreply at git.blender.org
Thu Nov 12 06:31:02 CET 2020


Commit: 64218999ef934ca6243d6716ef5aec6d54a013a8
Author: YimingWu
Date:   Thu Nov 12 13:30:34 2020 +0800
Branches: temp_lineart_contained
https://developer.blender.org/rB64218999ef934ca6243d6716ef5aec6d54a013a8

LineArt: Cmake stuff migration.

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

M	source/blender/editors/object/object_add.c
M	source/blender/editors/render/render_update.c
M	source/blender/editors/space_api/spacetypes.c
M	source/blender/editors/util/CMakeLists.txt
M	source/blender/editors/util/ed_util.c
M	source/blender/gpencil_modifiers/CMakeLists.txt
M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/gpencil_modifiers/intern/lineart/CMakeLists.txt
R098	source/blender/editors/include/ED_lineart.h	source/blender/gpencil_modifiers/intern/lineart/ED_lineart.h
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/makesdna/DNA_gpencil_modifier_types.h
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/rna_gpencil_modifier.c
M	source/blender/makesrna/intern/rna_scene.c

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

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index c555b85a018..19a4ca87278 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1349,7 +1349,6 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op)
 
       /* Turn on Line Art auto update to show the result. */
       Scene *scene = CTX_data_scene(C);
-      scene->lineart.flags |= LRT_AUTO_UPDATE;
     }
 #endif
     case GP_EMPTY:
diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c
index bb20eb68bf1..0968560678b 100644
--- a/source/blender/editors/render/render_update.c
+++ b/source/blender/editors/render/render_update.c
@@ -60,10 +60,6 @@
 #include "ED_render.h"
 #include "ED_view3d.h"
 
-#ifdef WITH_LINEART
-#  include "ED_lineart.h"
-#endif
-
 #include "DEG_depsgraph.h"
 
 #include "WM_api.h"
@@ -109,15 +105,6 @@ void ED_render_scene_update(const DEGEditorUpdateContext *update_ctx, int update
   CTX_wm_manager_set(C, bmain->wm.first);
   wm = bmain->wm.first;
 
-#ifdef WITH_LINEART
-  /* TODO: Needs some specific flag in the render pipeline that marks line art for update, that way
-   * we could avoid some unecessary updating.
-   */
-  if (updated) {
-    ED_lineart_post_frame_update_external(C, scene, update_ctx->depsgraph, false);
-  }
-#endif
-
   for (win = wm->windows.first; win; win = win->next) {
     bScreen *screen = WM_window_get_active_screen(win);
     ScrArea *area;
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index 329bb7a7633..10ce7b81954 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -66,10 +66,6 @@
 #include "ED_userpref.h"
 #include "ED_uvedit.h"
 
-#ifdef WITH_LINEART
-#  include "ED_lineart.h"
-#endif
-
 #include "io_ops.h"
 
 /* only call once on startup, storage is global in BKE kernel listbase */
@@ -130,10 +126,6 @@ void ED_spacetypes_init(void)
   ED_operatortypes_view2d();
   ED_operatortypes_ui();
 
-#ifdef WITH_LINEART
-  ED_operatortypes_lineart();
-#endif
-
   ED_screen_user_menu_register();
 
   /* gizmo types */
diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt
index 045fb76c9ae..e57cac9868d 100644
--- a/source/blender/editors/util/CMakeLists.txt
+++ b/source/blender/editors/util/CMakeLists.txt
@@ -61,7 +61,6 @@ set(SRC
   ../include/ED_keyframes_draw.h
   ../include/ED_keyframes_edit.h
   ../include/ED_keyframing.h
-  ../include/ED_lineart.h
   ../include/ED_lattice.h
   ../include/ED_markers.h
   ../include/ED_mask.h
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 118dc1bb7e8..76c261c9cba 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -59,7 +59,6 @@
 
 #include "ED_armature.h"
 #include "ED_image.h"
-#include "ED_lineart.h"
 #include "ED_mesh.h"
 #include "ED_node.h"
 #include "ED_object.h"
@@ -187,11 +186,6 @@ void ED_editors_init(bContext *C)
 
   SWAP(int, reports->flag, reports_flag_prev);
   wm->op_undo_depth--;
-
-  /* Line Art data lock duing async calculation */
-#ifdef WITH_LINEART
-  ED_lineart_init_locks();
-#endif
 }
 
 /* frees all editmode stuff */
@@ -232,11 +226,6 @@ void ED_editors_exit(Main *bmain, bool do_undo_system)
   /* global in meshtools... */
   ED_mesh_mirror_spatial_table_end(NULL);
   ED_mesh_mirror_topo_table_end(NULL);
-
-  /* Line Art data*/
-#ifdef WITH_LINEART
-  ED_lineart_destroy_render_data_external();
-#endif
 }
 
 bool ED_editors_flush_edits_for_object_ex(Main *bmain,
diff --git a/source/blender/gpencil_modifiers/CMakeLists.txt b/source/blender/gpencil_modifiers/CMakeLists.txt
index e0cbc472f2e..d5ae16623e7 100644
--- a/source/blender/gpencil_modifiers/CMakeLists.txt
+++ b/source/blender/gpencil_modifiers/CMakeLists.txt
@@ -22,6 +22,7 @@
 set(INC
   .
   intern
+  intern/lineart
   ../blenfont
   ../blenkernel
   ../blenlib
@@ -82,7 +83,7 @@ endif()
 
 if(WITH_LINEART)
   add_definitions(-DWITH_LINEART)
-  add_subdirectory(lineart)
+  add_subdirectory(intern/lineart)
 endif()
 
 add_definitions(${GL_DEFINITIONS})
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index 7f6a4a93562..22529e46793 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -143,9 +143,6 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
   bGPdata *gpd = ob->data;
 
   Scene *s = DEG_get_evaluated_scene(depsgraph);
-  if (!(s->lineart.flags & LRT_AUTO_UPDATE)) {
-    return;
-  }
 
   /* Guard early, don't trigger calculation when no gpencil frame is present. Probably should
    * disable in the isModifierDisabled() function but we need addtional arg for depsgraph and
@@ -172,50 +169,10 @@ static void generateStrokes(GpencilModifierData *md, Depsgraph *depsgraph, Objec
     return;
   }
 
-  if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_IDLE)) {
-    /* Update triggered when nothing's happening, means DG update, so we request a refresh on line
-     * art cache, meanwhile waiting for result. Update will trigger again. */
-    ED_lineart_modifier_sync_flag_set(LRT_SYNC_WAITING, true);
-    /* Don't have data yet, update line art. Note:  ED_lineart_post_frame_update_external will
-     * automatically return when calculation is already in progress.*/
-    if (is_render) {
+  ED_lineart_compute_feature_lines_internal(depsgraph, lmd, 1);
 
-      if (G.debug_value == 4000) {
-        printf("LRT: -------- Modifier calls for update when idle.\n");
-      }
-      ED_lineart_post_frame_update_external(
-          NULL, DEG_get_evaluated_scene(depsgraph), depsgraph, true);
-      while (!ED_lineart_modifier_sync_flag_check(LRT_SYNC_FRESH) ||
-             !ED_lineart_calculation_flag_check(LRT_RENDER_FINISHED)) {
-        /* Wait till it's done. */
-      }
-    }
-    else {
-      return;
-    }
-  }
-  else if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_WAITING)) {
-    if (G.debug_value == 4000) {
-      printf("LRT: -------- Modifier is waiting for data in LRT_SYNC_WAITING.\n");
-    }
-    /* Calculation in process. */
-    if (is_render) {
-      while (!ED_lineart_modifier_sync_flag_check(LRT_SYNC_FRESH) ||
-             !ED_lineart_calculation_flag_check(LRT_RENDER_FINISHED)) {
-        /* Wait till it's done. */
-      }
-    }
-    else {
-      return;
-    }
-  }
-
-  if (G.debug_value == 4000) {
-    printf("(is_render == %d) ", is_render);
-  }
-
-  /* If we reach here, means calculation is finished (LRT_SYNC_FRESH), we grab cache. flag reset is
-   * done by calculation function.*/
+  /* If we reach here, means calculation is finished (LRT_SYNC_FRESH), we grab cache. flag
+   * reset is done by calculation function.*/
   generate_strokes_actual(md, depsgraph, ob, gpl, gpf);
 
   WM_main_add_notifier(NA_EDITED | NC_GPENCIL, NULL);
@@ -240,26 +197,7 @@ static void bakeModifier(Main *UNUSED(bmain),
     return;
   }
 
-  if (scene->lineart.flags & LRT_AUTO_UPDATE) {
-    if (ED_lineart_modifier_sync_flag_check(LRT_SYNC_IDLE)) {
-      /* Need to run it once again. */
-      ED_lineart_modifier_sync_flag_set(LRT_SYNC_WAITING, true);
-      BLI_spin_lock(&lineart_share.lock_loader);
-      ED_lineart_compute_feature_lines_background(depsgraph, 1);
-      /* Wait for loading finish. */
-      BLI_spin_lock(&lineart_share.lock_loader);
-      BLI_spin_unlock(&lineart_share.lock_loader);
-    }
-    while (!ED_lineart_modifier_sync_flag_check(LRT_SYNC_FRESH) ||
-           !ED_lineart_calculation_flag_check(LRT_RENDER_FINISHED)) {
-      /* Wait till 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;
-  }
+  ED_lineart_compute_feature_lines_internal(depsgraph, lmd, 1);
 
   generate_strokes_actual(md, depsgraph, ob, gpl, gpf);
 }
@@ -330,34 +268,18 @@ static void panel_draw(const bContext *C, Panel *panel)
   else if (source_type == LRT_SOURCE_COLLECTION) {
     uiItemR(layout, ptr, "source_collection", 0, NULL, ICON_OUTLINER_COLLECTION);
   }
-
-  if (scene->lineart.flags & LRT_EVERYTHING_AS_CONTOUR) {
-    uiItemL(layout, "Line types are fuzzy", ICON_NONE);
-  }
   else {
-    uiLayout *column = uiLayoutColumn(layout, true);
-    if (scene->lineart.line_types & LRT_EDGE_FLAG_CONTOUR) {
-      uiItemR(column, ptr, "use_contour", 0, NULL, ICON_NONE);
-    }
-    if (scene->lineart.line_types & LRT_EDGE_FLAG_CREASE) {
-      uiItemR(column, ptr, "use_crease", 0, "Crease", ICON_NONE);
-    }
-    if (scene->lineart.line_types & LRT_EDGE_FLAG_MATERIAL) {
-      uiItemR(column, ptr, "use_material", 0, "Material", ICON_NONE);
-    }
-    if (scene->lineart.line_types & LRT_EDGE_FLAG_EDGE_MARK) {
-      uiItemR(column, ptr, "use_edge_mark", 0, "Edge Marks", ICON_NONE);
-    }
-    if (scene->lineart.flags & LRT_INTERSECTION_AS_CONTOUR) {
-      uiItemL(column, "Intersection is fuzzy", ICON_NONE);
-    }
-    else {
-      if (scene->lineart.line_types & LRT_EDGE_FLAG_INTERSECTION) {
-        uiItemR(column, ptr, "use_intersection", 0, "Intersection", ICON_NONE);
-      }
-    }
+    /* Source is Scene. */
   }
 
+  uiLayout *column = uiLayoutColumn(layout, true);
+
+  uiItemR(column, ptr, "use_contour", 0, NULL, ICON_NONE);
+  uiItemR(column, ptr, "use_crease", 0, "Crease", ICON_NONE);
+  uiItemR(column, ptr, "use_material", 0, "Material", ICON_NONE);
+  uiItemR(column, ptr, "use_edge_mark", 0, "Edge Marks", ICON_NONE);
+  uiItemR(column, ptr, "use_intersection", 0, "Intersection", ICON_NONE);
+
   uiItemPointerR(layout, ptr, "target_layer", &obj_data_ptr, "layers", NULL, ICON_GREASEPENCIL);
   uiItemPointerR(
       layout, ptr, "target_material", &obj_data_ptr, "materials", NULL, ICON_SHADING_TEXTURE);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/CMakeLists

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list