Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYimingWu <xp8110@outlook.com>2022-04-03 11:46:10 +0300
committerYimingWu <xp8110@outlook.com>2022-04-20 15:00:43 +0300
commit3a055e8f41d18442be21a231c33f517adefc24a6 (patch)
tree3bd4d1dd017bdc4100a18570b2904b09551eb74d
parent0d5d55428731c15732e107241de5b0c09d52edcb (diff)
LineArt: Crease by sharp
-rw-r--r--source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index c263f69ff00..0241f8f3d96 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -1561,20 +1561,20 @@ static void lineart_identify_mlooptri_feature_edges(void *__restrict userdata,
const MLoopTri *mlooptri = e_feat_data->mlooptri;
if (rb->use_crease) {
- // if (rb->sharp_as_crease && !BM_elem_flag_test(e, BM_ELEM_SMOOTH)) {
- // edge_flag_result |= LRT_EDGE_FLAG_CREASE;
- //}
- // else {
- bool do_crease = true;
- if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
- (me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
- (me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
- do_crease = false;
- }
- if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < e_feat_data->crease_threshold)) {
+ if (e_f_pair->eflag & BM_ELEM_TAG) {
edge_flag_result |= LRT_EDGE_FLAG_CREASE;
}
- //}
+ else {
+ bool do_crease = true;
+ if (!rb->force_crease && !e_feat_data->use_auto_smooth &&
+ (me->mpoly[mlooptri[e_f_pair->f1].poly].flag & ME_SMOOTH) &&
+ (me->mpoly[mlooptri[e_f_pair->f2].poly].flag & ME_SMOOTH)) {
+ do_crease = false;
+ }
+ if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < e_feat_data->crease_threshold)) {
+ edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+ }
+ }
}
int mat1 = me->mpoly[mlooptri[e_f_pair->f1].poly].mat_nr;
@@ -1608,6 +1608,10 @@ static uint16_t lineart_identify_medge_feature_edges(LineartRenderBuffer *rb,
bool face_mark_filtered = false;
uint16_t edge_flag_result = 0;
+ if (rb->use_crease && rb->sharp_as_crease && medge->flag & ME_SHARP) {
+ edge_flag_result |= LRT_EDGE_FLAG_CREASE;
+ }
+
// if (use_freestyle_face && rb->filter_face_mark) {
// fel = CustomData_bmesh_get(&bm_if_freestyle->pdata, ll->f->head.data, CD_FREESTYLE_FACE);
// if (ll != lr && lr) {