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:
Diffstat (limited to 'source/blender/blenkernel/intern/modifier.c')
-rw-r--r--source/blender/blenkernel/intern/modifier.c116
1 files changed, 1 insertions, 115 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c
index 7e211f60cd5..3c925e5ff25 100644
--- a/source/blender/blenkernel/intern/modifier.c
+++ b/source/blender/blenkernel/intern/modifier.c
@@ -39,7 +39,6 @@
#include "stdarg.h"
#include "math.h"
#include "float.h"
-#include "ctype.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
@@ -1801,118 +1800,6 @@ static void mirrorModifier_updateDepgraph(ModifierData *md, DagForest *forest, S
}
}
-/* finds the best possible flipped name. For renaming; check for unique names afterwards */
-/* if strip_number: removes number extensions */
-static void vertgroup_flip_name (char *name, int strip_number)
-{
- int len;
- char prefix[128]={""}; /* The part before the facing */
- char suffix[128]={""}; /* The part after the facing */
- char replace[128]={""}; /* The replacement string */
- char number[128]={""}; /* The number extension string */
- char *index=NULL;
-
- len= strlen(name);
- if(len<3) return; // we don't do names like .R or .L
-
- /* We first check the case with a .### extension, let's find the last period */
- if(isdigit(name[len-1])) {
- index= strrchr(name, '.'); // last occurrence
- if (index && isdigit(index[1]) ) { // doesnt handle case bone.1abc2 correct..., whatever!
- if(strip_number==0)
- strcpy(number, index);
- *index= 0;
- len= strlen(name);
- }
- }
-
- strcpy (prefix, name);
-
-#define IS_SEPARATOR(a) ((a)=='.' || (a)==' ' || (a)=='-' || (a)=='_')
-
- /* first case; separator . - _ with extensions r R l L */
- if( IS_SEPARATOR(name[len-2]) ) {
- switch(name[len-1]) {
- case 'l':
- prefix[len-1]= 0;
- strcpy(replace, "r");
- break;
- case 'r':
- prefix[len-1]= 0;
- strcpy(replace, "l");
- break;
- case 'L':
- prefix[len-1]= 0;
- strcpy(replace, "R");
- break;
- case 'R':
- prefix[len-1]= 0;
- strcpy(replace, "L");
- break;
- }
- }
- /* case; beginning with r R l L , with separator after it */
- else if( IS_SEPARATOR(name[1]) ) {
- switch(name[0]) {
- case 'l':
- strcpy(replace, "r");
- strcpy(suffix, name+1);
- prefix[0]= 0;
- break;
- case 'r':
- strcpy(replace, "l");
- strcpy(suffix, name+1);
- prefix[0]= 0;
- break;
- case 'L':
- strcpy(replace, "R");
- strcpy(suffix, name+1);
- prefix[0]= 0;
- break;
- case 'R':
- strcpy(replace, "L");
- strcpy(suffix, name+1);
- prefix[0]= 0;
- break;
- }
- }
- else if(len > 5) {
- /* hrms, why test for a separator? lets do the rule 'ultimate left or right' */
- index = BLI_strcasestr(prefix, "right");
- if (index==prefix || index==prefix+len-5) {
- if(index[0]=='r')
- strcpy (replace, "left");
- else {
- if(index[1]=='I')
- strcpy (replace, "LEFT");
- else
- strcpy (replace, "Left");
- }
- *index= 0;
- strcpy (suffix, index+5);
- }
- else {
- index = BLI_strcasestr(prefix, "left");
- if (index==prefix || index==prefix+len-4) {
- if(index[0]=='l')
- strcpy (replace, "right");
- else {
- if(index[1]=='E')
- strcpy (replace, "RIGHT");
- else
- strcpy (replace, "Right");
- }
- *index= 0;
- strcpy (suffix, index+4);
- }
- }
- }
-
-#undef IS_SEPARATOR
-
- sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
-}
-
static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
Object *ob,
DerivedMesh *dm,
@@ -2022,8 +1909,7 @@ static DerivedMesh *doMirrorOnAxis(MirrorModifierData *mmd,
continue;
def = vector_def[dvert->dw[j].def_nr];
- strcpy(tmpname, def->name);
- vertgroup_flip_name(tmpname,0);
+ flip_vertexgroup_name(tmpname, def->name, 0);
for(b = 0, defb = ob->defbase.first; defb;
defb = defb->next, b++)