Patch from William
authorCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jul 2009 09:07:25 +0000 (09:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 9 Jul 2009 09:07:25 +0000 (09:07 +0000)
"moving the ID browser into its own panel. Eventually these panels should loose their headers to distinguish them from other, normal panels. Also a few other fixes for bones and armature panels."

13 files changed:
release/ui/buttons_data_armature.py
release/ui/buttons_data_bone.py
release/ui/buttons_data_camera.py
release/ui/buttons_data_curve.py
release/ui/buttons_data_lamp.py
release/ui/buttons_data_lattice.py
release/ui/buttons_data_mesh.py
release/ui/buttons_data_text.py
release/ui/buttons_material.py
release/ui/buttons_objects.py
release/ui/buttons_particle.py
release/ui/buttons_texture.py
release/ui/buttons_world.py

index 112724bea911fc5cc3fe82bc9133164fb7c70d4f..98002f69ccb1c86f8b56a0b70e925f7acdc049ac 100644 (file)
@@ -9,9 +9,9 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.armature != None)
 
-class DATA_PT_skeleton(DataButtonsPanel):
-       __idname__ = "DATA_PT_skeleton"
-       __label__ = "Skeleton"
+class DATA_PT_contextarm(DataButtonsPanel):
+       __idname__ = "DATA_PT_contextarm"
+       __label__ = " "
        
        def poll(self, context):
                return ((context.object and context.object.type == 'ARMATURE') or context.armature)
@@ -32,8 +32,22 @@ class DATA_PT_skeleton(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
+class DATA_PT_skeleton(DataButtonsPanel):
+       __idname__ = "DATA_PT_skeleton"
+       __label__ = "Skeleton"
+       
+       def poll(self, context):
+               return ((context.object and context.object.type == 'ARMATURE') or context.armature)
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               arm = context.armature
+               space = context.space_data
+
+
                if arm:
-                       layout.itemS()
                        layout.itemR(arm, "rest_position")
 
                        split = layout.split()
@@ -124,6 +138,7 @@ class DATA_PT_ghost(DataButtonsPanel):
                sub = split.column()
                sub.itemR(arm, "ghost_only_selected", text="Selected Only")
 
+bpy.types.register(DATA_PT_contextarm)
 bpy.types.register(DATA_PT_skeleton)
 bpy.types.register(DATA_PT_display)
 bpy.types.register(DATA_PT_paths)
index 044f7b93806f6dbd91b88208583d68003c53c6f5..397a5eb0cd4f43180bc132e7069515ecdc85b723 100644 (file)
@@ -9,10 +9,25 @@ class BoneButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.bone or context.edit_bone)
 
+class BONE_PT_context(BoneButtonsPanel):
+       __idname__ = "BONE_PT_context"
+       __label__ = " "
+
+       def draw(self, context):
+               layout = self.layout
+               bone = context.bone
+               if not bone:
+                       bone = context.edit_bone
+               
+               split = layout.split(percentage=0.06)
+               split.itemL(text="", icon="ICON_BONE_DATA")
+               split.itemR(bone, "name", text="")
+
 class BONE_PT_bone(BoneButtonsPanel):
        __idname__ = "BONE_PT_bone"
        __label__ = "Bone"
 
+
        def draw(self, context):
                layout = self.layout
                bone = context.bone
@@ -22,28 +37,53 @@ class BONE_PT_bone(BoneButtonsPanel):
                split = layout.split()
 
                sub = split.column()
-               sub.itemR(bone, "name")
                sub.itemR(bone, "parent")
                sub.itemR(bone, "connected")
-               sub.itemR(bone, "deform")
+
+               sub.itemL(text="Layers:")
+               sub.template_layers(bone, "layer")
+
+               sub = split.column()
 
                sub.itemL(text="Inherit:")
-               sub.itemR(bone, "hinge")
-               sub.itemR(bone, "inherit_scale")
+               sub.itemR(bone, "hinge", text="Rotation")
+               sub.itemR(bone, "inherit_scale", text="Scale")
+               
+               sub.itemL(text="Display:")
+               sub.itemR(bone, "draw_wire", text="Wireframe")
+               sub.itemR(bone, "hidden", text="Hide")
+
 
+               
+class BONE_PT_deform(BoneButtonsPanel):
+       __idname__ = "BONE_PT_deform"
+       __label__ = "Deform"
+
+       def draw_header(self, context):
+               layout = self.layout
+               bone = context.bone
+               if not bone:
+                       bone = context.edit_bone
+                       
+               layout.itemR(bone, "deform", text="")
+
+       def draw(self, context):
+               layout = self.layout
+               bone = context.bone
+               if not bone:
+                       bone = context.edit_bone
+       
+               layout.active = bone.deform
+                       
+               split = layout.split()
+
+               sub = split.column()
                sub.itemL(text="Envelope:")
                sub.itemR(bone, "envelope_distance", text="Distance")
                sub.itemR(bone, "envelope_weight", text="Weight")
                sub.itemR(bone, "multiply_vertexgroup_with_envelope", text="Multiply")
-
                sub = split.column()
-               sub.itemL(text="Layers:")
-               sub.template_layers(bone, "layer")
                
-               sub.itemL(text="Display:")
-               sub.itemR(bone, "draw_wire", text="Wireframe")
-               sub.itemR(bone, "hidden", text="Hide")
-
                sub.itemL(text="Curved Bones:")
                sub.itemR(bone, "bbone_segments", text="Segments")
                sub.itemR(bone, "bbone_in", text="Ease In")
@@ -51,4 +91,7 @@ class BONE_PT_bone(BoneButtonsPanel):
                
                sub.itemR(bone, "cyclic_offset")
 
+
+bpy.types.register(BONE_PT_context)
 bpy.types.register(BONE_PT_bone)
+bpy.types.register(BONE_PT_deform)
index 9f3a062b4299e03bfabda9d26485281e9322b288..2092a34f9e8f6dc4656a2ceb1b75efe4b299c0ee 100644 (file)
@@ -9,9 +9,9 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.camera != None)
                
-class DATA_PT_camera(DataButtonsPanel):
-       __idname__ = "DATA_PT_camera"
-       __label__ = "Lens"
+class DATA_PT_context(DataButtonsPanel):
+       __idname__ = "DATA_PT_context"
+       __label__ = " "
        
        def poll(self, context):
                return (context.object and context.object.type == 'CAMERA')
@@ -32,6 +32,21 @@ class DATA_PT_camera(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
+
+class DATA_PT_camera(DataButtonsPanel):
+       __idname__ = "DATA_PT_camera"
+       __label__ = "Lens"
+       
+       def poll(self, context):
+               return (context.object and context.object.type == 'CAMERA')
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               cam = context.camera
+               space = context.space_data
+
                if cam:
                        layout.itemS()
                        layout.itemR(cam, "type", expand=True)
@@ -86,5 +101,6 @@ class DATA_PT_camera_display(DataButtonsPanel):
                colsub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
                col.itemR(cam, "draw_size", text="Size")
                
+bpy.types.register(DATA_PT_context)
 bpy.types.register(DATA_PT_camera)
 bpy.types.register(DATA_PT_camera_display)
index e60f9591d2907fe13629cc4bd3f26247bbaa412b..cc671871d1dc0d0d328bc514d45b4e0f39d148ce 100644 (file)
@@ -9,9 +9,10 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.object and context.object.type == 'CURVE' and context.curve)
 
-class DATA_PT_shape_curve(DataButtonsPanel):
-       __idname__ = "DATA_PT_shape_curve"
-       __label__ = "Shape"
+
+class DATA_PT_context(DataButtonsPanel):
+       __idname__ = "DATA_PT_context"
+       __label__ = " "
        
        def poll(self, context):
                return (context.object and context.object.type == 'CURVE')
@@ -32,8 +33,24 @@ class DATA_PT_shape_curve(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
+
+class DATA_PT_shape_curve(DataButtonsPanel):
+       __idname__ = "DATA_PT_shape_curve"
+       __label__ = "Shape"
+       
+       def poll(self, context):
+               return (context.object and context.object.type == 'CURVE')
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               curve = context.curve
+               space = context.space_data
+
+
+
                if curve:
-                       layout.itemS()
                        layout.itemR(curve, "curve_2d")                 
                                                        
                        split = layout.split()
@@ -46,7 +63,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
                        colsub.itemR(curve, "back")
                        
                        col.itemL(text="Textures:")
-                       col.itemR(curve, "uv_orco")
+#                      col.itemR(curve, "uv_orco")
                        col.itemR(curve, "auto_texspace")
                        
                        sub = split.column()    
@@ -56,10 +73,10 @@ class DATA_PT_shape_curve(DataButtonsPanel):
                        sub.itemR(curve, "render_resolution_u", text="Render U")
                        sub.itemR(curve, "render_resolution_v", text="Render V")
 
-                       sub.itemL(text="Display:")
-                       sub.itemL(text="HANDLES")
-                       sub.itemL(text="NORMALS")
-                       sub.itemR(curve, "vertex_normal_flip")
+#                      sub.itemL(text="Display:")
+#                      sub.itemL(text="HANDLES")
+#                      sub.itemL(text="NORMALS")
+#                      sub.itemR(curve, "vertex_normal_flip")
 
 class DATA_PT_geometry(DataButtonsPanel):
        __idname__ = "DATA_PT_geometry"
@@ -141,6 +158,7 @@ class DATA_PT_current_curve(DataButtonsPanel):
                sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
                sub.itemR(currentcurve, "smooth")
                
+bpy.types.register(DATA_PT_context)
 bpy.types.register(DATA_PT_shape_curve)
 bpy.types.register(DATA_PT_geometry)
 bpy.types.register(DATA_PT_pathanim)
index a556aceb98dd67319fd1ded437ab7c990e5a35a6..815821c6895af7acac23d669c6a4685ea7f63259 100644 (file)
@@ -19,9 +19,9 @@ class DATA_PT_preview(DataButtonsPanel):
                lamp = context.lamp
                layout.template_preview(lamp)
        
-class DATA_PT_lamp(DataButtonsPanel):
-       __idname__ = "DATA_PT_lamp"
-       __label__ = "Lamp"
+class DATA_PT_context(DataButtonsPanel):
+       __idname__ = "DATA_PT_context"
+       __label__ = " "
        
        def poll(self, context):
                return ((context.object and context.object.type == 'LAMP') or context.lamp)
@@ -42,7 +42,20 @@ class DATA_PT_lamp(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
-               layout.itemS()
+
+class DATA_PT_lamp(DataButtonsPanel):
+       __idname__ = "DATA_PT_lamp"
+       __label__ = "Lamp"
+       
+       def poll(self, context):
+               return ((context.object and context.object.type == 'LAMP') or context.lamp)
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               lamp = context.lamp
+               space = context.space_data
 
                layout.itemR(lamp, "type", expand=True)
                
@@ -244,6 +257,7 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
 
                layout.template_curve_mapping(lamp.falloff_curve)
 
+bpy.types.register(DATA_PT_context)
 bpy.types.register(DATA_PT_preview)
 bpy.types.register(DATA_PT_lamp)
 bpy.types.register(DATA_PT_shadow)
index 653a638c458db868e75dde58f313dcccfb044134..e6194f4fcb4af4a6a4b21da3aced001a82ea1977 100644 (file)
@@ -9,9 +9,9 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.lattice != None)
        
-class DATA_PT_lattice(DataButtonsPanel):
-       __idname__ = "DATA_PT_lattice"
-       __label__ = "Lattice"
+class DATA_PT_context(DataButtonsPanel):
+       __idname__ = "DATA_PT_context"
+       __label__ = " "
        
        def poll(self, context):
                return (context.object and context.object.type == 'LATTICE')
@@ -32,9 +32,22 @@ class DATA_PT_lattice(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
-               if lat:
-                       layout.itemS()
 
+class DATA_PT_lattice(DataButtonsPanel):
+       __idname__ = "DATA_PT_lattice"
+       __label__ = "Lattice"
+       
+       def poll(self, context):
+               return (context.object and context.object.type == 'LATTICE')
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               lat = context.lattice
+               space = context.space_data
+
+               if lat:
                        row = layout.row()
                        row.itemR(lat, "points_u")
                        row.itemR(lat, "interpolation_type_u", expand=True)
@@ -51,4 +64,5 @@ class DATA_PT_lattice(DataButtonsPanel):
                        row.itemO("LATTICE_OT_make_regular")
                        row.itemR(lat, "outside")
 
+bpy.types.register(DATA_PT_context)
 bpy.types.register(DATA_PT_lattice)
index cb3041d505728f3f361418a20aa9fff89d386ebf..5e7c34d56a9c76977eb4ee4b8f4a75602f936cd0 100644 (file)
@@ -9,9 +9,10 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.mesh != None)
 
-class DATA_PT_mesh(DataButtonsPanel):
-       __idname__ = "DATA_PT_mesh"
-       __label__ = "Mesh"
+
+class DATA_PT_context2(DataButtonsPanel):
+       __idname__ = "DATA_PT_context2"
+       __label__ = " "
        
        def poll(self, context):
                return (context.object and context.object.type == 'MESH')
@@ -32,9 +33,24 @@ class DATA_PT_mesh(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
-               if mesh:
-                       layout.itemS()
 
+
+
+class DATA_PT_mesh(DataButtonsPanel):
+       __idname__ = "DATA_PT_mesh"
+       __label__ = "Mesh"
+       
+       def poll(self, context):
+               return (context.object and context.object.type == 'MESH')
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               mesh = context.mesh
+               space = context.space_data
+
+               if mesh:
                        split = layout.split()
                
                        col = split.column()
@@ -46,6 +62,7 @@ class DATA_PT_mesh(DataButtonsPanel):
                        sub.itemR(mesh, "vertex_normal_flip")
                        sub.itemR(mesh, "double_sided")
                        
+                       layout.itemS()
                        layout.itemR(mesh, "texco_mesh")
 
 
@@ -205,6 +222,7 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
                col.itemO("MESH_OT_vertex_color_add", icon="ICON_ZOOMIN", text="")
                col.itemO("MESH_OT_vertex_color_remove", icon="ICON_ZOOMOUT", text="")
 
+bpy.types.register(DATA_PT_context2)
 bpy.types.register(DATA_PT_mesh)
 bpy.types.register(DATA_PT_materials)
 bpy.types.register(DATA_PT_vertex_groups)
index 5f4cdd3f8389ca7e9e218e57be37c3e7532c2bff..e2113a346da7fa3618c240f1d8c6d7513144d525 100644 (file)
@@ -9,9 +9,9 @@ class DataButtonsPanel(bpy.types.Panel):
        def poll(self, context):
                return (context.object and context.object.type == 'TEXT' and context.curve)
                
-class DATA_PT_shape_text(DataButtonsPanel):
-       __idname__ = "DATA_PT_shape_text"
-       __label__ = "Shape Text"
+class DATA_PT_context(DataButtonsPanel):
+       __idname__ = "DATA_PT_context"
+       __label__ = " "
        
        def poll(self, context):
                ob = context.object
@@ -33,8 +33,23 @@ class DATA_PT_shape_text(DataButtonsPanel):
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
+
+class DATA_PT_shape_text(DataButtonsPanel):
+       __idname__ = "DATA_PT_shape_text"
+       __label__ = "Shape Text"
+       
+       def poll(self, context):
+               ob = context.object
+               return (context.object and context.object.type == 'TEXT')
+
+       def draw(self, context):
+               layout = self.layout
+               
+               ob = context.object
+               curve = context.curve
+               space = context.space_data
+
                if curve:
-                       layout.itemS()
                        layout.itemR(curve, "curve_2d")                 
                                                        
                        split = layout.split()
@@ -57,7 +72,29 @@ class DATA_PT_shape_text(DataButtonsPanel):
 
                        sub.itemL(text="Display:")
                        sub.itemR(curve, "fast")
-                       
+
+class DATA_PT_geometry(DataButtonsPanel):
+       __idname__ = "DATA_PT_geometry"
+       __label__ = "Geometry"
+
+       def draw(self, context):
+               layout = self.layout
+               curve = context.curve
+
+               split = layout.split()
+       
+               sub = split.column()
+               sub.itemL(text="Modification:")
+               sub.itemR(curve, "width")
+               sub.itemR(curve, "extrude")
+               sub.itemR(curve, "taper_object")
+               
+               sub = split.column()
+               sub.itemL(text="Bevel:")
+               sub.itemR(curve, "bevel_depth", text="Depth")
+               sub.itemR(curve, "bevel_resolution", text="Resolution")
+               sub.itemR(curve, "bevel_object")
+
 class DATA_PT_font(DataButtonsPanel):
        __idname__ = "DATA_PT_font"
        __label__ = "Font"
@@ -124,7 +161,9 @@ class DATA_PT_textboxes(DataButtonsPanel):
                        text = context.curve
 """
 
+bpy.types.register(DATA_PT_context)    
 bpy.types.register(DATA_PT_shape_text) 
+bpy.types.register(DATA_PT_geometry)
 bpy.types.register(DATA_PT_font)
 bpy.types.register(DATA_PT_paragraph)
 #bpy.types.register(DATA_PT_textboxes)
index 8b0ef82b62822c645dcb92e953293259c7e623f8..fb7f86c514bc633eb4e58cd805b1c278ea569bea 100644 (file)
@@ -21,10 +21,10 @@ class MATERIAL_PT_preview(MaterialButtonsPanel):
                mat = context.material
                
                layout.template_preview(mat)
-       
-class MATERIAL_PT_material(MaterialButtonsPanel):
-       __idname__= "MATERIAL_PT_material"
-       __label__ = "Material"
+               
+class MATERIAL_PT_context(MaterialButtonsPanel):
+       __idname__= "MATERIAL_PT_context"
+       __label__ = " "
 
        def poll(self, context):
                return (context.material or context.material_slot)
@@ -37,18 +37,40 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
                slot = context.material_slot
                space = context.space_data
 
+               row = layout.row()
+
+               row.template_list(ob, "materials", ob, "active_material_index")
+
+               col = row.column(align=True)
+               col.itemO("OBJECT_OT_material_slot_add", icon="ICON_ZOOMIN", text="")
+               col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="")
+
                split = layout.split(percentage=0.65)
 
                if ob and slot:
                        split.template_ID(slot, "material", new="MATERIAL_OT_new")
-                       split.itemR(ob, "active_material_index", text="Active")
+                       #split.itemR(ob, "active_material_index", text="Active")
                elif mat:
                        split.template_ID(space, "pin_id")
                        split.itemS()
 
-               if mat:
-                       layout.itemS()
+       
+class MATERIAL_PT_material(MaterialButtonsPanel):
+       __idname__= "MATERIAL_PT_material"
+       __label__ = "Material"
+
+       def poll(self, context):
+               return (context.material or context.material_slot)
+
+       def draw(self, context):
+               layout = self.layout
                
+               mat = context.material
+               ob = context.object
+               slot = context.material_slot
+               space = context.space_data
+
+               if mat:
                        layout.itemR(mat, "type", expand=True)
                        
                        layout.itemR(mat, "alpha", slider=True)
@@ -413,6 +435,8 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
                colsub.itemR(halo, "flare_seed", text="Seed")
                colsub.itemR(halo, "flares_sub", text="Sub")
 
+
+bpy.types.register(MATERIAL_PT_context)
 bpy.types.register(MATERIAL_PT_preview)
 bpy.types.register(MATERIAL_PT_material)
 bpy.types.register(MATERIAL_PT_diffuse)
index 3138f447ad2f078f7e47c94a81d428e5d4c2b36c..4e3ab2672dcd19de2ae7a2c8a6f448739d91fc89 100644 (file)
@@ -6,6 +6,20 @@ class ObjectButtonsPanel(bpy.types.Panel):
        __region_type__ = "WINDOW"
        __context__ = "object"
 
+class OBJECT_PT_context(ObjectButtonsPanel):
+       __idname__ = "OBJECT_PT_context"
+       __label__ = " "
+
+       def draw(self, context):
+               layout = self.layout
+               ob = context.object
+               
+               split = layout.split(percentage=0.06)
+               split.itemL(text="", icon="ICON_OBJECT_DATA")
+               split.itemR(ob, "name", text="")
+               
+                       
+                       
 class OBJECT_PT_transform(ObjectButtonsPanel):
        __idname__ = "OBJECT_PT_transform"
        __label__ = "Transform"
@@ -124,6 +138,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
                sub.itemR(ob, "up_axis", text="Up Axis")
                sub.itemR(ob, "track_rotation", text="Rotation")
 
+bpy.types.register(OBJECT_PT_context)
 bpy.types.register(OBJECT_PT_transform)
 bpy.types.register(OBJECT_PT_groups)
 bpy.types.register(OBJECT_PT_display)
index 93ce9c5c74532115601c0038e429da378b613c22..652f46d967528523fb3565c2d4c9f712f854658e 100644 (file)
@@ -20,7 +20,7 @@ class ParticleButtonsPanel(bpy.types.Panel):
 
 class PARTICLE_PT_particles(ParticleButtonsPanel):
        __idname__= "PARTICLE_PT_particles"
-       __label__ = "Particle System"
+       __label__ = " "
 
        def poll(self, context):
                return (context.particle_system or context.object)
index 31908d5ec9c72b6c14a0e29165eda0fec132d20a..4771a550555796cc47b90a611a2cf4352aaac12a 100644 (file)
@@ -22,16 +22,16 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
                
                layout.template_preview(tex)
 
-class TEXTURE_PT_texture(TextureButtonsPanel):
-       __idname__= "TEXTURE_PT_texture"
-       __label__ = "Texture"
+class TEXTURE_PT_context(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_context"
+       __label__ = " "
 
        def poll(self, context):
                return (context.material or context.world or context.lamp or context.texture)
 
        def draw(self, context):
                layout = self.layout
-               
+
                tex = context.texture
                ma = context.material
                la = context.lamp
@@ -39,6 +39,24 @@ class TEXTURE_PT_texture(TextureButtonsPanel):
                space = context.space_data
                slot = context.texture_slot
 
+               row = layout.row()
+               if ma:
+                       row.template_list(ma, "textures", ma, "active_texture_index")
+                       col = row.column(align=True)
+                       col.itemO("TEXTURE_OT_new", icon="ICON_ZOOMIN", text="")
+                       #col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="")
+               elif la:
+                       row.template_list(la, "textures", la, "active_texture_index")
+                       col = row.column(align=True)
+                       col.itemO("TEXTURE_OT_new", icon="ICON_ZOOMIN", text="")
+                       #col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="")
+               elif wo:
+                       row.template_list(wo, "textures", wo, "active_texture_index")
+                       col = row.column(align=True)
+                       col.itemO("TEXTURE_OT_new", icon="ICON_ZOOMIN", text="")
+                       #col.itemO("OBJECT_OT_material_slot_remove", icon="ICON_ZOOMOUT", text="")
+
+
                split = layout.split(percentage=0.65)
 
                if ma or la or wo:
@@ -47,17 +65,12 @@ class TEXTURE_PT_texture(TextureButtonsPanel):
                        else:
                                split.itemS()
 
-                       if ma:
-                               split.itemR(ma, "active_texture_index", text="Active")
-                       elif la:
-                               split.itemR(la, "active_texture_index", text="Active")
-                       elif wo:
-                               split.itemR(wo, "active_texture_index", text="Active")
+
                elif tex:
                        split.template_ID(space, "pin_id")
                        split.itemS()
-
-               layout.itemS()
+                       
+                       layout.itemS()
                
                if tex:
                        split = layout.split(percentage=0.2)
@@ -66,6 +79,21 @@ class TEXTURE_PT_texture(TextureButtonsPanel):
                        col.itemL(text="Type:")
                        col = split.column()
                        col.itemR(tex, "type", text="")
+               
+
+class TEXTURE_PT_texture(TextureButtonsPanel):
+       __idname__= "TEXTURE_PT_texture"
+       __label__ = "Texture"
+
+       def poll(self, context):
+               return (context.material or context.world or context.lamp or context.texture)
+
+       def draw(self, context):
+               layout = self.layout
+               
+               tex = context.texture
+
+
 
 class TEXTURE_PT_mapping(TextureButtonsPanel):
        __idname__= "TEXTURE_PT_mapping"
@@ -511,6 +539,7 @@ class TEXTURE_PT_distortednoise(TextureButtonsPanel):
                sub = split.column()
                sub.itemR(tex, "nabla") 
 
+bpy.types.register(TEXTURE_PT_context)
 bpy.types.register(TEXTURE_PT_preview)
 bpy.types.register(TEXTURE_PT_texture)
 bpy.types.register(TEXTURE_PT_clouds)
index 39b5eca04ff284dbe028f716c7c2cb93061a6167..cfee92dff0b476db7347142968490e2faa357f72 100644 (file)
@@ -21,8 +21,8 @@ class WORLD_PT_preview(WorldButtonsPanel):
                
                layout.template_preview(world)
        
-class WORLD_PT_world(WorldButtonsPanel):
-       __label__ = "World"
+class WORLD_PT_context(WorldButtonsPanel):
+       __label__ = " "
 
        def poll(self, context):
                return (context.scene != None)
@@ -41,11 +41,23 @@ class WORLD_PT_world(WorldButtonsPanel):
                elif world:
                        split.template_ID(space, "pin_id")
 
-               split.itemS()
+class WORLD_PT_world(WorldButtonsPanel):
+       __label__ = "World"
+
+       def poll(self, context):
+               return (context.scene != None)
+
+       def draw(self, context):
+               layout = self.layout
+               
+               scene = context.scene
+               world = context.world
+               space = context.space_data
+
+
 
                if world:
-                       layout.itemS()
-                       
+               
                        row = layout.row()
                        row.itemR(world, "blend_sky")
                        row.itemR(world, "paper_sky")
@@ -173,7 +185,8 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
                col.row().itemR(ao, "blend_mode", expand=True)
                col.row().itemR(ao, "color", expand=True)
                col.itemR(ao, "energy")
-       
+
+bpy.types.register(WORLD_PT_context)   
 bpy.types.register(WORLD_PT_preview)
 bpy.types.register(WORLD_PT_world)
 bpy.types.register(WORLD_PT_ambient_occlusion)