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>2009-10-20 07:44:35 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-20 07:44:35 +0400
commit7f133f65b2049546adddec77720c90aafb9add97 (patch)
treec7ebbb8eb317f0dea27f9f338debe9e1f49035d6 /source/blender/editors/armature
parent9e6d1c6cfaf5e06d734a2a1124bd4ee3c030fd38 (diff)
Bugfix #19663: Renaming named data doesn't fix F-Curves
RNA Paths used in F-Curve, Drivers, etc. now get renamed when some data that they use gets renamed. This only works when things like Bones, Constraints, Shape Keys, and Modifiers get renamed, but other cases can get added easily. The code here only performs simple string replacements, so there is the potential for problems when several sets of data with the same names are present. For example, if there are multiple armatures with bones that have the same names, renaming a bone on one armature (with a bone on another armature having the same name) will break all the drivers on the other one, even though they aren't really connected. However, I don't expect the aforementioned scenario to really be a problem in most production scenarios.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r--source/blender/editors/armature/editarmature.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c
index 0343fea5bfb..1c2ec920d41 100644
--- a/source/blender/editors/armature/editarmature.c
+++ b/source/blender/editors/armature/editarmature.c
@@ -5289,9 +5289,8 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
/* now check if we're in editmode, we need to find the unique name */
if (arm->edbo) {
- EditBone *eBone;
+ EditBone *eBone= editbone_name_exists(arm->edbo, oldname);
- eBone= editbone_name_exists(arm->edbo, oldname);
if (eBone) {
unique_editbone_name(arm->edbo, newname, NULL);
BLI_strncpy(eBone->name, newname, MAXBONENAME);
@@ -5302,7 +5301,7 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
Bone *bone= get_named_bone(arm, oldname);
if (bone) {
- unique_bone_name (arm, newname);
+ unique_bone_name(arm, newname);
BLI_strncpy(bone->name, newname, MAXBONENAME);
}
else return;
@@ -5379,6 +5378,12 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
BLI_strncpy(dg->name, newname, MAXBONENAME);
}
}
+
+ /* Fix animation data attached to this object */
+ if (ob->adt) {
+ /* posechannels only... */
+ BKE_animdata_fix_paths_rename(&ob->id, ob->adt, "pose.pose_channels", oldname, newname);
+ }
}
/* do entire db - ipo's for the drivers */