diff options
author | Bastien Montagne <bastien@blender.org> | 2020-11-25 13:20:12 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-11-27 18:18:59 +0300 |
commit | fbdf1af3555027696df5b687c7fe8d345e4c39e9 (patch) | |
tree | 722f9d0146507cc372a0a1edc9d5002a9ab8b7dd /source/blender/blenloader/intern/versioning_290.c | |
parent | e4e7dfc1d8c0486530e5cabd2e448bf79b2fdb0b (diff) |
Fix T82758: Convert Proxy to Override: Local constraints aren't saved.
Ensure consistent order of pose bones. Now it should always match the
one from bones in armature obdata (as exposed by e.g. RNA, i.e.
children-first).
Previously when some pose bones would need to be added or removed from a
pose due to changes in the bone armature, or if bones in armature were
re-ordered, the bones order in pose would not match anymore the one from
armature, and could even become different between e.g. a proxy and its
linked source.
This was not really nice, but not a big issue before either. But with
diffing process of override, consistent order of items between reference
linked collection and local override one is crucial.
Reviewed By: #animation_rigging, sybren
Maniphest Tasks: T82758
Differential Revision: https://developer.blender.org/D9646
Diffstat (limited to 'source/blender/blenloader/intern/versioning_290.c')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index b591f57a7f1..41064b6b136 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -49,6 +49,7 @@ #include "DNA_workspace_types.h" #include "BKE_animsys.h" +#include "BKE_armature.h" #include "BKE_collection.h" #include "BKE_colortools.h" #include "BKE_fcurve.h" @@ -472,8 +473,15 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports)) * \note Keep this message at the bottom of the function. */ { - /* Keep this block, even when empty. */ + + /* Systematically rebuild posebones to ensure consistent ordering matching the one of bones in + * Armature obdata. */ + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + if (ob->type == OB_ARMATURE) { + BKE_pose_rebuild(bmain, ob, ob->data, true); + } + } } } |