[Bf-blender-cvs] [8732277b8c6] lanpr-under-gp: LineArt: Move OP exec functions into lineart_ops.c
YimingWu
noreply at git.blender.org
Wed Oct 28 03:52:34 CET 2020
Commit: 8732277b8c6827907262a8c981ed9a7543ad6316
Author: YimingWu
Date: Wed Oct 28 10:52:25 2020 +0800
Branches: lanpr-under-gp
https://developer.blender.org/rB8732277b8c6827907262a8c981ed9a7543ad6316
LineArt: Move OP exec functions into lineart_ops.c
===================================================================
M source/blender/editors/include/ED_lineart.h
M source/blender/editors/lineart/lineart_cpu.c
M source/blender/editors/lineart/lineart_ops.c
M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
===================================================================
diff --git a/source/blender/editors/include/ED_lineart.h b/source/blender/editors/include/ED_lineart.h
index 7c30aec5ef2..f62478f7155 100644
--- a/source/blender/editors/include/ED_lineart.h
+++ b/source/blender/editors/include/ED_lineart.h
@@ -629,43 +629,43 @@ struct bGPDlayer;
struct bGPDframe;
struct GpencilModifierData;
-void ED_lineart_gpencil_generate_from_chain(struct Depsgraph *depsgraph,
- Object *gpencil_object,
- float **gp_obmat_inverse,
- struct bGPDlayer *UNUSED(gpl),
- struct bGPDframe *gpf,
- int level_start,
- int level_end,
- int material_nr,
- struct Object *source_object,
- struct Collection *source_collection,
- int types,
- unsigned char transparency_flags,
- unsigned char transparency_mask,
- short thickness,
- float opacity,
- float pre_sample_length,
- const char *source_vgname,
- const char *vgname,
- int modifier_flags);
-void ED_lineart_gpencil_generate_strokes_direct(struct Depsgraph *depsgraph,
- struct Object *ob,
- struct bGPDlayer *gpl,
- struct bGPDframe *gpf,
- char source_type,
- void *source_reference,
- int level_start,
- int level_end,
- int mat_nr,
- short line_types,
- unsigned char transparency_flags,
- unsigned char transparency_mask,
- short thickness,
- float opacity,
- float pre_sample_length,
- const char *source_vgname,
- const char *vgname,
- int modifier_flags);
+void ED_lineart_gpencil_generate(struct Depsgraph *depsgraph,
+ Object *gpencil_object,
+ float **gp_obmat_inverse,
+ struct bGPDlayer *UNUSED(gpl),
+ struct bGPDframe *gpf,
+ int level_start,
+ int level_end,
+ int material_nr,
+ struct Object *source_object,
+ struct Collection *source_collection,
+ int types,
+ unsigned char transparency_flags,
+ unsigned char transparency_mask,
+ short thickness,
+ float opacity,
+ float pre_sample_length,
+ const char *source_vgname,
+ const char *vgname,
+ int modifier_flags);
+void ED_lineart_gpencil_generate_with_type(struct Depsgraph *depsgraph,
+ struct Object *ob,
+ struct bGPDlayer *gpl,
+ struct bGPDframe *gpf,
+ char source_type,
+ void *source_reference,
+ int level_start,
+ int level_end,
+ int mat_nr,
+ short line_types,
+ unsigned char transparency_flags,
+ unsigned char transparency_mask,
+ short thickness,
+ float opacity,
+ float pre_sample_length,
+ const char *source_vgname,
+ const char *vgname,
+ int modifier_flags);
struct bContext;
diff --git a/source/blender/editors/lineart/lineart_cpu.c b/source/blender/editors/lineart/lineart_cpu.c
index d8c261c1b10..d4fbad88fb2 100644
--- a/source/blender/editors/lineart/lineart_cpu.c
+++ b/source/blender/editors/lineart/lineart_cpu.c
@@ -45,7 +45,6 @@
#include "BKE_material.h"
#include "BKE_mesh.h"
#include "BKE_object.h"
-#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BKE_text.h"
@@ -73,15 +72,11 @@
#include "WM_api.h"
#include "WM_types.h"
-#include "UI_resources.h"
-
#include "lineart_intern.h"
LineartSharedResource lineart_share;
-/* Own functions */
-
-/* 2D Bounding area accelerator structure */
+/* static function declarations */
static LineartBoundingArea *linear_bounding_areat_first_possible(LineartRenderBuffer *rb,
LineartRenderLine *rl);
@@ -1787,31 +1782,6 @@ static void lineart_main_load_geometries(Depsgraph *depsgraph,
DEG_OBJECT_ITER_END;
}
-#define INTERSECT_SORT_MIN_TO_MAX_3(ia, ib, ic, lst) \
- { \
- lst[0] = LRT_MIN3_INDEX(ia, ib, ic); \
- lst[1] = (((ia <= ib && ib <= ic) || (ic <= ib && ib <= ia)) ? \
- 1 : \
- (((ic <= ia && ia <= ib) || (ib < ia && ia <= ic)) ? 0 : 2)); \
- lst[2] = LRT_MAX3_INDEX(ia, ib, ic); \
- }
-
-/* ia ib ic are ordered */
-#define INTERSECT_JUST_GREATER(is, order, num, index) \
- { \
- index = (num < is[order[0]] ? \
- order[0] : \
- (num < is[order[1]] ? order[1] : (num < is[order[2]] ? order[2] : order[2]))); \
- }
-
-/* ia ib ic are ordered */
-#define INTERSECT_JUST_SMALLER(is, order, num, index) \
- { \
- index = (num > is[order[2]] ? \
- order[2] : \
- (num > is[order[1]] ? order[1] : (num > is[order[0]] ? order[0] : order[0]))); \
- }
-
static bool lineart_another_edge_2v(const LineartRenderTriangle *rt,
const LineartRenderVert *rv,
LineartRenderVert **l,
@@ -1859,6 +1829,31 @@ static int lineart_edge_from_triangle(const LineartRenderTriangle *rt, const Lin
return 0;
}
+#define INTERSECT_SORT_MIN_TO_MAX_3(ia, ib, ic, lst) \
+ { \
+ lst[0] = LRT_MIN3_INDEX(ia, ib, ic); \
+ lst[1] = (((ia <= ib && ib <= ic) || (ic <= ib && ib <= ia)) ? \
+ 1 : \
+ (((ic <= ia && ia <= ib) || (ib < ia && ia <= ic)) ? 0 : 2)); \
+ lst[2] = LRT_MAX3_INDEX(ia, ib, ic); \
+ }
+
+/* ia ib ic are ordered */
+#define INTERSECT_JUST_GREATER(is, order, num, index) \
+ { \
+ index = (num < is[order[0]] ? \
+ order[0] : \
+ (num < is[order[1]] ? order[1] : (num < is[order[2]] ? order[2] : order[2]))); \
+ }
+
+/* ia ib ic are ordered */
+#define INTERSECT_JUST_SMALLER(is, order, num, index) \
+ { \
+ index = (num > is[order[2]] ? \
+ order[2] : \
+ (num > is[order[1]] ? order[1] : (num > is[order[0]] ? order[0] : order[0]))); \
+ }
+
/** This is the main function to calculate
* the occlusion status between 1(one) triangle and 1(one) line.
* if returned 1, then from/to will carry the occludded segments
@@ -2085,6 +2080,10 @@ static int lineart_triangle_line_imagespace_intersection_v2(SpinLock *UNUSED(spl
return 1;
}
+#undef INTERSECT_SORT_MIN_TO_MAX_3
+#undef INTERSECT_JUST_GREATER
+#undef INTERSECT_JUST_SMALLER
+
static bool lineart_triangle_share_edge(const LineartRenderTriangle *l,
const LineartRenderTriangle *r)
{
@@ -3903,25 +3902,25 @@ static int lineart_rb_line_types(LineartRenderBuffer *rb)
return types;
}
-void ED_lineart_gpencil_generate_from_chain(Depsgraph *depsgraph,
- Object *gpencil_object,
- float **gp_obmat_inverse,
- bGPDlayer *UNUSED(gpl),
- bGPDframe *gpf,
- int level_start,
- int level_end,
- int material_nr,
- Object *source_object,
- Collection *source_collection,
- int types,
- unsigned char transparency_flags,
- unsigned char transparency_mask,
- short thickness,
- float opacity,
- float pre_sample_length,
- const char *source_vgname,
- const char *vgname,
- int modifier_flags)
+void ED_lineart_gpencil_generate(Depsgra
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list