diff options
author | YimingWu <xp8110@outlook.com> | 2020-10-02 17:23:07 +0300 |
---|---|---|
committer | YimingWu <xp8110@outlook.com> | 2020-10-02 17:23:07 +0300 |
commit | 01cd78ef6720d25deac5daa6f4b2fc9954fa66a9 (patch) | |
tree | 13937e51fda529330df316e3ef340d202e56fc01 /source/blender/gpencil_modifiers | |
parent | 99617351e611ccf8328f502184e8504a1da8f7e1 (diff) |
Gpencil: location calculation changed to obmat
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c | 5 | ||||
-rw-r--r-- | source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c index da9e6c7ad0c..2446485477b 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c @@ -147,7 +147,7 @@ static void deformStroke(GpencilModifierData *md, if (mmd->object) { float gvert[3]; mul_v3_m4v3(gvert, ob->obmat, &pt->x); - float dist = len_v3v3(mmd->object->loc, gvert); + float dist = len_v3v3(mmd->object->obmat[3], gvert); float fading_max = MAX2(mmd->fading_start, mmd->fading_end); float fading_min = MIN2(mmd->fading_start, mmd->fading_end); @@ -201,7 +201,7 @@ static void deformStroke(GpencilModifierData *md, if (mmd->flag & GP_OPACITY_FADING) { if (mmd->object) { - float dist = len_v3v3(mmd->object->loc, ob->loc); + float dist = len_v3v3(mmd->object->obmat[3], ob->obmat[3]); float fading_max = MAX2(mmd->fading_start, mmd->fading_end); float fading_min = MIN2(mmd->fading_start, mmd->fading_end); @@ -254,6 +254,7 @@ static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, OpacityGpencilModifierData *mmd = (OpacityGpencilModifierData *)md; walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER); + walk(userData, ob, (ID **)&mmd->object, IDWALK_CB_USER); } static void panel_draw(const bContext *UNUSED(C), Panel *panel) diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c index 59df43c408f..2408ccf4d1d 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c @@ -138,7 +138,7 @@ static void deformStroke(GpencilModifierData *md, if (mmd->object) { float gvert[3]; mul_v3_m4v3(gvert, ob->obmat, &pt->x); - float dist = len_v3v3(mmd->object->loc, gvert); + float dist = len_v3v3(mmd->object->obmat[3], gvert); float fading_max = MAX2(mmd->fading_start, mmd->fading_end); float fading_min = MIN2(mmd->fading_start, mmd->fading_end); @@ -200,6 +200,7 @@ static void foreachIDLink(GpencilModifierData *md, Object *ob, IDWalkFunc walk, ThickGpencilModifierData *mmd = (ThickGpencilModifierData *)md; walk(userData, ob, (ID **)&mmd->material, IDWALK_CB_USER); + walk(userData, ob, (ID **)&mmd->object, IDWALK_CB_USER); } static void panel_draw(const bContext *UNUSED(C), Panel *panel) |