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:
authorCampbell Barton <ideasman42@gmail.com>2020-08-25 07:32:10 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-08-25 07:32:10 +0300
commit5eb7aa5ebba9cf6a88e0433ac679ad8f810c5c47 (patch)
tree393081ffac23842dbdc21d8500c9bfdfd4cb2adb /source/blender/editors/gpencil/gpencil_data.c
parent96401e2ef86809759d30cbc1d1b8ba0b666f5f4c (diff)
Fix T80077: Objects disappear when joining with a zero scaled axis
Use invert_m4_m4_safe_ortho when joining objects so zero scaled axis doesn't cause all points to be scaled to zero. Instead geometry is left un-scaled on degenerate axes. Report a warning in this case since users may want to adjust the active objects scale.
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_data.c')
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index 6264cac0973..6c003b85edd 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -2819,7 +2819,10 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
sub_v3_v3v3(offset_global, ob_active->loc, ob_iter->obmat[3]);
copy_m3_m4(bmat, ob_active->obmat);
- invert_m3_m3(imat, bmat);
+
+ /* Inverse transform for all selected curves in this object,
+ * See #object_join_exec for detailed comment on why the safe version is used. */
+ invert_m3_m3_safe_ortho(imat, bmat);
mul_m3_v3(imat, offset_global);
mul_v3_m3v3(offset_local, imat, offset_global);
@@ -2830,7 +2833,7 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op)
/* recalculate all stroke points */
BKE_gpencil_parent_matrix_get(depsgraph, ob_iter, gpl_src, diff_mat);
- invert_m4_m4(inverse_diff_mat, diff_mat);
+ invert_m4_m4_safe_ortho(inverse_diff_mat, diff_mat);
Material *ma_src = NULL;
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl_new->frames) {