Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-07-09 13:07:25 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-07-09 13:07:25 +0400
commit9f592e4f625c302a56ea337e71d21221273eb938 (patch)
treeb420b941b228110a11870a77af5841bb72e99ef9
parenteab7905a9e03c9d8cb5a250f893be4f78cc04dde (diff)
Patch from William
"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."
-rw-r--r--release/ui/buttons_data_armature.py23
-rw-r--r--release/ui/buttons_data_bone.py65
-rw-r--r--release/ui/buttons_data_camera.py22
-rw-r--r--release/ui/buttons_data_curve.py36
-rw-r--r--release/ui/buttons_data_lamp.py22
-rw-r--r--release/ui/buttons_data_lattice.py24
-rw-r--r--release/ui/buttons_data_mesh.py28
-rw-r--r--release/ui/buttons_data_text.py49
-rw-r--r--release/ui/buttons_material.py38
-rw-r--r--release/ui/buttons_objects.py15
-rw-r--r--release/ui/buttons_particle.py2
-rw-r--r--release/ui/buttons_texture.py53
-rw-r--r--release/ui/buttons_world.py25
13 files changed, 330 insertions, 72 deletions
diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py
index 112724bea91..98002f69ccb 100644
--- a/release/ui/buttons_data_armature.py
+++ b/release/ui/buttons_data_armature.py
@@ -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)
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py
index 044f7b93806..397a5eb0cd4 100644
--- a/release/ui/buttons_data_bone.py
+++ b/release/ui/buttons_data_bone.py
@@ -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)
diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py
index 9f3a062b429..2092a34f9e8 100644
--- a/release/ui/buttons_data_camera.py
+++ b/release/ui/buttons_data_camera.py
@@ -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)
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
index e60f9591d29..cc671871d1d 100644
--- a/release/ui/buttons_data_curve.py
+++ b/release/ui/buttons_data_curve.py
@@ -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)
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py
index a556aceb98d..815821c6895 100644
--- a/release/ui/buttons_data_lamp.py
+++ b/release/ui/buttons_data_lamp.py
@@ -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)
diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py
index 653a638c458..e6194f4fcb4 100644
--- a/release/ui/buttons_data_lattice.py
+++ b/release/ui/buttons_data_lattice.py
@@ -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)
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py
index cb3041d5057..5e7c34d56a9 100644
--- a/release/ui/buttons_data_mesh.py
+++ b/release/ui/buttons_data_mesh.py
@@ -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)
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
index 5f4cdd3f838..e2113a346da 100644
--- a/release/ui/buttons_data_text.py
+++ b/release/ui/buttons_data_text.py
@@ -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)
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index 8b0ef82b628..fb7f86c514b 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -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)
diff --git a/release/ui/buttons_objects.py b/release/ui/buttons_objects.py
index 3138f447ad2..4e3ab2672dc 100644
--- a/release/ui/buttons_objects.py
+++ b/release/ui/buttons_objects.py
@@ -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)
diff --git a/release/ui/buttons_particle.py b/release/ui/buttons_particle.py
index 93ce9c5c745..652f46d9675 100644
--- a/release/ui/buttons_particle.py
+++ b/release/ui/buttons_particle.py
@@ -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)
diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py
index 31908d5ec9c..4771a550555 100644
--- a/release/ui/buttons_texture.py
+++ b/release/ui/buttons_texture.py
@@ -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)
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index 39b5eca04ff..cfee92dff0b 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -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)