From abb0c49870b796fcae3770e1a6ffd7fd2f4a4e07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Mon, 28 Jul 2025 15:56:23 +0200 Subject: [PATCH] Shape Keys: let Make Basis Key also update the "relative to" fields When a shape key is made the new basis key, also update the "Relative To" setting on the old & new basis keys. Both are made relative to the new basis shape key. Without this, the old basis key would still be relative to itself, which effectively disables it. By making it relative to the new basis key, you can increase its blend value to invert the effect of the new basis key. Pull Request: https://projects.blender.org/blender/blender/pulls/143466 --- source/blender/editors/object/object_shapekey.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/blender/editors/object/object_shapekey.cc b/source/blender/editors/object/object_shapekey.cc index 32b2f380f89..f43d91b927a 100644 --- a/source/blender/editors/object/object_shapekey.cc +++ b/source/blender/editors/object/object_shapekey.cc @@ -867,6 +867,8 @@ static bool shape_key_make_basis_poll(bContext *C) static wmOperatorStatus shape_key_make_basis_exec(bContext *C, wmOperator * /*op*/) { Object *ob = CTX_data_active_object(C); + Key *key = BKE_key_from_object(ob); + KeyBlock *old_basis_key = static_cast(key->block.first); /* Make the new basis by moving the active key to index 0. */ const int from_index = -1; /* Interpreted as "the active key". */ @@ -880,6 +882,14 @@ static wmOperatorStatus shape_key_make_basis_exec(bContext *C, wmOperator * /*op return OPERATOR_CANCELLED; } + /* Make the old & new basis keys "Relative to" the new basis key. For the new key it doesn't + * matter much, as it's treated as special anyway, but keeping it relative to another key makes + * no sense. For the old basis key (which just became a normal key), it would otherwise still be + * relative to itself, effectively disabling it. */ + KeyBlock *new_basis_key = static_cast(key->block.first); + new_basis_key->relative = 0; + old_basis_key->relative = 0; + DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob);