"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."
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)
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()
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)
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
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")
sub.itemR(bone, "cyclic_offset")
+
+bpy.types.register(BONE_PT_context)
bpy.types.register(BONE_PT_bone)
+bpy.types.register(BONE_PT_deform)
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')
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)
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)
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')
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()
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()
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"
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)
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)
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)
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)
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')
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)
row.itemO("LATTICE_OT_make_regular")
row.itemR(lat, "outside")
+bpy.types.register(DATA_PT_context)
bpy.types.register(DATA_PT_lattice)
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')
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()
sub.itemR(mesh, "vertex_normal_flip")
sub.itemR(mesh, "double_sided")
+ layout.itemS()
layout.itemR(mesh, "texco_mesh")
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)
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
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()
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"
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)
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)
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)
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)
__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"
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)
class PARTICLE_PT_particles(ParticleButtonsPanel):
__idname__= "PARTICLE_PT_particles"
- __label__ = "Particle System"
+ __label__ = " "
def poll(self, context):
return (context.particle_system or context.object)
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
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:
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)
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"
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)
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)
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")
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)