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."
This commit is contained in:
Campbell Barton
2009-07-09 09:07:25 +00:00
parent eab7905a9e
commit 9f592e4f62
13 changed files with 354 additions and 96 deletions

View 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)

View 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="Inherit:")
sub.itemR(bone, "hinge")
sub.itemR(bone, "inherit_scale")
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 = split.column()
sub.itemL(text="Inherit:")
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="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)

View 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)

View 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)

View 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)

View 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)

View 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)

View 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)

View File

@@ -21,6 +21,39 @@ class MATERIAL_PT_preview(MaterialButtonsPanel):
mat = context.material
layout.template_preview(mat)
class MATERIAL_PT_context(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_context"
__label__ = " "
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
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")
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
class MATERIAL_PT_material(MaterialButtonsPanel):
__idname__= "MATERIAL_PT_material"
@@ -37,18 +70,7 @@ class MATERIAL_PT_material(MaterialButtonsPanel):
slot = context.material_slot
space = context.space_data
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")
elif mat:
split.template_ID(space, "pin_id")
split.itemS()
if mat:
layout.itemS()
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)

View 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)

View 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)

View File

@@ -22,6 +22,65 @@ class TEXTURE_PT_preview(TextureButtonsPanel):
layout.template_preview(tex)
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
wo = context.world
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:
if slot:
split.template_ID(slot, "texture", new="TEXTURE_OT_new")
else:
split.itemS()
elif tex:
split.template_ID(space, "pin_id")
split.itemS()
layout.itemS()
if tex:
split = layout.split(percentage=0.2)
col = split.column()
col.itemL(text="Type:")
col = split.column()
col.itemR(tex, "type", text="")
class TEXTURE_PT_texture(TextureButtonsPanel):
__idname__= "TEXTURE_PT_texture"
__label__ = "Texture"
@@ -33,39 +92,8 @@ class TEXTURE_PT_texture(TextureButtonsPanel):
layout = self.layout
tex = context.texture
ma = context.material
la = context.lamp
wo = context.world
space = context.space_data
slot = context.texture_slot
split = layout.split(percentage=0.65)
if ma or la or wo:
if slot:
split.template_ID(slot, "texture", new="TEXTURE_OT_new")
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()
if tex:
split = layout.split(percentage=0.2)
col = split.column()
col.itemL(text="Type:")
col = split.column()
col.itemR(tex, "type", text="")
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)

View 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)