[Bf-blender-cvs] [2d35fed6f84] master: GPencil: Fix unreported error in stroke thickness when applies scale.

Antonioya noreply at git.blender.org
Tue Jul 2 19:17:47 CEST 2019


Commit: 2d35fed6f846a256c0869b1a913d545b7953310a
Author: Antonioya
Date:   Tue Jul 2 19:17:38 2019 +0200
Branches: master
https://developer.blender.org/rB2d35fed6f846a256c0869b1a913d545b7953310a

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.

===================================================================

M	source/blender/blenkernel/intern/gpencil.c

===================================================================

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 */



More information about the Bf-blender-cvs mailing list