2.5 Part 1 of Layout Code Cleanup:

* Again, some layout code cleaning. 
* Made assignments more consistent. 

I started to write code guidelines in the wiki:
http://wiki.blender.org/index.php/LayoutFiles-Code_Guidelines

Matt/William: You are welcome to change them or add new infos, I will continue on improving them as well in the next few days.
This commit is contained in:
Thomas Dinges 2009-07-27 20:39:10 +00:00
parent 793324ef83
commit 09fd0a5e48
8 changed files with 232 additions and 232 deletions

@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
return (context.armature != None)
return (context.armature)
class DATA_PT_context_arm(DataButtonsPanel):
__show_header__ = False
@ -38,43 +38,40 @@ class DATA_PT_skeleton(DataButtonsPanel):
arm = context.armature
space = context.space_data
split = layout.split()
if arm:
split = layout.split()
col = split.column()
col.itemR(arm, "rest_position")
sub = col.column()
sub.itemL(text="Deform:")
sub.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
sub.itemR(arm, "deform_envelope", text="Envelopes")
sub.itemR(arm, "deform_quaternion", text="Quaternion")
sub.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
#sub.itemR(arm, "x_axis_mirror")
#sub.itemR(arm, "auto_ik")
col = split.column()
col.itemR(arm, "rest_position")
col.itemL(text="Deform:")
col.itemR(arm, "deform_vertexgroups", text="Vertes Groups")
col.itemR(arm, "deform_envelope", text="Envelopes")
col.itemR(arm, "deform_quaternion", text="Quaternion")
col.itemR(arm, "deform_bbone_rest", text="B-Bones Rest")
#col.itemR(arm, "x_axis_mirror")
#col.itemR(arm, "auto_ik")
sub = split.column()
sub.itemL(text="Layers:")
sub.template_layers(arm, "layer")
sub.itemL(text="Protected Layers:")
sub.template_layers(arm, "layer_protection")
col = split.column()
col.itemL(text="Layers:")
col.template_layers(arm, "layer")
col.itemL(text="Protected Layers:")
col.template_layers(arm, "layer_protection")
class DATA_PT_display(DataButtonsPanel):
__label__ = "Display"
def draw(self, context):
layout = self.layout
arm = context.armature
layout.row().itemR(arm, "drawtype", expand=True)
sub = layout.column_flow()
sub.itemR(arm, "draw_names", text="Names")
sub.itemR(arm, "draw_axes", text="Axes")
sub.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
sub.itemR(arm, "draw_group_colors", text="Colors")
sub.itemR(arm, "delay_deform", text="Delay Refresh")
flow = layout.column_flow()
flow.itemR(arm, "draw_names", text="Names")
flow.itemR(arm, "draw_axes", text="Axes")
flow.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
flow.itemR(arm, "draw_group_colors", text="Colors")
flow.itemR(arm, "delay_deform", text="Delay Refresh")
class DATA_PT_bone_groups(DataButtonsPanel):
__label__ = "Bone Groups"
@ -84,11 +81,11 @@ class DATA_PT_bone_groups(DataButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
pose= ob.pose
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
col = row.column(align=True)
@ -109,7 +106,7 @@ class DATA_PT_bone_groups(DataButtonsPanel):
split.template_triColorSet(group, "colors")
row = layout.row(align=True)
row.active= (ob.proxy == None)
row.active = (ob.proxy == None)
row.itemO("pose.group_assign", text="Assign")
row.itemO("pose.group_remove", text="Remove") #row.itemO("pose.bone_group_remove_from", text="Remove")
@ -121,52 +118,55 @@ class DATA_PT_paths(DataButtonsPanel):
def draw(self, context):
layout = self.layout
arm = context.armature
split = layout.split()
sub = split.column()
sub.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
col = sub.column(align=True)
if (arm.paths_show_around_current_frame):
col.itemR(arm, "path_before_current", text="Before")
col.itemR(arm, "path_after_current", text="After")
else:
col.itemR(arm, "path_start_frame", text="Start")
col.itemR(arm, "path_end_frame", text="End")
col.itemR(arm, "path_size", text="Step")
sub.itemR(arm, "paths_calculate_head_positions", text="Head")
col = split.column()
col.itemR(arm, "paths_show_around_current_frame", text="Around Frame")
sub = split.column()
sub.itemL(text="Show:")
sub.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
sub.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
sub.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
sub = col.column(align=True)
if (arm.paths_show_around_current_frame):
sub.itemR(arm, "path_before_current", text="Before")
sub.itemR(arm, "path_after_current", text="After")
else:
sub.itemR(arm, "path_start_frame", text="Start")
sub.itemR(arm, "path_end_frame", text="End")
sub.itemR(arm, "path_size", text="Step")
col.itemR(arm, "paths_calculate_head_positions", text="Head")
col = split.column()
col.itemL(text="Show:")
col.itemR(arm, "paths_show_frame_numbers", text="Frame Numbers")
col.itemR(arm, "paths_highlight_keyframes", text="Keyframes")
col.itemR(arm, "paths_show_keyframe_numbers", text="Keyframe Numbers")
class DATA_PT_ghost(DataButtonsPanel):
__label__ = "Ghost"
def draw(self, context):
layout = self.layout
arm = context.armature
split = layout.split()
sub = split.column()
sub.itemR(arm, "ghost_type", text="Scope")
col = split.column()
col.itemR(arm, "ghost_type", text="Scope")
col = sub.column(align=True)
sub = col.column(align=True)
if arm.ghost_type == 'RANGE':
col.itemR(arm, "ghost_start_frame", text="Start")
col.itemR(arm, "ghost_end_frame", text="End")
col.itemR(arm, "ghost_size", text="Step")
sub.itemR(arm, "ghost_start_frame", text="Start")
sub.itemR(arm, "ghost_end_frame", text="End")
sub.itemR(arm, "ghost_size", text="Step")
elif arm.ghost_type == 'CURRENT_FRAME':
col.itemR(arm, "ghost_step", text="Range")
col.itemR(arm, "ghost_size", text="Step")
sub.itemR(arm, "ghost_step", text="Range")
sub.itemR(arm, "ghost_size", text="Step")
sub = split.column()
sub.itemR(arm, "ghost_only_selected", text="Selected Only")
col = split.column()
col.itemR(arm, "ghost_only_selected", text="Selected Only")
bpy.types.register(DATA_PT_context_arm)
bpy.types.register(DATA_PT_skeleton)

@ -14,6 +14,7 @@ class BONE_PT_context_bone(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
@ -27,9 +28,9 @@ class BONE_PT_transform(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
if not bone:
bone = context.edit_bone
@ -43,7 +44,7 @@ class BONE_PT_transform(BoneButtonsPanel):
sub.itemR(bone, "roll", text="")
sub.itemL()
sub.itemR(bone, "locked")
sub.itemS()
else:
pchan = ob.pose.pose_channels[context.bone.name]
@ -70,9 +71,9 @@ class BONE_PT_transform(BoneButtonsPanel):
class BONE_PT_bone(BoneButtonsPanel):
__label__ = "Bone"
def draw(self, context):
layout = self.layout
bone = context.bone
arm = context.armature
if not bone:
@ -80,28 +81,27 @@ class BONE_PT_bone(BoneButtonsPanel):
split = layout.split()
sub = split.column()
sub.itemL(text="Parent:")
col = split.column()
col.itemL(text="Parent:")
if context.bone:
sub.itemR(bone, "parent", text="")
col.itemR(bone, "parent", text="")
else:
sub.item_pointerR(bone, "parent", arm, "edit_bones", text="")
row = sub.row()
row.itemR(bone, "connected")
col.item_pointerR(bone, "parent", arm, "edit_bones", text="")
row = col.row()
row.active = bone.parent != None
row.itemR(bone, "connected")
sub.itemL(text="Layers:")
sub.template_layers(bone, "layer")
col.itemL(text="Layers:")
col.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")
col = split.column()
col.itemL(text="Inherit:")
col.itemR(bone, "hinge", text="Rotation")
col.itemR(bone, "inherit_scale", text="Scale")
col.itemL(text="Display:")
col.itemR(bone, "draw_wire", text="Wireframe")
col.itemR(bone, "hidden", text="Hide")
class BONE_PT_inverse_kinematics(BoneButtonsPanel):
__label__ = "Inverse Kinematics"
@ -119,6 +119,7 @@ class BONE_PT_inverse_kinematics(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
bone = context.bone
pchan = ob.pose.pose_channels[context.bone.name]
@ -178,6 +179,7 @@ class BONE_PT_deform(BoneButtonsPanel):
def draw_header(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
@ -186,6 +188,7 @@ class BONE_PT_deform(BoneButtonsPanel):
def draw(self, context):
layout = self.layout
bone = context.bone
if not bone:
bone = context.edit_bone
@ -196,6 +199,7 @@ class BONE_PT_deform(BoneButtonsPanel):
col = split.column()
col.itemL(text="Envelope:")
sub = col.column(align=True)
sub.itemR(bone, "envelope_distance", text="Distance")
sub.itemR(bone, "envelope_weight", text="Weight")
@ -208,6 +212,7 @@ class BONE_PT_deform(BoneButtonsPanel):
col = split.column()
col.itemL(text="Curved Bones:")
sub = col.column(align=True)
sub.itemR(bone, "bbone_segments", text="Segments")
sub.itemR(bone, "bbone_in", text="Ease In")
@ -221,4 +226,3 @@ bpy.types.register(BONE_PT_transform)
bpy.types.register(BONE_PT_bone)
bpy.types.register(BONE_PT_deform)
bpy.types.register(BONE_PT_inverse_kinematics)

@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
return (context.camera != None)
return (context.camera)
class DATA_PT_context_camera(DataButtonsPanel):
__show_header__ = False
@ -49,53 +49,49 @@ class DATA_PT_camera(DataButtonsPanel):
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
split = layout.split()
split.itemR(cam, "panorama");
split.itemL()
layout.itemR(cam, "panorama");
split = layout.split()
sub = split.column(align=True)
sub.itemL(text="Shift:")
sub.itemR(cam, "shift_x", text="X")
sub.itemR(cam, "shift_y", text="Y")
col = split.column(align=True)
col.itemL(text="Shift:")
col.itemR(cam, "shift_x", text="X")
col.itemR(cam, "shift_y", text="Y")
sub = split.column(align=True)
sub.itemL(text="Clipping:")
sub.itemR(cam, "clip_start", text="Start")
sub.itemR(cam, "clip_end", text="End")
col = split.column(align=True)
col.itemL(text="Clipping:")
col.itemR(cam, "clip_start", text="Start")
col.itemR(cam, "clip_end", text="End")
split = layout.split()
col = split.column()
col.itemL(text="Depth of Field:")
col.itemR(cam, "dof_object", text="")
col = split.column()
col.itemL()
col.itemR(cam, "dof_distance", text="Distance")
layout.itemL(text="Depth of Field:")
row = layout.row()
row.itemR(cam, "dof_object", text="")
row.itemR(cam, "dof_distance", text="Distance")
class DATA_PT_camera_display(DataButtonsPanel):
__label__ = "Display"
def draw(self, context):
cam = context.camera
layout = self.layout
cam = context.camera
split = layout.split()
sub = split.column()
sub.itemR(cam, "show_limits", text="Limits")
sub.itemR(cam, "show_mist", text="Mist")
sub.itemR(cam, "show_title_safe", text="Title Safe")
sub.itemR(cam, "show_name", text="Name")
col = split.column()
col.itemR(cam, "show_limits", text="Limits")
col.itemR(cam, "show_mist", text="Mist")
col.itemR(cam, "show_title_safe", text="Title Safe")
col.itemR(cam, "show_name", text="Name")
col = split.column()
col.itemR(cam, "show_passepartout", text="Passepartout")
colsub = col.column()
colsub.active = cam.show_passepartout
colsub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
sub = col.column()
sub.active = cam.show_passepartout
sub.itemR(cam, "passepartout_alpha", text="Alpha", slider=True)
col.itemR(cam, "draw_size", text="Size")
bpy.types.register(DATA_PT_context_camera)
bpy.types.register(DATA_PT_camera)
bpy.types.register(DATA_PT_camera_display)

@ -28,7 +28,6 @@ class DATA_PT_context_curve(DataButtonsPanel):
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_shape_curve(DataButtonsPanel):
__label__ = "Shape"
@ -72,6 +71,7 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
def draw(self, context):
layout = self.layout
curve = context.curve
split = layout.split()
@ -93,60 +93,63 @@ class DATA_PT_pathanim(DataButtonsPanel):
def draw_header(self, context):
layout = self.layout
curve = context.curve
layout.itemR(curve, "path", text="")
def draw(self, context):
curve = context.curve
layout = self.layout
curve = context.curve
layout.active = curve.path
split = layout.split()
sub = split.column()
sub.itemR(curve, "path_length", text="Frames")
sub.itemR(curve, "follow")
col = split.column()
col.itemR(curve, "path_length", text="Frames")
col.itemR(curve, "follow")
sub = split.column()
sub.itemR(curve, "stretch")
sub.itemR(curve, "offset_path_distance", text="Offset Children")
col = split.column()
col.itemR(curve, "stretch")
col.itemR(curve, "offset_path_distance", text="Offset Children")
class DATA_PT_current_curve(DataButtonsPanel):
__label__ = "Current Curve"
def draw(self, context):
layout = self.layout
currentcurve = context.curve.curves[0] # XXX
split = layout.split()
sub = split.column()
sub.itemL(text="Cyclic:")
sub.itemR(currentcurve, "cyclic_u", text="U")
sub.itemR(currentcurve, "cyclic_v", text="V")
sub.itemL(text="Order:")
sub.itemR(currentcurve, "order_u", text="U")
sub.itemR(currentcurve, "order_v", text="V")
sub.itemL(text="Endpoints:")
sub.itemR(currentcurve, "endpoint_u", text="U")
sub.itemR(currentcurve, "endpoint_v", text="V")
col = split.column()
col.itemL(text="Cyclic:")
col.itemR(currentcurve, "cyclic_u", text="U")
col.itemR(currentcurve, "cyclic_v", text="V")
col.itemL(text="Order:")
col.itemR(currentcurve, "order_u", text="U")
col.itemR(currentcurve, "order_v", text="V")
col.itemL(text="Endpoints:")
col.itemR(currentcurve, "endpoint_u", text="U")
col.itemR(currentcurve, "endpoint_v", text="V")
sub = split.column()
sub.itemL(text="Bezier:")
sub.itemR(currentcurve, "bezier_u", text="U")
sub.itemR(currentcurve, "bezier_v", text="V")
sub.itemL(text="Resolution:")
sub.itemR(currentcurve, "resolution_u", text="U")
sub.itemR(currentcurve, "resolution_v", text="V")
sub.itemL(text="Interpolation:")
sub.itemR(currentcurve, "tilt_interpolation", text="Tilt")
sub.itemR(currentcurve, "radius_interpolation", text="Tilt")
sub.itemR(currentcurve, "smooth")
col = split.column()
col.itemL(text="Bezier:")
col.itemR(currentcurve, "bezier_u", text="U")
col.itemR(currentcurve, "bezier_v", text="V")
col.itemL(text="Resolution:")
col.itemR(currentcurve, "resolution_u", text="U")
col.itemR(currentcurve, "resolution_v", text="V")
col.itemL(text="Interpolation:")
col.itemR(currentcurve, "tilt_interpolation", text="Tilt")
col.itemR(currentcurve, "radius_interpolation", text="Tilt")
col.itemR(currentcurve, "smooth")
bpy.types.register(DATA_PT_context_curve)
bpy.types.register(DATA_PT_shape_curve)
bpy.types.register(DATA_PT_geometry_curve)
bpy.types.register(DATA_PT_pathanim)
bpy.types.register(DATA_PT_current_curve)

@ -14,6 +14,7 @@ class DATA_PT_empty(DataButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
layout.itemR(ob, "empty_draw_type")

@ -7,17 +7,15 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
return (context.lamp != None)
return (context.lamp)
class DATA_PT_preview(DataButtonsPanel):
__idname__= "DATA_PT_preview"
__label__ = "Preview"
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.template_preview(lamp)
layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
__show_header__ = False
@ -49,58 +47,52 @@ class DATA_PT_lamp(DataButtonsPanel):
layout.itemR(lamp, "type", expand=True)
split = layout.split()
col = split.column()
#col.itemL(text="Type:")
#col.itemR(lamp, "type", text="")
colsub = col.column()
colsub.itemR(lamp, "color", text="")
colsub.itemR(lamp, "energy")
col = split.column()
col.itemR(lamp, "color", text="")
col.itemR(lamp, "energy")
col.itemR(lamp, "negative")
#col.itemR(lamp, "distance")
col.itemR(lamp, "distance")
sub = split.column()
#sub.itemL(text="Influence:")
sub.itemR(lamp, "layer", text="This Layer Only")
sub.itemR(lamp, "specular")
sub.itemR(lamp, "diffuse")
#sub.itemR(lamp, "negative")
col = split.column()
col.itemR(lamp, "layer", text="This Layer Only")
col.itemR(lamp, "specular")
col.itemR(lamp, "diffuse")
split = layout.split()
if lamp.type in ('POINT', 'SPOT'):
split = layout.split()
col = split.column()
col.itemL(text="Falloff:")
col = col.column(align=True)
col.itemR(lamp, "falloff_type", text="")
col.itemR(lamp, "distance")
col.itemR(lamp, "sphere")
sub = col.column(align=True)
sub.itemR(lamp, "falloff_type", text="")
sub.itemR(lamp, "distance")
sub.itemR(lamp, "sphere")
if lamp.falloff_type != 'LINEAR_QUADRATIC_WEIGHTED':
if lamp.falloff_type == 'LINEAR_QUADRATIC_WEIGHTED':
col = split.column()
else:
sub = split.column()
sub.itemL(text="Attenuation Distance:")
sub = sub.column(align=True)
col.itemL(text="Attenuation Distance:")
sub = col.column(align=True)
sub.itemR(lamp, "linear_attenuation", slider=True, text="Linear")
sub.itemR(lamp, "quadratic_attenuation", slider=True, text="Quadratic")
else:
split.column()
if lamp.type == 'AREA':
split = layout.split()
col = split.column()
col.itemL(text="Shape:")
col = col.column(align=True)
col.itemR(lamp, "shape", text="")
sub = col.column(align=True)
sub.itemR(lamp, "shape", text="")
if (lamp.shape == 'SQUARE'):
col.itemR(lamp, "size")
sub.itemR(lamp, "size")
if (lamp.shape == 'RECTANGLE'):
col.itemR(lamp, "size", text="Size X")
col.itemR(lamp, "size_y", text="Size Y")
sub.itemR(lamp, "size", text="Size X")
sub.itemR(lamp, "size_y", text="Size Y")
sub = split.column()
sub.itemL(text="Gamma:")
sub.itemR(lamp, "gamma", text="Value")
col = split.column()
col.itemL(text="Gamma:")
col.itemR(lamp, "gamma", text="Value")
class DATA_PT_sunsky(DataButtonsPanel):
__label__ = "Sun/Sky"
@ -110,6 +102,7 @@ class DATA_PT_sunsky(DataButtonsPanel):
def draw(self, context):
layout = self.layout
lamp = context.lamp.sky
row = layout.row()
@ -125,30 +118,29 @@ class DATA_PT_sunsky(DataButtonsPanel):
col = split.column()
col.active = lamp.sky
col.itemL(text="Blend Mode:")
colsub = col.column(align=True)
colsub.itemR(lamp, "sky_blend_type", text="")
colsub.itemR(lamp, "sky_blend", text="Factor")
sub = col.column(align=True)
sub.itemR(lamp, "sky_blend_type", text="")
sub.itemR(lamp, "sky_blend", text="Factor")
col.itemL(text="Color Space:")
colsub = col.column(align=True)
colsub.itemR(lamp, "sky_color_space", text="")
colsub.itemR(lamp, "sky_exposure", text="Exposure")
sub = col.column(align=True)
sub.itemR(lamp, "sky_color_space", text="")
sub.itemR(lamp, "sky_exposure", text="Exposure")
col = split.column()
col.active = lamp.sky
col.itemL(text="Horizon:")
colsub = col.column(align=True)
colsub.itemR(lamp, "horizon_brightness", text="Brightness")
colsub.itemR(lamp, "spread", text="Spread")
sub = col.column(align=True)
sub.itemR(lamp, "horizon_brightness", text="Brightness")
sub.itemR(lamp, "spread", text="Spread")
col.itemL(text="Sun:")
colsub = col.column(align=True)
colsub.itemR(lamp, "sun_brightness", text="Brightness")
colsub.itemR(lamp, "sun_size", text="Size")
colsub.itemR(lamp, "backscattered_light", slider=True,text="Back Light")
sub = col.column(align=True)
sub.itemR(lamp, "sun_brightness", text="Brightness")
sub.itemR(lamp, "sun_size", text="Size")
sub.itemR(lamp, "backscattered_light", slider=True,text="Back Light")
row = layout.row()
row.itemS()
layout.itemS()
split = layout.split()
@ -175,31 +167,32 @@ class DATA_PT_shadow(DataButtonsPanel):
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.itemR(lamp, "shadow_method", expand=True)
if lamp.shadow_method != 'NOSHADOW':
split = layout.split()
col = split.column()
col.itemR(lamp, "shadow_color", text="")
sub = split.column()
sub.itemR(lamp, "shadow_layer", text="This Layer Only")
sub.itemR(lamp, "only_shadow")
col = split.column()
col.itemR(lamp, "shadow_layer", text="This Layer Only")
col.itemR(lamp, "only_shadow")
if lamp.shadow_method == 'RAY_SHADOW':
col = layout.column()
col.itemL(text="Sampling:")
col.row().itemR(lamp, "shadow_ray_sampling_method", expand=True)
if lamp.type in ('POINT', 'SUN', 'SPOT'):
split = layout.split()
col = split.column(align=True)
col.itemR(lamp, "shadow_soft_size", text="Soft Size")
col = split.column(align=True)
col.itemR(lamp, "shadow_ray_samples", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
@ -207,56 +200,56 @@ class DATA_PT_shadow(DataButtonsPanel):
if lamp.type == 'AREA':
split = layout.split()
col = split.column()
if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
col.itemR(lamp, "umbra")
col.itemR(lamp, "dither")
col.itemR(lamp, "jitter")
else:
col.itemL()
col = split.column(align=True)
col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
if lamp.shadow_ray_sampling_method == 'ADAPTIVE_QMC':
col.itemR(lamp, "shadow_adaptive_threshold", text="Threshold")
if lamp.shadow_ray_sampling_method == 'CONSTANT_JITTERED':
col = split.column()
col.itemR(lamp, "umbra")
col.itemR(lamp, "dither")
col.itemR(lamp, "jitter")
else:
split.column()
if lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column()
col.itemL(text="Buffer Type:")
col.row().itemR(lamp, "shadow_buffer_type", expand=True)
if lamp.shadow_buffer_type in ('REGULAR', 'HALFWAY'):
split = layout.split()
col = split.column()
col.itemL(text="Filter Type:")
col.itemR(lamp, "shadow_filter_type", text="")
colsub = col.column(align=True)
colsub.itemR(lamp, "shadow_buffer_soft", text="Soft")
colsub.itemR(lamp, "shadow_buffer_bias", text="Bias")
sub = col.column(align=True)
sub.itemR(lamp, "shadow_buffer_soft", text="Soft")
sub.itemR(lamp, "shadow_buffer_bias", text="Bias")
col = split.column()
col.itemL(text="Sample Buffers:")
col.itemR(lamp, "shadow_sample_buffers", text="")
colsub = col.column(align=True)
colsub.itemR(lamp, "shadow_buffer_size", text="Size")
colsub.itemR(lamp, "shadow_buffer_samples", text="Samples")
sub = col.column(align=True)
sub.itemR(lamp, "shadow_buffer_size", text="Size")
sub.itemR(lamp, "shadow_buffer_samples", text="Samples")
if (lamp.shadow_buffer_type == 'IRREGULAR'):
row = layout.row()
row.itemR(lamp, "shadow_buffer_bias", text="Bias")
layout.itemR(lamp, "shadow_buffer_bias", text="Bias")
row = layout.row()
row.itemR(lamp, "auto_clip_start", text="Autoclip Start")
if not (lamp.auto_clip_start):
row.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
sub = row.row()
sub.active = not lamp.auto_clip_start
sub.itemR(lamp, "shadow_buffer_clip_start", text="Clip Start")
row = layout.row()
row.itemR(lamp, "auto_clip_end", text="Autoclip End")
if not (lamp.auto_clip_end):
row.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
sub = row.row()
sub.active = not lamp.auto_clip_end
sub.itemR(lamp, "shadow_buffer_clip_end", text=" Clip End")
class DATA_PT_spot(DataButtonsPanel):
__label__ = "Spot"
@ -267,9 +260,11 @@ class DATA_PT_spot(DataButtonsPanel):
def draw(self, context):
layout = self.layout
lamp = context.lamp
split = layout.split()
col = split.column()
sub = col.column(align=True)
sub.itemR(lamp, "spot_size", text="Size")
@ -278,11 +273,11 @@ class DATA_PT_spot(DataButtonsPanel):
col = split.column()
col.itemR(lamp, "halo")
colsub = col.column(align=True)
colsub.active = lamp.halo
colsub.itemR(lamp, "halo_intensity", text="Intensity")
sub = col.column(align=True)
sub.active = lamp.halo
sub.itemR(lamp, "halo_intensity", text="Intensity")
if lamp.shadow_method == 'BUFFER_SHADOW':
colsub.itemR(lamp, "halo_step", text="Step")
sub.itemR(lamp, "halo_step", text="Step")
class DATA_PT_falloff_curve(DataButtonsPanel):
__label__ = "Falloff Curve"
@ -299,6 +294,7 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
def draw(self, context):
layout = self.layout
lamp = context.lamp
layout.template_curve_mapping(lamp.falloff_curve)
@ -310,4 +306,3 @@ bpy.types.register(DATA_PT_falloff_curve)
bpy.types.register(DATA_PT_spot)
bpy.types.register(DATA_PT_shadow)
bpy.types.register(DATA_PT_sunsky)

@ -28,7 +28,6 @@ class DATA_PT_context_lattice(DataButtonsPanel):
split.template_ID(space, "pin_id")
split.itemS()
class DATA_PT_lattice(DataButtonsPanel):
__label__ = "Lattice"
@ -55,4 +54,3 @@ class DATA_PT_lattice(DataButtonsPanel):
bpy.types.register(DATA_PT_context_lattice)
bpy.types.register(DATA_PT_lattice)

@ -40,9 +40,10 @@ class DATA_PT_normals(DataButtonsPanel):
col = split.column()
col.itemR(mesh, "autosmooth")
colsub = col.column()
colsub.active = mesh.autosmooth
colsub.itemR(mesh, "autosmooth_angle", text="Angle")
sub = col.column()
sub.active = mesh.autosmooth
sub.itemR(mesh, "autosmooth_angle", text="Angle")
sub = split.column()
sub.itemR(mesh, "vertex_normal_flip")
sub.itemR(mesh, "double_sided")
@ -55,10 +56,10 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
row = layout.row()
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index")
col = row.column(align=True)
@ -92,6 +93,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
def draw(self, context):
layout = self.layout
ob = context.object
key = ob.data.shape_keys
kb = ob.active_shape_key
@ -135,8 +137,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row.itemR(key, "relative")
row.itemR(key, "slurph")
row = layout.row()
row.itemR(kb, "name")
layout.itemR(kb, "name")
if context.edit_object:
layout.enabled = False
@ -146,11 +147,12 @@ class DATA_PT_uv_texture(DataButtonsPanel):
def draw(self, context):
layout = self.layout
me = context.mesh
row = layout.row()
col = row.column()
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
col = row.column(align=True)
@ -166,6 +168,7 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
def draw(self, context):
layout = self.layout
me = context.mesh
row = layout.row()