Revision: 39657
          
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39657
Author:   campbellbarton
Date:     2011-08-23 19:58:15 +0000 (Tue, 23 Aug 2011)
Log Message:
-----------
fix for 3 bugs in bone renaming
- renaming a bone could crash if the area had to spaces in it (reported by 
Sebastian Koenig).
- renaming bones wouldn't  update inactive 3d views locked bone names.
- selecting locked bones in the UI didnt work in editmode.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
    trunk/blender/source/blender/editors/armature/editarmature.c

Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py 2011-08-23 
17:20:32 UTC (rev 39656)
+++ trunk/blender/release/scripts/startup/bl_ui/space_view3d.py 2011-08-23 
19:58:15 UTC (rev 39657)
@@ -2073,9 +2073,11 @@
         col.prop(view, "lens")
         col.label(text="Lock to Object:")
         col.prop(view, "lock_object", text="")
-        if view.lock_object and view.lock_object.type == 'ARMATURE':
-            col.prop_search(view, "lock_bone", view.lock_object.data, "bones", 
text="")
-        elif not view.lock_object:
+        lock_object = view.lock_object
+        if lock_object:
+            if lock_object.type == 'ARMATURE':
+                col.prop_search(view, "lock_bone", lock_object.data, 
"edit_bones" if lock_object.mode == 'EDIT' else "bones", text="")
+        else:
             col.prop(view, "lock_cursor", text="Lock to Cursor")
 
         col = layout.column()

Modified: trunk/blender/source/blender/editors/armature/editarmature.c
===================================================================
--- trunk/blender/source/blender/editors/armature/editarmature.c        
2011-08-23 17:20:32 UTC (rev 39656)
+++ trunk/blender/source/blender/editors/armature/editarmature.c        
2011-08-23 19:58:15 UTC (rev 39657)
@@ -5402,12 +5402,14 @@
                                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);
+                                       SpaceLink *sl;
+                                       for (sl= sa->spacedata.first; sl; sl= 
sl->next) {
+                                               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);
+                                                               }
                                                        }
                                                }
                                        }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to