Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenloader/intern/versioning_300.c
| Show First 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| static void move_vertex_group_names_to_object_data(Main *bmain) | static void move_vertex_group_names_to_object_data(Main *bmain) | ||||
| { | { | ||||
| LISTBASE_FOREACH (Object *, object, &bmain->objects) { | LISTBASE_FOREACH (Object *, object, &bmain->objects) { | ||||
| if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) { | if (ELEM(object->type, OB_MESH, OB_LATTICE, OB_GPENCIL)) { | ||||
| ListBase *new_defbase = BKE_object_defgroup_list_mutable(object); | ListBase *new_defbase = BKE_object_defgroup_list_mutable(object); | ||||
| /* Choose the longest vertex group name list among all linked duplicates. */ | |||||
| if (BLI_listbase_count(&object->defbase) < BLI_listbase_count(new_defbase)) { | |||||
| BLI_freelistN(&object->defbase); | |||||
| } | |||||
| else { | |||||
| /* Clear the list in case the it was already assigned from another object. */ | /* Clear the list in case the it was already assigned from another object. */ | ||||
| BLI_freelistN(new_defbase); | BLI_freelistN(new_defbase); | ||||
| *new_defbase = object->defbase; | *new_defbase = object->defbase; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports)) | void do_versions_after_linking_300(Main *bmain, ReportList *UNUSED(reports)) | ||||
| { | { | ||||
| if (MAIN_VERSION_ATLEAST(bmain, 300, 0) && !MAIN_VERSION_ATLEAST(bmain, 300, 1)) { | if (MAIN_VERSION_ATLEAST(bmain, 300, 0) && !MAIN_VERSION_ATLEAST(bmain, 300, 1)) { | ||||
| /* Set zero user text objects to have a fake user. */ | /* Set zero user text objects to have a fake user. */ | ||||
| LISTBASE_FOREACH (Text *, text, &bmain->texts) { | LISTBASE_FOREACH (Text *, text, &bmain->texts) { | ||||
| if (text->id.us == 0) { | if (text->id.us == 0) { | ||||
| id_fake_user_set(&text->id); | id_fake_user_set(&text->id); | ||||
| ▲ Show 20 Lines • Show All 459 Lines • Show Last 20 Lines | |||||