diff options
author | Joseph Eagar <joeedh@gmail.com> | 2022-11-08 20:13:59 +0300 |
---|---|---|
committer | Joseph Eagar <joeedh@gmail.com> | 2022-11-08 20:13:59 +0300 |
commit | e59ebfef3c583985553e78492cf8cd07bbe7648e (patch) | |
tree | 35f31c3b592f40885baf8d8b078844c92bfbabe7 /source/blender/gpencil_modifiers/intern/lineart | |
parent | fe7088c99ff084f7218ab20136d49eb1a1dccd0b (diff) | |
parent | 4c182aef7ce0e8c26dd2b85c1fa2cd45c2ef64ea (diff) |
Merge branch 'master' into temp-sculpt-brush-channeltemp-sculpt-brush-channel
Diffstat (limited to 'source/blender/gpencil_modifiers/intern/lineart')
4 files changed, 21 insertions, 23 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpp_bridge.cc b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpp_bridge.cc index 5e741ccbd55..85f158d42e6 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpp_bridge.cc +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpp_bridge.cc @@ -9,17 +9,15 @@ #include "MOD_lineart.h" #include "lineart_intern.h" -static bool cmp_adjacent_items(const LineartAdjacentEdge &p1, const LineartAdjacentEdge &p2) -{ - int a = p1.v1 - p2.v1; - int b = p1.v2 - p2.v2; - /* parallel_sort() requires cmp() to return true when the first element needs to appear before - * the second element in the sorted array, false otherwise (strict weak ordering), see - * https://en.cppreference.com/w/cpp/named_req/Compare. */ - return a < 0 ? true : (a == 0 ? b < 0 : false); -} - void lineart_sort_adjacent_items(LineartAdjacentEdge *ai, int length) { - blender::parallel_sort(ai, ai + length, cmp_adjacent_items); + blender::parallel_sort( + ai, ai + length, [](const LineartAdjacentEdge &p1, const LineartAdjacentEdge &p2) { + int a = p1.v1 - p2.v1; + int b = p1.v2 - p2.v2; + /* parallel_sort() requires cmp() to return true when the first element needs to appear + * before the second element in the sorted array, false otherwise (strict weak ordering), + * see https://en.cppreference.com/w/cpp/named_req/Compare. */ + return a < 0 ? true : (a == 0 ? b < 0 : false); + }); } diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c index c1e71bde254..4b5c40c0e38 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c @@ -2633,7 +2633,7 @@ void lineart_main_load_geometries(Depsgraph *depsgraph, scene, eval_ob, eval_ob, - eval_ob->obmat, + eval_ob->object_to_world, is_render, olti, thread_count, @@ -3589,11 +3589,11 @@ static LineartData *lineart_create_render_buffer(Scene *scene, clipping_offset = 0.0001; } - copy_v3db_v3fl(ld->conf.camera_pos, camera->obmat[3]); + copy_v3db_v3fl(ld->conf.camera_pos, camera->object_to_world[3]); if (active_camera) { - copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->obmat[3]); + copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->object_to_world[3]); } - copy_m4_m4(ld->conf.cam_obmat, camera->obmat); + copy_m4_m4(ld->conf.cam_obmat, camera->object_to_world); ld->conf.cam_is_persp = (c->type == CAM_PERSP); ld->conf.near_clip = c->clip_start + clipping_offset; @@ -3620,8 +3620,8 @@ static LineartData *lineart_create_render_buffer(Scene *scene, if (lmd->light_contour_object) { Object *light_obj = lmd->light_contour_object; - copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->obmat[3]); - copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->obmat); + copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->object_to_world[3]); + copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->object_to_world); ld->conf.light_reference_available = true; if (light_obj->type == OB_LAMP) { ld->conf.cam_is_persp_secondary = ((Light *)light_obj->data)->type != LA_SUN; @@ -5418,7 +5418,7 @@ void MOD_lineart_gpencil_generate(LineartCache *cache, } float gp_obmat_inverse[4][4]; - invert_m4_m4(gp_obmat_inverse, ob->obmat); + invert_m4_m4(gp_obmat_inverse, ob->object_to_world); lineart_gpencil_generate(cache, depsgraph, ob, diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c index 80517979f30..6f44cc68a19 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c @@ -154,7 +154,7 @@ static bool bake_strokes(Object *ob, typedef struct LineartBakeJob { wmWindowManager *wm; void *owner; - short *stop, *do_update; + bool *stop, *do_update; float *progress; /* C or ob must have one != NULL. */ @@ -218,8 +218,8 @@ static void lineart_gpencil_guard_modifiers(LineartBakeJob *bj) } static void lineart_gpencil_bake_startjob(void *customdata, - short *stop, - short *do_update, + bool *stop, + bool *do_update, float *progress) { LineartBakeJob *bj = (LineartBakeJob *)customdata; @@ -337,7 +337,7 @@ static int lineart_gpencil_bake_common(bContext *C, } float pseduo_progress; - short pseduo_do_update; + bool pseduo_do_update; lineart_gpencil_bake_startjob(bj, NULL, &pseduo_do_update, &pseduo_progress); BLI_linklist_free(bj->objects, NULL); diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c index e34e6fc43ea..edea052e728 100644 --- a/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c +++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_shadow.c @@ -1167,7 +1167,7 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph, copy_v3_v3_db(ld->conf.camera_pos_secondary, ld->conf.camera_pos); copy_m4_m4(ld->conf.cam_obmat_secondary, ld->conf.cam_obmat); - copy_m4_m4(ld->conf.cam_obmat, lmd->light_contour_object->obmat); + copy_m4_m4(ld->conf.cam_obmat, lmd->light_contour_object->object_to_world); copy_v3db_v3fl(ld->conf.camera_pos, ld->conf.cam_obmat[3]); ld->conf.cam_is_persp_secondary = ld->conf.cam_is_persp; ld->conf.cam_is_persp = is_persp; |