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:
authorCampbell Barton <ideasman42@gmail.com>2013-11-25 09:04:46 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-11-25 09:05:54 +0400
commit8cb02561a90bffa019cece9a4976ea98363c5b75 (patch)
tree89e006ad6d88ba4abab4601d0e8c4413cc1ca2f7 /source/blender/editors
parent2b4c68b902b261127f7deabf922048c41be6fb55 (diff)
Fix T37612: UV warp modifier bone name doesn't update when renamed
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/armature_naming.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index c574fc6a297..a4b40f64859 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -232,14 +232,33 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
/* fix modifiers that might be using this name */
for (md = ob->modifiers.first; md; md = md->next) {
- if (md->type == eModifierType_Hook) {
- HookModifierData *hmd = (HookModifierData *)md;
-
- /* uses armature, so may use the affected bone name */
- if (hmd->object && (hmd->object->data == arm)) {
- if (!strcmp(hmd->subtarget, oldname))
- BLI_strncpy(hmd->subtarget, newname, MAXBONENAME);
+ switch (md->type) {
+ case eModifierType_Hook:
+ {
+ HookModifierData *hmd = (HookModifierData *)md;
+
+ if (hmd->object && (hmd->object->data == arm)) {
+ if (STREQ(hmd->subtarget, oldname))
+ BLI_strncpy(hmd->subtarget, newname, MAXBONENAME);
+ }
+ break;
+ }
+ case eModifierType_UVWarp:
+ {
+ UVWarpModifierData *umd = (UVWarpModifierData *)md;
+
+ if (umd->object_src && (umd->object_src->data == arm)) {
+ if (STREQ(umd->bone_src, oldname))
+ BLI_strncpy(umd->bone_src, newname, MAXBONENAME);
+ }
+ if (umd->object_dst && (umd->object_dst->data == arm)) {
+ if (STREQ(umd->bone_dst, oldname))
+ BLI_strncpy(umd->bone_dst, newname, MAXBONENAME);
+ }
+ break;
}
+ default:
+ break;
}
}
}