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-09-20 17:42:57 +0300
committerAntonio Vazquez <blendergit@gmail.com>2019-09-21 11:29:25 +0300
commitcdf489d10152ea54d9a07b0b32fbbbb063092e09 (patch)
tree9125fdc664aead88075ac01d53b3b396b8238f75 /source/blender/editors/gpencil
parent35114b0e4e00d69f9ec083a810af2203b06a2ea8 (diff)
GPencil: Remove Sculpt rotation effect for multiframe sculpt
As multiframe does not use modifiers, this is not required and only gets weird results. Related to T70116
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_brush.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c
index c8b0e4951fd..59d63e0a3fd 100644
--- a/source/blender/editors/gpencil/gpencil_brush.c
+++ b/source/blender/editors/gpencil/gpencil_brush.c
@@ -1507,21 +1507,21 @@ static void gpsculpt_brush_init_stroke(bContext *C, tGP_BrushEditData *gso)
* valid reference point.
*/
static float gpsculpt_rotation_eval_get(GP_SpaceConversion *gsc,
- bGPDstroke *gps_orig,
- bGPDspoint *pt_orig,
bGPDstroke *gps_eval,
bGPDspoint *pt_eval,
- int idx)
+ int idx_eval)
{
+ bGPDstroke *gps_orig = gps_eval->runtime.gps_orig;
+ bGPDspoint *pt_orig = &gps_orig->points[pt_eval->runtime.idx_orig];
bGPDspoint *pt_prev_eval = NULL;
bGPDspoint *pt_orig_prev = NULL;
- if (idx != 0) {
- pt_prev_eval = &gps_eval->points[idx - 1];
+ if (idx_eval != 0) {
+ pt_prev_eval = &gps_eval->points[idx_eval - 1];
}
else {
if (gps_eval->totpoints > 1) {
- pt_prev_eval = &gps_eval->points[idx + 1];
+ pt_prev_eval = &gps_eval->points[idx_eval + 1];
}
else {
return 0.0f;
@@ -1594,7 +1594,7 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
if (len_v2v2_int(mval_i, pc1) <= radius) {
/* apply operation to this point */
if (pt_active != NULL) {
- rot_eval = gpsculpt_rotation_eval_get(&gso->gsc, gps_active, pt_active, gps, pt, 0);
+ rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(&gso->gsc, gps, pt, 0) : 0.0f;
changed = apply(gso, gps_active, rot_eval, 0, radius, pc1);
}
}
@@ -1641,7 +1641,7 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
pt_active = (!is_multiedit) ? pt->runtime.pt_orig : pt;
int index = (!is_multiedit) ? pt->runtime.idx_orig : i;
if (pt_active != NULL) {
- rot_eval = gpsculpt_rotation_eval_get(&gso->gsc, gps_active, pt_active, gps, pt, i);
+ rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(&gso->gsc, gps, pt, i) : 0.0f;
ok = apply(gso, gps_active, rot_eval, index, radius, pc1);
}
@@ -1658,8 +1658,8 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
pt_active = (!is_multiedit) ? pt->runtime.pt_orig : pt;
index = (!is_multiedit) ? pt->runtime.idx_orig : i;
if (pt->runtime.pt_orig != NULL) {
- rot_eval = gpsculpt_rotation_eval_get(
- &gso->gsc, gps_active, pt_active, gps, pt, i + 1);
+ rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(
+ &gso->gsc, gps, pt, i + 1) : 0.0f;
ok |= apply(gso, gps_active, rot_eval, index, radius, pc2);
include_last = false;
}
@@ -1680,7 +1680,7 @@ static bool gpsculpt_brush_do_stroke(tGP_BrushEditData *gso,
pt_active = (!is_multiedit) ? pt->runtime.pt_orig : pt;
index = (!is_multiedit) ? pt->runtime.idx_orig : i;
if (pt->runtime.pt_orig != NULL) {
- rot_eval = gpsculpt_rotation_eval_get(&gso->gsc, gps_active, pt_active, gps, pt, i);
+ rot_eval = (!is_multiedit) ? gpsculpt_rotation_eval_get(&gso->gsc, gps, pt, i) : 0.0f;
changed |= apply(gso, gps_active, rot_eval, index, radius, pc1);
include_last = false;
}