From 23021fab74c8d05fa2914acd9bf17a15281142b5 Mon Sep 17 00:00:00 2001 From: Christoph Lendenfeld Date: Fri, 5 Jul 2024 10:49:25 +0200 Subject: [PATCH 1/2] Fix #123688: Bone selection broken when linking object data When linking object data between two armatures the selection would not work on the armature which got the new armature data assigned. That is until a bone is added or something else is done to the armature that triggers a rebuild. The fix is to trigger the rebuild in the link operator. This only fixes this particular issue, the issue of bone selection sync between armature instances is not fixed, but tracked in this report #117892 Pull Request: https://projects.blender.org/blender/blender/pulls/123743 --- source/blender/editors/object/object_relations.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/blender/editors/object/object_relations.cc b/source/blender/editors/object/object_relations.cc index ad7c999c15d..985583fe39e 100644 --- a/source/blender/editors/object/object_relations.cc +++ b/source/blender/editors/object/object_relations.cc @@ -1495,6 +1495,9 @@ static int make_links_data_exec(bContext *C, wmOperator *op) /* if amount of material indices changed: */ BKE_object_materials_test(bmain, ob_dst, static_cast(ob_dst->data)); + if (ob_dst->type == OB_ARMATURE) { + BKE_pose_rebuild(bmain, ob_dst, static_cast(ob_dst->data), true); + } DEG_id_tag_update(&ob_dst->id, ID_RECALC_GEOMETRY); break; case MAKE_LINKS_MATERIALS: From b238df312dd0ced23e5ac50b1230247783161061 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Fri, 5 Jul 2024 11:08:22 +0200 Subject: [PATCH 2/2] Fix #123918: STL exporter does not reverse faces for mirrored objects Old python STL exporter, as well as other exporters like OBJ, reverse the face order when object being exported has odd number of negative scales in the matrix. The C++ STL exporter was lacking that, resulting in the exported object looking "inside out". The extra branch inside triangle export inner loop has no measurable performance impact, probably because it is entirely predictable. Pull Request: https://projects.blender.org/blender/blender/pulls/124219 --- source/blender/io/stl/exporter/stl_export.cc | 6 +++++- tests/data | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/blender/io/stl/exporter/stl_export.cc b/source/blender/io/stl/exporter/stl_export.cc index 82e5cba5be0..8bd023e72be 100644 --- a/source/blender/io/stl/exporter/stl_export.cc +++ b/source/blender/io/stl/exporter/stl_export.cc @@ -122,13 +122,17 @@ void export_frame(Depsgraph *depsgraph, mul_v3_m3v3(xform[3], axes_transform, obj_eval->object_to_world().location()); xform[3][3] = obj_eval->object_to_world()[3][3]; + const bool mirrored = is_negative_m4(xform); + /* Write triangles. */ const Span positions = mesh->vert_positions(); const Span corner_verts = mesh->corner_verts(); for (const int3 &tri : mesh->corner_tris()) { PackedTriangle data{}; for (int i = 0; i < 3; i++) { - float3 pos = positions[corner_verts[tri[i]]]; + /* Reverse face order for mirrored objects. */ + int idx = mirrored ? 2 - i : i; + float3 pos = positions[corner_verts[tri[idx]]]; mul_m4_v3(xform, pos); pos *= global_scale; data.vertices[i] = pos; diff --git a/tests/data b/tests/data index 218087daf89..181a40d6c97 160000 --- a/tests/data +++ b/tests/data @@ -1 +1 @@ -Subproject commit 218087daf891d3eefd7ac2c66eb05f117f4510bd +Subproject commit 181a40d6c972c591996c49588d18d6154b9fbc6a