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
This commit is contained in:
Pratik Borhade
2023-08-31 16:26:57 +02:00
committed by Nathan Vegdahl
parent 05f8d61ec6
commit daa4c0f91e
2 changed files with 3 additions and 1 deletions

View File

@@ -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);
}
/**

View File

@@ -87,7 +87,8 @@ static int bone_collection_add_exec(bContext *C, wmOperator * /* op */)
}
bArmature *armature = static_cast<bArmature *>(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;