From 46151a6a69aa7461fbfd03561aea2cfd5eecbc61 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 13 Feb 2015 13:51:10 +0500 Subject: [PATCH] Fix issue with some files having non-unique modifier names Originally the files are coming from ancient early-2.4x epoch, but in theory such setups might have been re-saved multiple times already with more recent blender versions. So the verisoning code is applied on all the files, including very recent ones. Bumped subversion, because this check si not really cheap. --- source/blender/blenkernel/BKE_blender.h | 2 +- source/blender/blenloader/intern/versioning_270.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h index 610a63cb954..34d34e92447 100644 --- a/source/blender/blenkernel/BKE_blender.h +++ b/source/blender/blenkernel/BKE_blender.h @@ -42,7 +42,7 @@ extern "C" { * and keep comment above the defines. * Use STRINGIFY() rather than defining with quotes */ #define BLENDER_VERSION 273 -#define BLENDER_SUBVERSION 7 +#define BLENDER_SUBVERSION 8 /* 262 was the last editmesh release but it has compatibility code for bmesh data */ #define BLENDER_MINVERSION 270 #define BLENDER_MINSUBVERSION 5 diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 23bf291b981..1afdc348c24 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -51,6 +51,7 @@ #include "DNA_genfile.h" #include "BKE_main.h" +#include "BKE_modifier.h" #include "BKE_node.h" #include "BKE_screen.h" @@ -602,4 +603,18 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + if (!MAIN_VERSION_ATLEAST(main, 273, 8)) { + Object *ob; + for (ob = main->object.first; ob != NULL; ob = ob->id.next) { + ModifierData *md; + for (md = ob->modifiers.last; md != NULL; md = md->prev) { + if (modifier_unique_name(&ob->modifiers, md)) { + printf("Warning: Object '%s' had several modifiers with the " + "same name, renamed one of them to '%s'.\n", + ob->id.name + 2, md->name); + } + } + } + } }