[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60487] trunk/blender/source/blender/ editors/armature/armature_naming.c: change to ED_armature_bone_rename so theres never any duplicates dictionary items in 'ob->pose->chanhash'
Campbell Barton
ideasman42 at gmail.com
Tue Oct 1 15:33:43 CEST 2013
Revision: 60487
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60487
Author: campbellbarton
Date: 2013-10-01 13:33:43 +0000 (Tue, 01 Oct 2013)
Log Message:
-----------
change to ED_armature_bone_rename so theres never any duplicates dictionary items in 'ob->pose->chanhash'
this turned out to be harmless but it did make ghash assert() because the ghash isnt flagged to allow duplicates.
Modified Paths:
--------------
trunk/blender/source/blender/editors/armature/armature_naming.c
Modified: trunk/blender/source/blender/editors/armature/armature_naming.c
===================================================================
--- trunk/blender/source/blender/editors/armature/armature_naming.c 2013-10-01 13:28:59 UTC (rev 60486)
+++ trunk/blender/source/blender/editors/armature/armature_naming.c 2013-10-01 13:33:43 UTC (rev 60487)
@@ -182,13 +182,17 @@
if (ob->pose) {
bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, oldname);
if (pchan) {
+ GHash *gh = ob->pose->chanhash;
+
+ /* remove the old hash entry, and replace with the new name */
+ if (gh) {
+ BLI_assert(BLI_ghash_haskey(gh, pchan->name));
+ BLI_ghash_remove(gh, pchan->name, NULL, NULL);
+ }
+
BLI_strncpy(pchan->name, newname, MAXBONENAME);
-
- if (ob->pose->chanhash) {
- GHash *gh = ob->pose->chanhash;
-
- /* remove the old hash entry, and replace with the new name */
- BLI_ghash_remove(gh, oldname, NULL, NULL);
+
+ if (gh) {
BLI_ghash_insert(gh, pchan->name, pchan);
}
}
More information about the Bf-blender-cvs
mailing list