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:
authorAntonioya <blendergit@gmail.com>2019-07-02 20:17:38 +0300
committerAntonioya <blendergit@gmail.com>2019-07-02 20:17:38 +0300
commit2d35fed6f846a256c0869b1a913d545b7953310a (patch)
treeed3f39cf98ee166bd3292696c1b246995ea8704a /source/blender/blenkernel/intern/gpencil.c
parenta5b7cf9b5f134febd726dc7a92e7602dc60862ad (diff)
GPencil: Fix unreported error in stroke thickness when applies scale.
When apply the transformation, the thickness of the stroke was wrong because the scale was not applied to pressure.
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil.c')
-rw-r--r--source/blender/blenkernel/intern/gpencil.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index ff638eaf082..058c0d10b8e 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1324,6 +1324,7 @@ void BKE_gpencil_transform(bGPdata *gpd, float mat[4][4])
return;
}
+ const float scalef = mat4_to_scale(mat);
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
/* FIXME: For now, we just skip parented layers.
* Otherwise, we have to update each frame to find
@@ -1340,6 +1341,7 @@ void BKE_gpencil_transform(bGPdata *gpd, float mat[4][4])
for (pt = gps->points, i = 0; i < gps->totpoints; pt++, i++) {
mul_m4_v3(mat, &pt->x);
+ pt->pressure *= scalef;
}
/* TODO: Do we need to do this? distortion may mean we need to re-triangulate */