[Bf-blender-cvs] [46151a6] master: Fix issue with some files having non-unique modifier names

Sergey Sharybin noreply at git.blender.org
Fri Feb 13 09:54:26 CET 2015


Commit: 46151a6a69aa7461fbfd03561aea2cfd5eecbc61
Author: Sergey Sharybin
Date:   Fri Feb 13 13:51:10 2015 +0500
Branches: master
https://developer.blender.org/rB46151a6a69aa7461fbfd03561aea2cfd5eecbc61

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.

===================================================================

M	source/blender/blenkernel/BKE_blender.h
M	source/blender/blenloader/intern/versioning_270.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_blender.h b/source/blender/blenkernel/BKE_blender.h
index 610a63c..34d34e9 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 23bf291..1afdc34 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);
+				}
+			}
+		}
+	}
 }




More information about the Bf-blender-cvs mailing list