Added Name flip for

_L
_l
_R
_r

Also added if suffix == 001, do not re-add suffix. So allows the following procedure

 bone named Bone_R is copied, becomes Bone_R.001
Bone_R.001 is Flipped, becomes Bone_L

Currently only works for 001, could be extended later
This commit is contained in:
2005-07-27 18:48:08 +00:00
parent 59672145a9
commit 2da63a1ad7

View File

@@ -532,7 +532,24 @@ static void flip_name (char *name)
strcpy (suffix, index+2);
}
}
/* check for an instance of _l */
if (!index){
index = strstr (prefix, "_l");
if (index){
*index=0;
strcpy (replace, "_r");
strcpy (suffix, index+2);
}
}
/* check for an instance of _L */
if (!index){
index = strstr (prefix, "_L");
if (index){
*index=0;
strcpy (replace, "_R");
strcpy (suffix, index+2);
}
}
/* Checl for an instance of .R */
if (!index){
index = strstr (prefix, ".R");
@@ -552,8 +569,29 @@ static void flip_name (char *name)
strcpy (suffix, index+2);
}
}
sprintf (name, "%s%s%s", prefix, replace, suffix);
/* Checl for an instance of _r */
if (!index){
index = strstr (prefix, "_r");
if (index){
*index=0;
strcpy (replace, "_l");
strcpy (suffix, index+2);
}
}
/* Check for an instance of _R */
if (!index){
index = strstr (prefix, "_R");
if (index){
*index=0;
strcpy (replace, "_L");
strcpy (suffix, index+2);
}
}
if(strstr (suffix, "001")){
sprintf (name, "%s%s", prefix, replace);
} else {
sprintf (name, "%s%s%s", prefix, replace, suffix);
}
}
void paste_posebuf (int flip)
@@ -672,4 +710,4 @@ void pose_flip_names(void)
allqueue(REDRAWOOPS, 0);
BIF_undo_push("Flip names");
}
}