renaming bones didnt update update the view3d lock bone name.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 20 May 2011 05:39:56 +0000 (05:39 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 20 May 2011 05:39:56 +0000 (05:39 +0000)
source/blender/editors/armature/editarmature.c

index 06b2c06d4d2d0b0478f62c1ecca7dc18d6abf82a..a2301540f1b25fc445f679704cbf8c8734cf5ab7 100644 (file)
@@ -5530,6 +5530,26 @@ void ED_armature_bone_rename(bArmature *arm, char *oldnamep, char *newnamep)
                                BKE_animdata_fix_paths_rename(&ob->id, ob->adt, "pose.bones", oldname, newname, 0, 0, 1);
                        }
                }
+
+               {
+                       /* correct view locking */
+                       bScreen *screen;
+                       for(screen= G.main->screen.first; screen; screen= screen->id.next) {
+                               ScrArea *sa;
+                               /* add regions */
+                               for(sa= screen->areabase.first; sa; sa= sa->next) {
+                                       SpaceLink *sl= sa->spacedata.first;
+                                       if(sl->spacetype == SPACE_VIEW3D) {
+                                               View3D *v3d= (View3D *)sl;
+                                               if(v3d->ob_centre && v3d->ob_centre->data == arm) {
+                                                       if (!strcmp(v3d->ob_centre_bone, oldname)) {
+                                                               BLI_strncpy(v3d->ob_centre_bone, newname, MAXBONENAME);
+                                                       }
+                                               }
+                                       }
+                               }
+                       }
+               }
        }
 }