Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Genrich <daniel.genrich@gmx.net>2008-05-07 21:44:46 +0400
committerDaniel Genrich <daniel.genrich@gmx.net>2008-05-07 21:44:46 +0400
commit57932e1752ea0d9b9b0f3f69327bca83297d7e07 (patch)
tree0ee57c9d36089c68113e0db92fa2b8c915c5bf14 /source/blender/src/editdeform.c
parent2f4ca518ea468f6c2e06a70aa24f16cf8a141425 (diff)
parent529a8bb949412ac5cc7203fd583e4f0b28282ddf (diff)
svn merge -r 13452:14721 https://svn.blender.org/svnroot/bf-blender/trunk/blender
Diffstat (limited to 'source/blender/src/editdeform.c')
-rw-r--r--source/blender/src/editdeform.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/src/editdeform.c b/source/blender/src/editdeform.c
index 6ab3d5c17c6..a072898327f 100644
--- a/source/blender/src/editdeform.c
+++ b/source/blender/src/editdeform.c
@@ -1,15 +1,12 @@
/**
* $Id$
*
- * ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
+ * ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. The Blender
- * Foundation also sells licenses for use in proprietary software under
- * the Blender License. See http://www.blender.org/BL/ for information
- * about this.
+ * of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -27,7 +24,7 @@
*
* Contributor(s): none yet.
*
- * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ * ***** END GPL LICENSE BLOCK *****
* Creator-specific support for vertex deformation groups
* Added: apply deform function (ton)
*/
@@ -220,19 +217,25 @@ void duplicate_defgroup ( Object *ob )
dg = BLI_findlink (&ob->defbase, (ob->actdef-1));
if (!dg)
return;
-
- BLI_snprintf (name, 32, "%s_copy", dg->name);
- while (get_named_vertexgroup (ob, name)) {
- if ((strlen (name) + 6) > 32) {
- error ("Error: the name for the new group is > 32 characters");
- return;
+
+ if (strstr(dg->name, "_copy")) {
+ BLI_strncpy (name, dg->name, 32); /* will be renamed _copy.001... etc */
+ } else {
+ BLI_snprintf (name, 32, "%s_copy", dg->name);
+ while (get_named_vertexgroup (ob, name)) {
+ if ((strlen (name) + 6) > 32) {
+ error ("Error: the name for the new group is > 32 characters");
+ return;
+ }
+ strcpy (s, name);
+ BLI_snprintf (name, 32, "%s_copy", s);
}
- strcpy (s, name);
- BLI_snprintf (name, 32, "%s_copy", s);
- }
+ }
cdg = copy_defgroup (dg);
strcpy (cdg->name, name);
+ unique_vertexgroup_name(cdg, ob);
+
BLI_addtail (&ob->defbase, cdg);
idg = (ob->actdef-1);