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:
authorJoshua Leung <aligorith@gmail.com>2010-08-30 05:07:45 +0400
committerJoshua Leung <aligorith@gmail.com>2010-08-30 05:07:45 +0400
commit1f2bc7b7b34ed72a6a2722811c96f8d4a8a1f660 (patch)
tree93728bbc8e88f07b95480778841a09e4a1f3e22f /source/blender/editors/armature
parent88f657f25165f3e560fe0ef829eeba85624d05be (diff)
Bugfix #23575: Hook modifier don't update name of bone acting as the controller when the name of that bone is changed
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 174aadab687..8f19bb82b5c 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -5460,6 +5460,8 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
/* do entire dbase - objects */
for (ob= G.main->object.first; ob; ob= ob->id.next) {
+ ModifierData *md;
+
/* we have the object using the armature */
if (arm==ob->data) {
Object *cob;
@@ -5509,6 +5511,19 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
}
}
+ /* 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);
+ }
+ }
+ }
+
/* Fix animation data attached to this object */
// TODO: should we be using the database wide version instead (since drivers may break)
if (ob->adt) {