From daa4c0f91e8c69e1e028af36db01841ff284b6ea Mon Sep 17 00:00:00 2001 From: Pratik Borhade Date: Thu, 31 Aug 2023 16:26:57 +0200 Subject: [PATCH] Fix: set default bone collection active Bone collection added by default along with the armature is not marked as active. Visually this looks active but actually it's not (hover over the properties like remove/move) Also, when a new collection is added, mark that collection active. Pull Request: https://projects.blender.org/blender/blender/pulls/111733 --- source/blender/blenkernel/intern/armature.cc | 1 + source/blender/editors/armature/bone_collections.cc | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/armature.cc b/source/blender/blenkernel/intern/armature.cc index 8c073d8cd01..20c6f89657c 100644 --- a/source/blender/blenkernel/intern/armature.cc +++ b/source/blender/blenkernel/intern/armature.cc @@ -87,6 +87,7 @@ static void armature_init_data(ID *id) /* Give the Armature its default bone collection. */ BoneCollection *default_bonecoll = ANIM_bonecoll_new(""); BLI_addhead(&armature->collections, default_bonecoll); + ANIM_armature_bonecoll_active_set(armature, default_bonecoll); } /** diff --git a/source/blender/editors/armature/bone_collections.cc b/source/blender/editors/armature/bone_collections.cc index 33406df8def..6648276bb28 100644 --- a/source/blender/editors/armature/bone_collections.cc +++ b/source/blender/editors/armature/bone_collections.cc @@ -87,7 +87,8 @@ static int bone_collection_add_exec(bContext *C, wmOperator * /* op */) } bArmature *armature = static_cast(ob->data); - ANIM_armature_bonecoll_new(armature, nullptr); + BoneCollection *bcoll = ANIM_armature_bonecoll_new(armature, nullptr); + ANIM_armature_bonecoll_active_set(armature, bcoll); WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); return OPERATOR_FINISHED;