From 16d819caa93dddab1fdff2432e48d37b9a1b3b60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 6 Mar 2025 14:12:17 +0100 Subject: [PATCH] Fix: Reorder versioning of legacy Grease Pencil and Actions The versioning of legacy-to-modern Grease Pencil is using slotted Actions (because that's the current animation API), and therefore assumes that the Action & Slot assignments have been versioned as well. The latter now actually happens before the former, so that assumption is now actually valid. Pull Request: https://projects.blender.org/blender/blender/pulls/135466 --- source/blender/blenloader/intern/versioning_common.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/blender/blenloader/intern/versioning_common.cc b/source/blender/blenloader/intern/versioning_common.cc index 2174da5d963..35abf239742 100644 --- a/source/blender/blenloader/intern/versioning_common.cc +++ b/source/blender/blenloader/intern/versioning_common.cc @@ -678,13 +678,14 @@ void do_versions_after_setup(Main *new_bmain, BKE_main_mesh_legacy_convert_auto_smooth(*new_bmain); } + if (!blendfile_or_libraries_versions_atleast(new_bmain, 404, 2)) { + /* Version all the action assignments of just-versioned datablocks. This MUST happen before the + * GreasePencil conversion, as that assumes the Action Slots have already been assigned. */ + blender::animrig::versioning::convert_legacy_action_assignments(*new_bmain, reports->reports); + } + if (!blendfile_or_libraries_versions_atleast(new_bmain, 403, 3)) { /* Convert all the legacy grease pencil objects. This does not touch annotations. */ blender::bke::greasepencil::convert::legacy_main(*new_bmain, lapp_context, *reports); } - - if (!blendfile_or_libraries_versions_atleast(new_bmain, 404, 2)) { - /* Version all the action assignments of just-versioned datablocks. */ - blender::animrig::versioning::convert_legacy_action_assignments(*new_bmain, reports->reports); - } }