Anim: ensure active bone collection doesn't change when adding new one
Ensure that the active bone collection doesn't change, when adding a new bone collection via low-level functions (for example `armature.collections.new()` in Python). The change to the active bone collection happened because adding a new child may change the index of the active bone collection.
This commit is contained in:
@@ -238,6 +238,9 @@ BoneCollection *ANIM_armature_bonecoll_new(bArmature *armature,
|
||||
bonecoll_insert_as_child(armature, bcoll, parent_index);
|
||||
}
|
||||
|
||||
/* Restore the active bone collection pointer, as its index might have changed. */
|
||||
ANIM_armature_bonecoll_active_set(armature, armature->runtime.active_collection);
|
||||
|
||||
return bcoll;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user