Anim: fix bone collection custom property copying on armature join

The armature join operation should preserve custom properties,
as described in the comment in the code. Previously this was
achieved by reusing the collection instances from the armature
being joined, but it was changed to create a new instance. However,
property copying was not implemented, which breaks Rigify.

This fix adds property copying behavior back.

Pull Request: https://projects.blender.org/blender/blender/pulls/116626
This commit is contained in:
Alexander Gavrilov
2023-12-28 22:40:56 +02:00
committed by Gitea
parent b7a7c2ac00
commit 34b04b625c

View File

@@ -30,6 +30,7 @@
#include "BKE_constraint.h"
#include "BKE_context.hh"
#include "BKE_fcurve_driver.h"
#include "BKE_idprop.h"
#include "BKE_layer.h"
#include "BKE_main.hh"
#include "BKE_report.h"
@@ -339,6 +340,9 @@ int ED_armature_join_objects_exec(bContext *C, wmOperator *op)
BoneCollection *mapped = bone_collection_by_name.lookup_default(bcoll->name, nullptr);
if (!mapped) {
BoneCollection *new_bcoll = ANIM_armature_bonecoll_new(arm, bcoll->name);
if (bcoll->prop) {
new_bcoll->prop = IDP_CopyProperty_ex(bcoll->prop, 0);
}
bone_collection_by_name.add(bcoll->name, new_bcoll);
mapped = new_bcoll;
}