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:
authorHans Goudey <h.goudey@me.com>2020-05-13 22:26:34 +0300
committerHans Goudey <h.goudey@me.com>2020-05-13 22:26:34 +0300
commit891b91928a80ee931453e413c7f397e65e478086 (patch)
tree19e8afa7e2411ae997af84eb338b04f7388f34d1
parent4da3044abccfb14153959832303325001ff2de1a (diff)
parent5e96c438546932ca875aa35afb8c73f9a68d62a1 (diff)
Merge branch 'blender-v2.83-release'
-rw-r--r--source/blender/editors/mesh/meshtools.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 8dbd468d04f..917bbe61e3d 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -314,7 +314,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
int a, b, totcol, totmat = 0, totedge = 0, totvert = 0;
int totloop = 0, totpoly = 0, vertofs, *matmap = NULL;
int i, haskey = 0, edgeofs, loopofs, polyofs;
- bool ok = false;
+ bool ok = false, join_parent = false;
bDeformGroup *dg, *odg;
CustomData vdata, edata, fdata, ldata, pdata;
@@ -346,6 +346,10 @@ int join_mesh_exec(bContext *C, wmOperator *op)
ok = true;
}
+ if ((ob->parent != NULL) && (ob_iter == ob->parent)) {
+ join_parent = true;
+ }
+
/* check for shapekeys */
if (me->key) {
haskey++;
@@ -354,6 +358,13 @@ int join_mesh_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
+ /* Apply parent transform if the active object's parent was joined to it.
+ * Note: This doesn't apply recursive parenting. */
+ if (join_parent) {
+ ob->parent = NULL;
+ BKE_object_apply_mat4_ex(ob, ob->obmat, ob->parent, ob->parentinv, false);
+ }
+
/* that way the active object is always selected */
if (ok == false) {
BKE_report(op->reports, RPT_WARNING, "Active object is not a selected mesh");