Moved the object and bone name fields out of the Transform panel in 3Dview properties...
authorWilliam Reynish <william@reynish.com>
Thu, 5 Nov 2009 17:22:11 +0000 (17:22 +0000)
committerWilliam Reynish <william@reynish.com>
Thu, 5 Nov 2009 17:22:11 +0000 (17:22 +0000)
release/scripts/ui/space_view3d.py
source/blender/editors/space_view3d/view3d_buttons.c

index c19b02ffaf0f7a4fb5cc9305a54ec046d380f90b..a8604832c0e73d8b60dc1383d412d8095f4f2d11 100644 (file)
@@ -1338,6 +1338,33 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel):
 
         layout.column().itemR(scene, "cursor_location", text="3D Cursor:")
 
+class VIEW3D_PT_3dview_item(bpy.types.Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'UI'
+    bl_label = "Item"
+    def poll(self, context):
+        return (context.active_object or context.bone or context.edit_bone)
+    def draw(self, context):
+        layout = self.layout
+       
+        ob = context.object
+        row = layout.row()
+        row.itemL(text="", icon='ICON_OBJECT_DATA')
+        row.itemR(ob, "name", text="")
+       
+        if ((context.active_bone or context.active_pchan) and ob.type == 'ARMATURE' and (ob.mode == 'EDIT' or ob.mode == 'POSE')):
+            bone = context.active_bone
+            if not bone:
+                pchan = context.active_pchan
+                if pchan:
+                    bone = pchan.bone
+           
+            row = layout.row()
+            row.itemL(text="", icon='ICON_BONE_DATA')
+            row.itemR(bone, "name", text="")
 
 class VIEW3D_PT_3dview_display(bpy.types.Panel):
     bl_space_type = 'VIEW_3D'
@@ -1664,7 +1691,8 @@ bpy.types.register(VIEW3D_MT_edit_armature)
 bpy.types.register(VIEW3D_MT_edit_armature_parent)
 bpy.types.register(VIEW3D_MT_edit_armature_roll)
 
-bpy.types.register(VIEW3D_PT_3dview_properties) # Panels
+bpy.types.register(VIEW3D_PT_3dview_item) # Panels
+bpy.types.register(VIEW3D_PT_3dview_properties)
 bpy.types.register(VIEW3D_PT_3dview_display)
 bpy.types.register(VIEW3D_PT_3dview_meshdisplay)
 bpy.types.register(VIEW3D_PT_3dview_curvedisplay)
index 1e4e2424193d0b5fccdfcc3fa0e9978a880f24fe..8c0eff4902072dc086d5efd4ad603abcc38e5d28 100644 (file)
@@ -590,17 +590,9 @@ static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo
                if(bone && (bone->flag & BONE_ACTIVE) && (bone->layer & arm->layer))
                        break;
        }
-       if (!pchan)     {
-               row= uiLayoutRow(layout, 0);
-               uiItemL(row, "No Active Bone", 0);
-               return; 
-       }
-       row= uiLayoutRow(layout, 0);
+//     row= uiLayoutRow(layout, 0);
        
        RNA_pointer_create(&ob->id, &RNA_PoseChannel, pchan, &pchanptr);
-       
-       uiItemL(row, "", ICON_BONE_DATA);
-       uiItemR(row, "", 0, &pchanptr, "name", 0);
 
        col= uiLayoutColumn(layout, 0);
        
@@ -702,10 +694,9 @@ static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, flo
        if (!ebone)
                return;
        
-       row= uiLayoutRow(layout, 0);
+//     row= uiLayoutRow(layout, 0);
        RNA_pointer_create(&arm->id, &RNA_EditBone, ebone, &eboneptr);
-       uiItemL(row, "", ICON_BONE_DATA);
-       uiItemR(row, "", 0, &eboneptr, "name", 0);
+
 
        col= uiLayoutColumn(layout, 0);
        uiItemR(col, "Head", 0, &eboneptr, "head", 0);
@@ -732,10 +723,7 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim)
        
        RNA_pointer_create(&mball->id, &RNA_MetaBall, mball, &mbptr);
        
-       row= uiLayoutRow(layout, 0);
-       
-       uiItemL(row, "", ICON_META_DATA);
-       uiItemR(row, "", 0, &mbptr, "name", 0);
+//     row= uiLayoutRow(layout, 0);
 
        RNA_pointer_create(&mball->id, &RNA_MetaElement, mball->lastelem, &ptr);
        
@@ -1089,8 +1077,6 @@ static void view3d_panel_object(const bContext *C, Panel *pa)
        col= uiLayoutColumn(pa->layout, 0);
        row= uiLayoutRow(col, 0);
        RNA_id_pointer_create(&ob->id, &obptr);
-       uiItemL(row, "", ICON_OBJECT_DATA);
-       uiItemR(row, "", 0, &obptr, "name", 0);
 
        if(ob==obedit) {
                if(ob->type==OB_ARMATURE) v3d_editarmature_buts(col, v3d, ob, lim);