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:
authorAntonio Vazquez <blendergit@gmail.com>2019-10-22 12:24:10 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-10-22 12:24:10 +0300
commitdc0ce14316a1c68be9bd94eb7919f2b389b176f9 (patch)
tree3b2e573a2d03fa130062385a56a107f9072c25ee /source/blender/editors/gpencil
parenta0d675d88fe27e69f04f2d495c4772a544a4f284 (diff)
parentf8e8f4ee0f8ad5384e6d4ee7c98e93852e100608 (diff)
Merge branch 'blender-v2.81-release'
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index 741521f3140..4948df606ee 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -154,6 +154,9 @@ typedef struct tGP_BrushEditData {
wmTimer *timer;
bool timerTick; /* is this event from a timer */
+ /* Object invert matrix */
+ float inv_mat[4][4];
+
RNG *rng;
} tGP_BrushEditData;
@@ -637,9 +640,7 @@ static bool gp_brush_push_apply(tGP_BrushEditData *gso,
mul_v3_v3fl(delta, gso->dvec, inf);
/* apply */
- float inv_mat[4][4];
- invert_m4_m4(inv_mat, gso->object->obmat);
- mul_mat3_m4_v3(inv_mat, delta); /* only rotation component */
+ mul_mat3_m4_v3(gso->inv_mat, delta); /* only rotation component */
add_v3_v3(&pt->x, delta);
/* compute lock axis */
@@ -1326,6 +1327,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
gso->scene = scene;
gso->object = ob;
if (ob) {
+ invert_m4_m4(gso->inv_mat, ob->obmat);
gso->vrgroup = ob->actdef - 1;
if (!BLI_findlink(&ob->defbase, gso->vrgroup)) {
gso->vrgroup = -1;
@@ -1334,6 +1336,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
gso->is_transformed = BKE_gpencil_has_transform_modifiers(ob);
}
else {
+ unit_m4(gso->inv_mat);
gso->vrgroup = -1;
gso->is_transformed = false;
}