used py error checking tools to fix some bugs & make pep8 corrections

This commit is contained in:
2009-11-14 13:35:44 +00:00
parent aac16ce4ec
commit d33291fcc4
28 changed files with 228 additions and 249 deletions

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -41,7 +42,7 @@ class DATA_PT_context_arm(DataButtonsPanel):
arm = context.armature arm = context.armature
space = context.space_data space = context.space_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if col2: if col2:
split = layout.split(percentage=0.65) split = layout.split(percentage=0.65)
if ob: if ob:
@@ -60,9 +61,7 @@ class DATA_PT_skeleton(DataButtonsPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
ob = context.object
arm = context.armature arm = context.armature
space = context.space_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
layout.itemR(arm, "pose_position", expand=True) layout.itemR(arm, "pose_position", expand=True)
@@ -104,7 +103,7 @@ class DATA_PT_display(DataButtonsPanel):
col.itemR(arm, "draw_names", text="Names") col.itemR(arm, "draw_names", text="Names")
col.itemR(arm, "draw_axes", text="Axes") col.itemR(arm, "draw_axes", text="Axes")
col.itemR(arm, "draw_custom_bone_shapes", text="Shapes") col.itemR(arm, "draw_custom_bone_shapes", text="Shapes")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(arm, "draw_group_colors", text="Colors") col.itemR(arm, "draw_group_colors", text="Colors")
@@ -140,7 +139,7 @@ class DATA_PT_bone_groups(DataButtonsPanel):
split = layout.split() split = layout.split()
split.active = (ob.proxy == None) split.active = (ob.proxy == None)
col = split.column() col = split.column()
col.itemR(group, "color_set") col.itemR(group, "color_set")
if group.color_set: if group.color_set:
@@ -198,7 +197,7 @@ class DATA_PT_paths(DataButtonsPanel):
col = split.column() col = split.column()
col.itemO("pose.paths_calculate", text="Calculate Paths") col.itemO("pose.paths_calculate", text="Calculate Paths")
if col2: if col2:
col = split.column() col = split.column()
col.itemO("pose.paths_clear", text="Clear Paths") col.itemO("pose.paths_clear", text="Clear Paths")

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class BoneButtonsPanel(bpy.types.Panel): class BoneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -55,14 +56,14 @@ class BONE_PT_transform(BoneButtonsPanel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
if col2: if col2:
row = layout.row() row = layout.row()
row.column().itemR(bone, "head") row.column().itemR(bone, "head")
row.column().itemR(bone, "tail") row.column().itemR(bone, "tail")
col = row.column() col = row.column()
sub = col.column(align=True) sub = col.column(align=True)
sub.itemL(text="Roll:") sub.itemL(text="Roll:")
@@ -78,13 +79,13 @@ class BONE_PT_transform(BoneButtonsPanel):
else: else:
pchan = ob.pose.pose_channels[context.bone.name] pchan = ob.pose.pose_channels[context.bone.name]
if col2: if col2:
row = layout.row() row = layout.row()
col = row.column() col = row.column()
col.itemR(pchan, "location") col.itemR(pchan, "location")
col.active = not (bone.parent and bone.connected) col.active = not (bone.parent and bone.connected)
col = row.column() col = row.column()
if pchan.rotation_mode == 'QUATERNION': if pchan.rotation_mode == 'QUATERNION':
col.itemR(pchan, "rotation_quaternion", text="Rotation") col.itemR(pchan, "rotation_quaternion", text="Rotation")
@@ -95,9 +96,9 @@ class BONE_PT_transform(BoneButtonsPanel):
col.itemR(pchan, "rotation_axis_angle", text="Rotation") col.itemR(pchan, "rotation_axis_angle", text="Rotation")
else: else:
col.itemR(pchan, "rotation_euler", text="Rotation") col.itemR(pchan, "rotation_euler", text="Rotation")
row.column().itemR(pchan, "scale") row.column().itemR(pchan, "scale")
layout.itemR(pchan, "rotation_mode") layout.itemR(pchan, "rotation_mode")
else: else:
col = layout.column() col = layout.column()
@@ -201,7 +202,6 @@ class BONE_PT_display(BoneButtonsPanel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
arm = context.armature
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if not bone: if not bone:

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -44,7 +45,7 @@ class DATA_PT_context_camera(DataButtonsPanel):
if col2: if col2:
split = layout.split(percentage=0.65) split = layout.split(percentage=0.65)
if ob: if ob:
split.template_ID(ob, "data") split.template_ID(ob, "data")
split.itemS() split.itemS()
@@ -70,7 +71,7 @@ class DATA_PT_camera(DataButtonsPanel):
layout.itemR(cam, "type", text="") layout.itemR(cam, "type", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
if cam.type == 'PERSP': if cam.type == 'PERSP':
if cam.lens_unit == 'MILLIMETERS': if cam.lens_unit == 'MILLIMETERS':
@@ -82,7 +83,7 @@ class DATA_PT_camera(DataButtonsPanel):
col.itemR(cam, "lens_unit", text="") col.itemR(cam, "lens_unit", text="")
elif cam.type == 'ORTHO': elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale") col.itemR(cam, "ortho_scale")
layout.itemR(cam, "panorama") layout.itemR(cam, "panorama")
@@ -105,7 +106,7 @@ class DATA_PT_camera(DataButtonsPanel):
col = split.column() col = split.column()
col.itemR(cam, "dof_object", text="") col.itemR(cam, "dof_object", text="")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(cam, "dof_distance", text="Distance") col.itemR(cam, "dof_distance", text="Distance")

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -57,7 +58,7 @@ class DATA_PT_context_curve(DataButtonsPanel):
space = context.space_data space = context.space_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if col2: if col2:
split = layout.split(percentage=0.65) split = layout.split(percentage=0.65)
@@ -70,6 +71,7 @@ class DATA_PT_context_curve(DataButtonsPanel):
else: else:
layout.template_ID(ob, "data") layout.template_ID(ob, "data")
class DATA_PT_shape_curve(DataButtonsPanel): class DATA_PT_shape_curve(DataButtonsPanel):
bl_label = "Shape" bl_label = "Shape"
@@ -78,7 +80,6 @@ class DATA_PT_shape_curve(DataButtonsPanel):
ob = context.object ob = context.object
curve = context.curve curve = context.curve
space = context.space_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
is_surf = (ob.type == 'SURFACE') is_surf = (ob.type == 'SURFACE')
@@ -119,7 +120,7 @@ class DATA_PT_shape_curve(DataButtonsPanel):
col = split.column() col = split.column()
col.itemR(curve, "twist_mode", text="Twist") col.itemR(curve, "twist_mode", text="Twist")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(curve, "twist_smooth") # XXX - may not be kept col.itemR(curve, "twist_smooth") # XXX - may not be kept

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -229,7 +230,7 @@ class DATA_PT_shadow(DataButtonsPanel):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
if lamp.shape == 'SQUARE': if lamp.shape == 'SQUARE':
col.itemR(lamp, "shadow_ray_samples_x", text="Samples") col.itemR(lamp, "shadow_ray_samples_x", text="Samples")
elif lamp.shape == 'RECTANGLE': elif lamp.shape == 'RECTANGLE':
@@ -250,7 +251,7 @@ class DATA_PT_shadow(DataButtonsPanel):
else: else:
if col2: if col2:
col = split.column() col = split.column()
elif lamp.shadow_method == 'BUFFER_SHADOW': elif lamp.shadow_method == 'BUFFER_SHADOW':
col = layout.column() col = layout.column()

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class DataButtonsPanel(bpy.types.Panel): class DataButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -184,12 +185,12 @@ class DATA_PT_shape_keys(DataButtonsPanel):
row = split.row() row = split.row()
row.alignment = 'RIGHT' row.alignment = 'RIGHT'
if not col2: if not col2:
layout.itemR(key, "relative") layout.itemR(key, "relative")
row = layout.row() row = layout.row()
sub = row.row(align=True) sub = row.row(align=True)
subsub = sub.row(align=True) subsub = sub.row(align=True)
subsub.active = enable_edit_value subsub.active = enable_edit_value

View File

@@ -56,9 +56,7 @@ class DATA_PT_shape_text(DataButtonsPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
ob = context.object
curve = context.curve curve = context.curve
space = context.space_data
split = layout.split() split = layout.split()

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
def active_node_mat(mat): def active_node_mat(mat):
# TODO, 2.4x has a pipeline section, for 2.5 we need to communicate # TODO, 2.4x has a pipeline section, for 2.5 we need to communicate
# which settings from node-materials are used # which settings from node-materials are used
@@ -93,7 +94,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
if col2: if col2:
split = layout.split(percentage=0.65) split = layout.split(percentage=0.65)
if ob: if ob:
split.template_ID(ob, "active_material", new="material.new") split.template_ID(ob, "active_material", new="material.new")
row = split.row() row = split.row()
@@ -112,7 +113,7 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
layout.itemR(mat, "type", expand=True) layout.itemR(mat, "type", expand=True)
else: else:
layout.itemR(mat, "type", text="") layout.itemR(mat, "type", text="")
class MATERIAL_PT_shading(MaterialButtonsPanel): class MATERIAL_PT_shading(MaterialButtonsPanel):
bl_label = "Shading" bl_label = "Shading"
@@ -210,7 +211,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
phys = context.material.physics # dont use node material phys = context.material.physics # dont use node material
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@@ -344,19 +345,19 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
col.itemR(mat, "darkness") col.itemR(mat, "darkness")
elif mat.diffuse_shader == 'TOON': elif mat.diffuse_shader == 'TOON':
split = col.split() split = col.split()
col = split.column() col = split.column()
col.itemR(mat, "diffuse_toon_size", text="Size") col.itemR(mat, "diffuse_toon_size", text="Size")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(mat, "diffuse_toon_smooth", text="Smooth") col.itemR(mat, "diffuse_toon_smooth", text="Smooth")
elif mat.diffuse_shader == 'FRESNEL': elif mat.diffuse_shader == 'FRESNEL':
split = col.split() split = col.split()
col = split.column() col = split.column()
col.itemR(mat, "diffuse_fresnel", text="Fresnel") col.itemR(mat, "diffuse_fresnel", text="Fresnel")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(mat, "diffuse_fresnel_factor", text="Factor") col.itemR(mat, "diffuse_fresnel_factor", text="Factor")
@@ -365,12 +366,12 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel):
layout.itemS() layout.itemS()
layout.template_color_ramp(mat, "diffuse_ramp", expand=True) layout.template_color_ramp(mat, "diffuse_ramp", expand=True)
layout.itemS() layout.itemS()
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(mat, "diffuse_ramp_input", text="Input") col.itemR(mat, "diffuse_ramp_input", text="Input")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(mat, "diffuse_ramp_blend", text="Blend") col.itemR(mat, "diffuse_ramp_blend", text="Blend")
@@ -411,10 +412,10 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
col.itemR(mat, "specular_hardness", text="Hardness") col.itemR(mat, "specular_hardness", text="Hardness")
elif mat.specular_shader == 'BLINN': elif mat.specular_shader == 'BLINN':
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(mat, "specular_hardness", text="Hardness") col.itemR(mat, "specular_hardness", text="Hardness")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(mat, "specular_ior", text="IOR") col.itemR(mat, "specular_ior", text="IOR")
@@ -422,10 +423,10 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
col.itemR(mat, "specular_slope", text="Slope") col.itemR(mat, "specular_slope", text="Slope")
elif mat.specular_shader == 'TOON': elif mat.specular_shader == 'TOON':
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(mat, "specular_toon_size", text="Size") col.itemR(mat, "specular_toon_size", text="Size")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(mat, "specular_toon_smooth", text="Smooth") col.itemR(mat, "specular_toon_smooth", text="Smooth")
@@ -435,14 +436,14 @@ class MATERIAL_PT_specular(MaterialButtonsPanel):
layout.template_color_ramp(mat, "specular_ramp", expand=True) layout.template_color_ramp(mat, "specular_ramp", expand=True)
layout.itemS() layout.itemS()
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(mat, "specular_ramp_input", text="Input") col.itemR(mat, "specular_ramp_input", text="Input")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(mat, "specular_ramp_blend", text="Blend") col.itemR(mat, "specular_ramp_blend", text="Blend")
row = layout.row() row = layout.row()
row.itemR(mat, "specular_ramp_factor", text="Factor") row.itemR(mat, "specular_ramp_factor", text="Factor")
@@ -746,7 +747,7 @@ class MATERIAL_PT_volume_density(VolumeButtonsPanel):
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(vol, "density") col.itemR(vol, "density")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(vol, "density_scale") col.itemR(vol, "density_scale")

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class ObjectButtonsPanel(bpy.types.Panel): class ObjectButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -52,7 +53,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
if col2: if col2:
row = layout.row() row = layout.row()
row.column().itemR(ob, "location") row.column().itemR(ob, "location")
if ob.rotation_mode == 'QUATERNION': if ob.rotation_mode == 'QUATERNION':
row.column().itemR(ob, "rotation_quaternion", text="Rotation") row.column().itemR(ob, "rotation_quaternion", text="Rotation")
@@ -63,9 +64,9 @@ class OBJECT_PT_transform(ObjectButtonsPanel):
row.column().itemR(ob, "rotation_axis_angle", text="Rotation") row.column().itemR(ob, "rotation_axis_angle", text="Rotation")
else: else:
row.column().itemR(ob, "rotation_euler", text="Rotation") row.column().itemR(ob, "rotation_euler", text="Rotation")
row.column().itemR(ob, "scale") row.column().itemR(ob, "scale")
layout.itemR(ob, "rotation_mode") layout.itemR(ob, "rotation_mode")
else: else:
col = layout.column() col = layout.column()
@@ -89,7 +90,7 @@ class OBJECT_PT_transform_locks(ObjectButtonsPanel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
col2 = context.region.width > narrowui # col2 = context.region.width > narrowui
row = layout.row() row = layout.row()
@@ -145,7 +146,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
ob = context.object ob = context.object
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if col2: if col2:
split = layout.split() split = layout.split()
split.item_menu_enumO("object.group_add", "group", text="Add to Group") split.item_menu_enumO("object.group_add", "group", text="Add to Group")
@@ -164,10 +165,10 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
row.itemO("object.group_remove", text="", icon='VICON_X') row.itemO("object.group_remove", text="", icon='VICON_X')
split = col.box().split() split = col.box().split()
col = split.column() col = split.column()
col.itemR(group, "layer", text="Dupli") col.itemR(group, "layer", text="Dupli")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(group, "dupli_offset", text="") col.itemR(group, "dupli_offset", text="")
@@ -181,11 +182,11 @@ class OBJECT_PT_display(ObjectButtonsPanel):
ob = context.object ob = context.object
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(ob, "max_draw_type", text="Type") col.itemR(ob, "max_draw_type", text="Type")
if col2: if col2:
col = split.column() col = split.column()
row = col.row() row = col.row()
@@ -195,12 +196,12 @@ class OBJECT_PT_display(ObjectButtonsPanel):
sub.itemR(ob, "draw_bounds_type", text="") sub.itemR(ob, "draw_bounds_type", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(ob, "draw_name", text="Name") col.itemR(ob, "draw_name", text="Name")
col.itemR(ob, "draw_axis", text="Axis") col.itemR(ob, "draw_axis", text="Axis")
col.itemR(ob, "draw_wire", text="Wire") col.itemR(ob, "draw_wire", text="Wire")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(ob, "draw_texture_space", text="Texture Space") col.itemR(ob, "draw_texture_space", text="Texture Space")
@@ -216,12 +217,12 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
ob = context.object ob = context.object
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if col2: if col2:
layout.itemR(ob, "dupli_type", expand=True) layout.itemR(ob, "dupli_type", expand=True)
else: else:
layout.itemR(ob, "dupli_type", text="") layout.itemR(ob, "dupli_type", text="")
if ob.dupli_type == 'FRAMES': if ob.dupli_type == 'FRAMES':
split = layout.split() split = layout.split()
@@ -244,7 +245,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel):
col = split.column() col = split.column()
col.itemR(ob, "dupli_faces_scale", text="Scale") col.itemR(ob, "dupli_faces_scale", text="Scale")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale") col.itemR(ob, "dupli_faces_inherit_scale", text="Inherit Scale")
@@ -264,7 +265,7 @@ class OBJECT_PT_animation(ObjectButtonsPanel):
ob = context.object ob = context.object
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()

View File

@@ -208,7 +208,7 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
layout = self.layout layout = self.layout
psys = context.particle_system psys = context.particle_system
part = psys.settings #part = psys.settings
cloth = psys.cloth.settings cloth = psys.cloth.settings
layout.enabled = psys.hair_dynamics layout.enabled = psys.hair_dynamics
@@ -250,7 +250,6 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics) return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
def draw(self, context): def draw(self, context):
layout = self.layout
psys = context.particle_system psys = context.particle_system
@@ -932,7 +931,7 @@ class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
ob = context.object ob = context.object
psys = context.particle_system psys = context.particle_system
part = psys.settings # part = psys.settings
# layout.itemL(text="Nothing here yet.") # layout.itemL(text="Nothing here yet.")

View File

@@ -17,7 +17,6 @@
# ##### END GPL LICENSE BLOCK ##### # ##### END GPL LICENSE BLOCK #####
# <pep8 compliant> # <pep8 compliant>
import bpy
def point_cache_ui(self, cache, enabled, particles, smoke): def point_cache_ui(self, cache, enabled, particles, smoke):
@@ -88,29 +87,29 @@ def point_cache_ui(self, cache, enabled, particles, smoke):
def effector_weights_ui(self, weights): def effector_weights_ui(self, weights):
layout = self.layout layout = self.layout
layout.itemR(weights, "group") layout.itemR(weights, "group")
split = layout.split() split = layout.split()
split.itemR(weights, "gravity", slider=True) split.itemR(weights, "gravity", slider=True)
split.itemR(weights, "all", slider=True) split.itemR(weights, "all", slider=True)
layout.itemS() layout.itemS()
flow = layout.column_flow() flow = layout.column_flow()
flow.itemR(weights, "force", slider=True) flow.itemR(weights, "force", slider=True)
flow.itemR(weights, "vortex", slider=True) flow.itemR(weights, "vortex", slider=True)
flow.itemR(weights, "magnetic", slider=True) flow.itemR(weights, "magnetic", slider=True)
flow.itemR(weights, "wind", slider=True) flow.itemR(weights, "wind", slider=True)
flow.itemR(weights, "curveguide", slider=True) flow.itemR(weights, "curveguide", slider=True)
flow.itemR(weights, "texture", slider=True) flow.itemR(weights, "texture", slider=True)
flow.itemR(weights, "harmonic", slider=True) flow.itemR(weights, "harmonic", slider=True)
flow.itemR(weights, "charge", slider=True) flow.itemR(weights, "charge", slider=True)
flow.itemR(weights, "lennardjones", slider=True) flow.itemR(weights, "lennardjones", slider=True)
flow.itemR(weights, "turbulence", slider=True) flow.itemR(weights, "turbulence", slider=True)
flow.itemR(weights, "drag", slider=True) flow.itemR(weights, "drag", slider=True)
flow.itemR(weights, "boid", slider=True) flow.itemR(weights, "boid", slider=True)
def basic_force_field_settings_ui(self, field): def basic_force_field_settings_ui(self, field):

View File

@@ -38,7 +38,6 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel):
layout = self.layout layout = self.layout
md = context.fluid md = context.fluid
ob = context.object
split = layout.split() split = layout.split()
split.operator_context = 'EXEC_DEFAULT' split.operator_context = 'EXEC_DEFAULT'

View File

@@ -143,8 +143,6 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
return md and (md.smoke_type == 'TYPE_DOMAIN') return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context): def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings md = context.smoke.domain_settings
cache = md.point_cache_low cache = md.point_cache_low
@@ -191,8 +189,6 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres
def draw(self, context): def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings md = context.smoke.domain_settings
cache = md.point_cache_high cache = md.point_cache_high

View File

@@ -204,7 +204,6 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings
ob = context.object
layout.active = softbody.self_collision and softbody_panel_enabled(md) layout.active = softbody.self_collision and softbody_panel_enabled(md)
@@ -230,7 +229,6 @@ class PHYSICS_PT_softbody_solver(PhysicButtonsPanel):
md = context.soft_body md = context.soft_body
softbody = md.settings softbody = md.settings
ob = context.object
layout.active = softbody_panel_enabled(md) layout.active = softbody_panel_enabled(md)

View File

@@ -21,19 +21,17 @@ import bpy
narrowui = 180 narrowui = 180
class RenderButtonsPanel(bpy.types.Panel): class RenderButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
bl_context = "render" bl_context = "render"
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here # COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
def poll(self, context): def poll(self, context):
rd = context.scene.render_data rd = context.scene.render_data
return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES) return (context.scene and rd.use_game_engine == False) and (rd.engine in self.COMPAT_ENGINES)
class RENDER_PT_render(RenderButtonsPanel): class RENDER_PT_render(RenderButtonsPanel):
bl_label = "Render" bl_label = "Render"
@@ -44,12 +42,12 @@ class RENDER_PT_render(RenderButtonsPanel):
rd = context.scene.render_data rd = context.scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL') col.itemO("screen.render", text="Image", icon='ICON_RENDER_STILL')
if col2: if col2:
col = split.column() col = split.column()
col.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION') col.item_booleanO("screen.render", "animation", True, text="Animation", icon='ICON_RENDER_ANIMATION')
@@ -68,7 +66,7 @@ class RENDER_PT_layers(RenderButtonsPanel):
scene = context.scene scene = context.scene
rd = scene.render_data rd = scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
row = layout.row() row = layout.row()
row.template_list(rd, "layers", rd, "active_layer_index", rows=2) row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
@@ -164,7 +162,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
rd = context.scene.render_data rd = context.scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@@ -172,7 +170,7 @@ class RENDER_PT_shading(RenderButtonsPanel):
col.itemR(rd, "render_shadows", text="Shadows") col.itemR(rd, "render_shadows", text="Shadows")
col.itemR(rd, "render_sss", text="Subsurface Scattering") col.itemR(rd, "render_sss", text="Subsurface Scattering")
col.itemR(rd, "render_envmaps", text="Environment Map") col.itemR(rd, "render_envmaps", text="Environment Map")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(rd, "render_raytracing", text="Ray Tracing") col.itemR(rd, "render_raytracing", text="Ray Tracing")
@@ -190,7 +188,7 @@ class RENDER_PT_performance(RenderButtonsPanel):
rd = context.scene.render_data rd = context.scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column(align=True) col = split.column(align=True)
@@ -230,10 +228,10 @@ class RENDER_PT_post_processing(RenderButtonsPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
rd = context.scene.render_data rd = context.scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@@ -273,10 +271,10 @@ class RENDER_PT_output(RenderButtonsPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
rd = context.scene.render_data rd = context.scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
layout.itemR(rd, "output_path", text="") layout.itemR(rd, "output_path", text="")
split = layout.split() split = layout.split()
@@ -300,13 +298,13 @@ class RENDER_PT_output(RenderButtonsPanel):
col = split.column() col = split.column()
col.itemL(text="Codec:") col.itemL(text="Codec:")
col.itemR(rd, "exr_codec", text="") col.itemR(rd, "exr_codec", text="")
if col2: if col2:
subsplit = split.split() subsplit = split.split()
col = subsplit.column() col = subsplit.column()
col.itemR(rd, "exr_half") col.itemR(rd, "exr_half")
col.itemR(rd, "exr_zbuf") col.itemR(rd, "exr_zbuf")
if col2: if col2:
col = subsplit.column() col = subsplit.column()
col.itemR(rd, "exr_preview") col.itemR(rd, "exr_preview")
@@ -389,7 +387,7 @@ class RENDER_PT_encoding(RenderButtonsPanel):
col = split.column() col = split.column()
col.itemR(rd, "ffmpeg_audio_bitrate") col.itemR(rd, "ffmpeg_audio_bitrate")
col.itemR(rd, "ffmpeg_audio_mixrate") col.itemR(rd, "ffmpeg_audio_mixrate")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(rd, "ffmpeg_multiplex_audio") col.itemR(rd, "ffmpeg_multiplex_audio")
@@ -411,7 +409,7 @@ class RENDER_PT_antialiasing(RenderButtonsPanel):
rd = context.scene.render_data rd = context.scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
layout.active = rd.antialiasing layout.active = rd.antialiasing
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@@ -434,7 +432,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
scene = context.scene scene = context.scene
rd = scene.render_data rd = scene.render_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
@@ -461,7 +459,7 @@ class RENDER_PT_dimensions(RenderButtonsPanel):
sub.itemR(scene, "start_frame", text="Start") sub.itemR(scene, "start_frame", text="Start")
sub.itemR(scene, "end_frame", text="End") sub.itemR(scene, "end_frame", text="End")
sub.itemR(scene, "frame_step", text="Step") sub.itemR(scene, "frame_step", text="Step")
sub = col.column(align=True) sub = col.column(align=True)
sub.itemL(text="Frame Rate:") sub.itemL(text="Frame Rate:")
sub.itemR(rd, "fps") sub.itemR(rd, "fps")

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class SceneButtonsPanel(bpy.types.Panel): class SceneButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -38,7 +39,7 @@ class SCENE_PT_scene(SceneButtonsPanel):
layout = self.layout layout = self.layout
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
scene = context.scene scene = context.scene
if col2: if col2:
layout.itemR(scene, "camera") layout.itemR(scene, "camera")
layout.itemR(scene, "set", text="Background") layout.itemR(scene, "set", text="Background")
@@ -61,10 +62,10 @@ class SCENE_PT_unit(SceneButtonsPanel):
split = layout.split() split = layout.split()
split.active = (unit.system != 'NONE') split.active = (unit.system != 'NONE')
col = split.column() col = split.column()
col.itemR(unit, "scale_length", text="Scale") col.itemR(unit, "scale_length", text="Scale")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(unit, "use_separate") col.itemR(unit, "use_separate")
@@ -163,9 +164,9 @@ class SCENE_PT_physics(SceneButtonsPanel):
scene = context.scene scene = context.scene
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
layout.active = scene.use_gravity layout.active = scene.use_gravity
if col2: if col2:
layout.itemR(scene, "gravity", text="") layout.itemR(scene, "gravity", text="")
else: else:

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
def active_node_mat(mat): def active_node_mat(mat):
if mat: if mat:
mat_node = mat.active_node_material mat_node = mat.active_node_material
@@ -33,22 +34,21 @@ def active_node_mat(mat):
def context_tex_datablock(context): def context_tex_datablock(context):
idblock = active_node_mat(context.material)
idblock = active_node_mat(context.material) if idblock:
if idblock:
return idblock
idblock = context.lamp
if idblock:
return idblock
idblock = context.world
if idblock:
return idblock
idblock = context.brush
return idblock return idblock
idblock = context.lamp
if idblock:
return idblock
idblock = context.world
if idblock:
return idblock
idblock = context.brush
return idblock
class TextureButtonsPanel(bpy.types.Panel): class TextureButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
@@ -103,8 +103,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN') col.item_enumO("texture.slot_move", "type", 'DOWN', text="", icon='ICON_TRIA_DOWN')
if col2: if col2:
split = layout.split(percentage=0.65) split = layout.split(percentage=0.65)
if idblock: if idblock:
@@ -190,7 +188,7 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
idblock = context_tex_datablock(context) idblock = context_tex_datablock(context)
tex = context.texture_slot tex = context.texture_slot
textype = context.texture # textype = context.texture
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if type(idblock) != bpy.types.Brush: if type(idblock) != bpy.types.Brush:
@@ -257,12 +255,12 @@ class TEXTURE_PT_mapping(TextureSlotPanel):
# any non brush # any non brush
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(tex, "offset") col.itemR(tex, "offset")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "size") col.itemR(tex, "size")
@@ -278,7 +276,7 @@ class TEXTURE_PT_influence(TextureSlotPanel):
idblock = context_tex_datablock(context) idblock = context_tex_datablock(context)
textype = context.texture # textype = context.texture
tex = context.texture_slot tex = context.texture_slot
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
@@ -342,7 +340,7 @@ class TEXTURE_PT_influence(TextureSlotPanel):
col = split.column() col = split.column()
factor_but(col, tex.map_color, "map_color", "color_factor", "Color") factor_but(col, tex.map_color, "map_color", "color_factor", "Color")
if col2: if col2:
col = split.column() col = split.column()
factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow") factor_but(col, tex.map_shadow, "map_shadow", "shadow_factor", "Shadow")
@@ -411,7 +409,7 @@ class TEXTURE_PT_clouds(TextureTypePanel):
col = split.column() col = split.column()
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
col.itemR(tex, "noise_depth", text="Depth") col.itemR(tex, "noise_depth", text="Depth")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "nabla", text="Nabla") col.itemR(tex, "nabla", text="Nabla")
@@ -444,11 +442,11 @@ class TEXTURE_PT_wood(TextureTypePanel):
split = layout.split() split = layout.split()
split.active = tex.stype in ('RINGNOISE', 'BANDNOISE') split.active = tex.stype in ('RINGNOISE', 'BANDNOISE')
col = split.column() col = split.column()
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
col.itemR(tex, "turbulence") col.itemR(tex, "turbulence")
col = split.column() col = split.column()
col.itemR(tex, "nabla") col.itemR(tex, "nabla")
@@ -473,11 +471,11 @@ class TEXTURE_PT_marble(TextureTypePanel):
layout.itemR(tex, "noise_basis", text="") layout.itemR(tex, "noise_basis", text="")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
col.itemR(tex, "noise_depth", text="Depth") col.itemR(tex, "noise_depth", text="Depth")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "turbulence") col.itemR(tex, "turbulence")
@@ -495,10 +493,10 @@ class TEXTURE_PT_magic(TextureTypePanel):
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(tex, "noise_depth", text="Depth") col.itemR(tex, "noise_depth", text="Depth")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "turbulence") col.itemR(tex, "turbulence")
@@ -518,7 +516,7 @@ class TEXTURE_PT_blend(TextureTypePanel):
layout.itemR(tex, "progression") layout.itemR(tex, "progression")
else: else:
layout.itemR(tex, "progression", text="") layout.itemR(tex, "progression", text="")
sub = layout.row() sub = layout.row()
sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL')) sub.active = (tex.progression in ('LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'))
@@ -547,7 +545,7 @@ class TEXTURE_PT_stucci(TextureTypePanel):
col = split.column() col = split.column()
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "turbulence") col.itemR(tex, "turbulence")
@@ -574,7 +572,7 @@ class TEXTURE_PT_image_sampling(TextureTypePanel):
layout = self.layout layout = self.layout
tex = context.texture tex = context.texture
slot = context.texture_slot # slot = context.texture_slot
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
split = layout.split() split = layout.split()
@@ -650,11 +648,11 @@ class TEXTURE_PT_image_mapping(TextureTypePanel):
row = col.row() row = col.row()
row.itemR(tex, "checker_even", text="Even") row.itemR(tex, "checker_even", text="Even")
row.itemR(tex, "checker_odd", text="Odd") row.itemR(tex, "checker_odd", text="Odd")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "checker_distance", text="Distance") col.itemR(tex, "checker_distance", text="Distance")
layout.itemS() layout.itemS()
split = layout.split() split = layout.split()
@@ -679,7 +677,7 @@ class TEXTURE_PT_plugin(TextureTypePanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
tex = context.texture # tex = context.texture
layout.itemL(text="Nothing yet") layout.itemL(text="Nothing yet")
@@ -691,7 +689,7 @@ class TEXTURE_PT_envmap(TextureTypePanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
tex = context.texture # tex = context.texture
layout.itemL(text="Nothing yet") layout.itemL(text="Nothing yet")
@@ -737,7 +735,7 @@ class TEXTURE_PT_musgrave(TextureTypePanel):
col = split.column() col = split.column()
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "nabla") col.itemR(tex, "nabla")
@@ -780,7 +778,7 @@ class TEXTURE_PT_voronoi(TextureTypePanel):
col = split.column() col = split.column()
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "nabla") col.itemR(tex, "nabla")
@@ -808,7 +806,7 @@ class TEXTURE_PT_distortednoise(TextureTypePanel):
col = split.column() col = split.column()
col.itemR(tex, "distortion", text="Distortion") col.itemR(tex, "distortion", text="Distortion")
col.itemR(tex, "noise_size", text="Size") col.itemR(tex, "noise_size", text="Size")
if col2: if col2:
col = split.column() col = split.column()
col.itemR(tex, "nabla") col.itemR(tex, "nabla")
@@ -915,7 +913,7 @@ class TEXTURE_PT_pointdensity_turbulence(TextureButtonsPanel):
tex = context.texture tex = context.texture
pd = tex.pointdensity pd = tex.pointdensity
layout.itemR(pd, "turbulence", text="") layout.itemR(pd, "turbulence", text="")
def draw(self, context): def draw(self, context):

View File

@@ -21,6 +21,7 @@ import bpy
narrowui = 180 narrowui = 180
class WorldButtonsPanel(bpy.types.Panel): class WorldButtonsPanel(bpy.types.Panel):
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
@@ -57,7 +58,7 @@ class WORLD_PT_context_world(WorldButtonsPanel):
space = context.space_data space = context.space_data
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
if col2: if col2:
split = layout.split(percentage=0.65) split = layout.split(percentage=0.65)
if scene: if scene:
@@ -67,6 +68,7 @@ class WORLD_PT_context_world(WorldButtonsPanel):
else: else:
layout.template_ID(scene, "world", new="world.new") layout.template_ID(scene, "world", new="world.new")
class WORLD_PT_world(WorldButtonsPanel): class WORLD_PT_world(WorldButtonsPanel):
bl_label = "World" bl_label = "World"
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -75,7 +77,7 @@ class WORLD_PT_world(WorldButtonsPanel):
layout = self.layout layout = self.layout
col2 = context.region.width > narrowui col2 = context.region.width > narrowui
world = context.world world = context.world
if col2: if col2:
row = layout.row() row = layout.row()
row.itemR(world, "paper_sky") row.itemR(world, "paper_sky")
@@ -110,9 +112,9 @@ class WORLD_PT_mist(WorldButtonsPanel):
world = context.world world = context.world
layout.active = world.mist.enabled layout.active = world.mist.enabled
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(world.mist, "intensity", slider=True) col.itemR(world.mist, "intensity", slider=True)
col.itemR(world.mist, "start") col.itemR(world.mist, "start")
@@ -142,7 +144,7 @@ class WORLD_PT_stars(WorldButtonsPanel):
layout.active = world.stars.enabled layout.active = world.stars.enabled
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemR(world.stars, "size") col.itemR(world.stars, "size")
col.itemR(world.stars, "color_randomization", text="Colors") col.itemR(world.stars, "color_randomization", text="Colors")

View File

@@ -17,7 +17,6 @@
# ##### END GPL LICENSE BLOCK ##### # ##### END GPL LICENSE BLOCK #####
# <pep8 compliant> # <pep8 compliant>
import sys
import bpy import bpy
from bpy.props import * from bpy.props import *
@@ -83,6 +82,7 @@ class CONSOLE_MT_report(bpy.types.Menu):
layout.itemO("console.report_delete") layout.itemO("console.report_delete")
layout.itemO("console.report_copy") layout.itemO("console.report_copy")
class CONSOLE_MT_language(bpy.types.Menu): class CONSOLE_MT_language(bpy.types.Menu):
bl_label = "Languages..." bl_label = "Languages..."
@@ -102,6 +102,7 @@ class CONSOLE_MT_language(bpy.types.Menu):
for language in languages: for language in languages:
layout.item_stringO("console.language", "language", language, text=language[0].upper() + language[1:]) layout.item_stringO("console.language", "language", language, text=language[0].upper() + language[1:])
def add_scrollback(text, text_type): def add_scrollback(text, text_type):
for l in text.split('\n'): for l in text.split('\n'):
bpy.ops.console.scrollback_append(text=l.replace('\t', ' '), bpy.ops.console.scrollback_append(text=l.replace('\t', ' '),
@@ -170,11 +171,10 @@ class ConsoleBanner(bpy.types.Operator):
return ('FINISHED',) return ('FINISHED',)
class ConsoleLanguage(bpy.types.Operator): class ConsoleLanguage(bpy.types.Operator):
'''Set the current language for this console''' '''Set the current language for this console'''
bl_idname = "console.language" bl_idname = "console.language"
language = StringProperty(name="Language", maxlen= 32, default= "") language = StringProperty(name="Language", maxlen=32, default="")
def execute(self, context): def execute(self, context):
sc = context.space_data sc = context.space_data

View File

@@ -27,7 +27,7 @@ class IMAGE_MT_view(bpy.types.Menu):
layout = self.layout layout = self.layout
sima = context.space_data sima = context.space_data
uv = sima.uv_editor # uv = sima.uv_editor
settings = context.tool_settings settings = context.tool_settings
show_uvedit = sima.show_uvedit show_uvedit = sima.show_uvedit
@@ -227,8 +227,8 @@ class IMAGE_HT_header(bpy.types.Header):
iuser = sima.image_user iuser = sima.image_user
settings = context.tool_settings settings = context.tool_settings
show_render = sima.show_render # show_render = sima.show_render
show_paint = sima.show_paint # show_paint = sima.show_paint
show_uvedit = sima.show_uvedit show_uvedit = sima.show_uvedit
row = layout.row(align=True) row = layout.row(align=True)
@@ -264,17 +264,14 @@ class IMAGE_HT_header(bpy.types.Header):
else: else:
layout.itemR(settings, "uv_selection_mode", text="", expand=True) layout.itemR(settings, "uv_selection_mode", text="", expand=True)
layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True) layout.itemR(uvedit, "sticky_selection_mode", text="", icon_only=True)
pass
row = layout.row(align=True) row = layout.row(align=True)
row.itemR(settings, "snap", text="") row.itemR(settings, "snap", text="")
if settings.snap: if settings.snap:
row.itemR(settings, "snap_mode", text="") row.itemR(settings, "snap_mode", text="")
""" # mesh = context.edit_object.data
mesh = context.edit_object.data # row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
row.item_pointerR(mesh, "active_uv_layer", mesh, "uv_textures")
"""
if ima: if ima:
# layers # layers
@@ -310,7 +307,7 @@ class IMAGE_PT_image_properties(bpy.types.Panel):
layout = self.layout layout = self.layout
sima = context.space_data sima = context.space_data
ima = sima.image # ima = sima.image
iuser = sima.image_user iuser = sima.image_user
layout.template_image(sima, "image", iuser, compact=True) layout.template_image(sima, "image", iuser, compact=True)

View File

@@ -29,7 +29,6 @@ class INFO_HT_header(bpy.types.Header):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
st = context.space_data
scene = context.scene scene = context.scene
rd = scene.render_data rd = scene.render_data
@@ -237,7 +236,7 @@ class INFO_MT_render(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
rd = context.scene.render_data # rd = context.scene.render_data
layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL') layout.itemO("screen.render", text="Render Image", icon='ICON_RENDER_STILL')
layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION') layout.item_booleanO("screen.render", "animation", True, text="Render Animation", icon='ICON_RENDER_ANIMATION')
@@ -377,3 +376,4 @@ bpy.ops.add(HELP_OT_developer_community)
bpy.ops.add(HELP_OT_user_community) bpy.ops.add(HELP_OT_user_community)
bpy.ops.add(HELP_OT_report_bug) bpy.ops.add(HELP_OT_report_bug)
bpy.ops.add(HELP_OT_operator_cheat_sheet) bpy.ops.add(HELP_OT_operator_cheat_sheet)

View File

@@ -43,27 +43,27 @@ class NODE_HT_header(bpy.types.Header):
if snode.tree_type == 'MATERIAL': if snode.tree_type == 'MATERIAL':
ob = snode.id_from ob = snode.id_from
id = snode.id snode_id = snode.id
if ob: if ob:
layout.template_ID(ob, "active_material", new="material.new") layout.template_ID(ob, "active_material", new="material.new")
if id: if snode_id:
layout.itemR(id, "use_nodes") layout.itemR(snode_id, "use_nodes")
elif snode.tree_type == 'TEXTURE': elif snode.tree_type == 'TEXTURE':
row.itemR(snode, "texture_type", text="", expand=True) row.itemR(snode, "texture_type", text="", expand=True)
id = snode.id snode_id = snode.id
id_from = snode.id_from id_from = snode.id_from
if id_from: if id_from:
layout.template_ID(id_from, "active_texture", new="texture.new") layout.template_ID(id_from, "active_texture", new="texture.new")
if id: if snode_id:
layout.itemR(id, "use_nodes") layout.itemR(snode_id, "use_nodes")
elif snode.tree_type == 'COMPOSITING': elif snode.tree_type == 'COMPOSITING':
id = snode.id snode_id = snode.id
layout.itemR(id, "use_nodes") layout.itemR(snode_id, "use_nodes")
layout.itemR(id.render_data, "free_unused_nodes", text="Free Unused") layout.itemR(snode_id.render_data, "free_unused_nodes", text="Free Unused")
layout.itemR(snode, "backdrop") layout.itemR(snode, "backdrop")
@@ -72,7 +72,7 @@ class NODE_MT_view(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.itemO("node.properties", icon='ICON_MENU_PANEL') layout.itemO("node.properties", icon='ICON_MENU_PANEL')
layout.itemS() layout.itemS()

View File

@@ -133,8 +133,6 @@ class SEQUENCER_MT_select(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
st = context.space_data
layout.column() layout.column()
layout.item_enumO("sequencer.select_active_side", "side", 'LEFT', text="Strips to the Left") layout.item_enumO("sequencer.select_active_side", "side", 'LEFT', text="Strips to the Left")
layout.item_enumO("sequencer.select_active_side", "side", 'RIGHT', text="Strips to the Right") layout.item_enumO("sequencer.select_active_side", "side", 'RIGHT', text="Strips to the Right")
@@ -154,8 +152,6 @@ class SEQUENCER_MT_marker(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
st = context.space_data
layout.column() layout.column()
layout.itemO("marker.add", text="Add Marker") layout.itemO("marker.add", text="Add Marker")
layout.itemO("marker.duplicate", text="Duplicate Marker") layout.itemO("marker.duplicate", text="Duplicate Marker")
@@ -174,8 +170,6 @@ class SEQUENCER_MT_add(bpy.types.Menu):
layout = self.layout layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
st = context.space_data
layout.column() layout.column()
layout.itemO("sequencer.scene_strip_add", text="Scene") layout.itemO("sequencer.scene_strip_add", text="Scene")
layout.itemO("sequencer.movie_strip_add", text="Movie") layout.itemO("sequencer.movie_strip_add", text="Movie")
@@ -191,7 +185,6 @@ class SEQUENCER_MT_add_effect(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
st = context.space_data
layout.column() layout.column()
layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD') layout.item_enumO("sequencer.effect_strip_add", 'type', 'ADD')
@@ -215,8 +208,6 @@ class SEQUENCER_MT_strip(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
st = context.space_data
layout.operator_context = 'INVOKE_REGION_WIN' layout.operator_context = 'INVOKE_REGION_WIN'
layout.column() layout.column()

View File

@@ -26,7 +26,6 @@ class TIME_HT_header(bpy.types.Header):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
st = context.space_data
scene = context.scene scene = context.scene
tools = context.tool_settings tools = context.tool_settings
screen = context.screen screen = context.screen
@@ -103,7 +102,7 @@ class TIME_MT_frame(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
tools = context.tool_settings # tools = context.tool_settings
layout.itemO("marker.add", text="Add Marker") layout.itemO("marker.add", text="Add Marker")
layout.itemO("marker.duplicate", text="Duplicate Marker") layout.itemO("marker.duplicate", text="Duplicate Marker")

View File

@@ -41,7 +41,7 @@ class USERPREF_MT_view(bpy.types.Menu):
bl_label = "View" bl_label = "View"
def draw(self, context): def draw(self, context):
layout = self.layout pass # layout = self.layout
class USERPREF_PT_tabs(bpy.types.Panel): class USERPREF_PT_tabs(bpy.types.Panel):
@@ -383,7 +383,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col.itemR(v3d, "editmesh_active", slider=True) col.itemR(v3d, "editmesh_active", slider=True)
col = split.column() col = split.column()
col.itemR(v3d, "object_selected") col.itemR(v3d, "object_selected")
col.itemR(v3d, "object_active") col.itemR(v3d, "object_active")
col.itemR(v3d, "object_grouped") col.itemR(v3d, "object_grouped")
@@ -736,45 +736,45 @@ class USERPREF_PT_theme(bpy.types.Panel):
col.itemR(graph, "button") col.itemR(graph, "button")
col.itemR(graph, "button_title") col.itemR(graph, "button_title")
col.itemR(graph, "button_text") col.itemR(graph, "button_text")
col = split.column() col = split.column()
col.itemR(graph, "header") col.itemR(graph, "header")
col.itemR(graph, "grid") col.itemR(graph, "grid")
col.itemR(graph, "list") col.itemR(graph, "list")
col.itemR(graph, "channel_group") col.itemR(graph, "channel_group")
col = split.column() col = split.column()
col.itemR(graph, "active_channels_group") col.itemR(graph, "active_channels_group")
col.itemR(graph, "dopesheet_channel") col.itemR(graph, "dopesheet_channel")
col.itemR(graph, "dopesheet_subchannel") col.itemR(graph, "dopesheet_subchannel")
col.itemR(graph, "vertex") col.itemR(graph, "vertex")
col = split.column() col = split.column()
col.itemR(graph, "current_frame") col.itemR(graph, "current_frame")
col.itemR(graph, "handle_vertex") col.itemR(graph, "handle_vertex")
col.itemR(graph, "handle_vertex_select") col.itemR(graph, "handle_vertex_select")
col.itemS() col.itemS()
col.itemR(graph, "handle_vertex_size") col.itemR(graph, "handle_vertex_size")
elif theme.active_theme == 'FILE_BROWSER': elif theme.active_theme == 'FILE_BROWSER':
file = theme.file_browser file_browse = theme.file_browser
col = split.column() col = split.column()
col.itemR(file, "back") col.itemR(file_browse, "back")
col.itemR(file, "text") col.itemR(file_browse, "text")
col.itemR(file, "text_hi") col.itemR(file_browse, "text_hi")
col = split.column() col = split.column()
col.itemR(file, "header") col.itemR(file_browse, "header")
col.itemR(file, "list") col.itemR(file_browse, "list")
col = split.column() col = split.column()
col.itemR(file, "selected_file") col.itemR(file_browse, "selected_file")
col.itemR(file, "tiles") col.itemR(file_browse, "tiles")
col = split.column() col = split.column()
col.itemR(file, "active_file") col.itemR(file_browse, "active_file")
col.itemR(file, "active_file_text") col.itemR(file_browse, "active_file_text")
elif theme.active_theme == 'NLA_EDITOR': elif theme.active_theme == 'NLA_EDITOR':
nla = theme.nla_editor nla = theme.nla_editor
@@ -783,17 +783,17 @@ class USERPREF_PT_theme(bpy.types.Panel):
col.itemR(nla, "back") col.itemR(nla, "back")
col.itemR(nla, "button") col.itemR(nla, "button")
col.itemR(nla, "button_title") col.itemR(nla, "button_title")
col = split.column() col = split.column()
col.itemR(nla, "button_text") col.itemR(nla, "button_text")
col.itemR(nla, "text") col.itemR(nla, "text")
col.itemR(nla, "header") col.itemR(nla, "header")
col = split.column() col = split.column()
col.itemR(nla, "grid") col.itemR(nla, "grid")
col.itemR(nla, "bars") col.itemR(nla, "bars")
col.itemR(nla, "bars_selected") col.itemR(nla, "bars_selected")
col = split.column() col = split.column()
col.itemR(nla, "strips") col.itemR(nla, "strips")
col.itemR(nla, "strips_selected") col.itemR(nla, "strips_selected")
@@ -830,7 +830,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col = split.column() col = split.column()
col.itemR(image, "back") col.itemR(image, "back")
col.itemR(image, "button") col.itemR(image, "button")
col = split.column() col = split.column()
col.itemR(image, "button_title") col.itemR(image, "button_title")
col.itemR(image, "button_text") col.itemR(image, "button_text")
@@ -875,7 +875,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col = split.column() col = split.column()
col.itemR(prop, "back") col.itemR(prop, "back")
col = split.column() col = split.column()
col.itemR(prop, "title") col.itemR(prop, "title")
@@ -893,7 +893,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col.itemR(text, "button") col.itemR(text, "button")
col.itemR(text, "button_title") col.itemR(text, "button_title")
col.itemR(text, "button_text") col.itemR(text, "button_text")
col = split.column() col = split.column()
col.itemR(text, "text") col.itemR(text, "text")
col.itemR(text, "text_hi") col.itemR(text, "text_hi")
@@ -923,7 +923,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col = split.column() col = split.column()
col.itemR(time, "grid") col.itemR(time, "grid")
col = split.column() col = split.column()
col.itemR(time, "current_frame") col.itemR(time, "current_frame")
@@ -935,7 +935,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col.itemR(node, "button") col.itemR(node, "button")
col.itemR(node, "button_title") col.itemR(node, "button_title")
col.itemR(node, "button_text") col.itemR(node, "button_text")
col = split.column() col = split.column()
col.itemR(node, "text") col.itemR(node, "text")
@@ -980,7 +980,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col = split.column() col = split.column()
col.itemR(out, "text") col.itemR(out, "text")
col = split.column() col = split.column()
col.itemR(out, "text_hi") col.itemR(out, "text_hi")
@@ -1009,7 +1009,7 @@ class USERPREF_PT_theme(bpy.types.Panel):
col = split.column() col = split.column()
col.itemR(prefs, "text") col.itemR(prefs, "text")
col = split.column() col = split.column()
col.itemR(prefs, "header") col.itemR(prefs, "header")
@@ -1065,7 +1065,7 @@ class USERPREF_PT_file(bpy.types.Panel):
col = split.column() col = split.column()
sub = col.split(percentage=0.2) sub = col.split(percentage=0.2)
sub1 = sub.column() sub.column() # sub1, unused
sub2 = sub.column() sub2 = sub.column()
sub2.itemL(text="Save & Load:") sub2.itemL(text="Save & Load:")
sub2.itemR(paths, "use_relative_paths") sub2.itemR(paths, "use_relative_paths")
@@ -1101,7 +1101,7 @@ class USERPREF_PT_input(bpy.types.Panel):
userpref = context.user_preferences userpref = context.user_preferences
wm = context.manager wm = context.manager
#input = userpref.input #input = userpref.input
input = userpref #input = userpref
inputs = userpref.inputs inputs = userpref.inputs
split = layout.split(percentage=0.25) split = layout.split(percentage=0.25)
@@ -1159,7 +1159,7 @@ class USERPREF_PT_input(bpy.types.Panel):
# Keymap Settings # Keymap Settings
col = split.column() col = split.column()
kc = wm.active_keyconfig # kc = wm.active_keyconfig
defkc = wm.default_keyconfig defkc = wm.default_keyconfig
km = wm.active_keymap km = wm.active_keymap
@@ -1398,7 +1398,7 @@ class WM_OT_keyitem_add(bpy.types.Operator):
def execute(self, context): def execute(self, context):
wm = context.manager wm = context.manager
km = wm.active_keymap km = wm.active_keymap
kmi = km.add_item("", 'A', 'PRESS') km.add_item("", 'A', 'PRESS') # kmi
return ('FINISHED',) return ('FINISHED',)

View File

@@ -27,7 +27,7 @@ class VIEW3D_HT_header(bpy.types.Header):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
view = context.space_data # view = context.space_data
mode_string = context.mode mode_string = context.mode
edit_object = context.edit_object edit_object = context.edit_object
object = context.active_object object = context.active_object
@@ -48,8 +48,6 @@ class VIEW3D_HT_header(bpy.types.Header):
if edit_object: if edit_object:
sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type.lower()) sub.itemM("VIEW3D_MT_edit_%s" % edit_object.type.lower())
elif object: elif object:
ob_mode_string = object.mode
if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']: if mode_string not in ['PAINT_WEIGHT', 'PAINT_TEXTURE']:
sub.itemM("VIEW3D_MT_%s" % mode_string.lower()) sub.itemM("VIEW3D_MT_%s" % mode_string.lower())
else: else:
@@ -90,6 +88,7 @@ class VIEW3D_MT_snap(bpy.types.Menu):
layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid") layout.itemO("view3d.snap_cursor_to_grid", text="Cursor to Grid")
layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active") layout.itemO("view3d.snap_cursor_to_active", text="Cursor to Active")
class VIEW3D_MT_uv_map(dynamic_menu.DynMenu): class VIEW3D_MT_uv_map(dynamic_menu.DynMenu):
bl_label = "UV Mapping" bl_label = "UV Mapping"
@@ -665,8 +664,6 @@ class VIEW3D_MT_paint_vertex(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
sculpt = context.tool_settings.sculpt
layout.itemO("paint.vertex_color_set") layout.itemO("paint.vertex_color_set")
props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True) props = layout.itemO("paint.vertex_color_set", text="Set Selected Vertex Colors", properties=True)
props.selected = True props.selected = True
@@ -694,16 +691,18 @@ class VIEW3D_MT_sculpt(bpy.types.Menu):
layout.item_menu_enumO("brush.curve_preset", property="shape") layout.item_menu_enumO("brush.curve_preset", property="shape")
layout.itemS() layout.itemS()
if brush.sculpt_tool != 'GRAB': sculpt_tool = brush.sculpt_tool
if sculpt_tool != 'GRAB':
layout.itemR(brush, "use_airbrush") layout.itemR(brush, "use_airbrush")
if brush.sculpt_tool != 'LAYER': if sculpt_tool != 'LAYER':
layout.itemR(brush, "use_anchor") layout.itemR(brush, "use_anchor")
if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'): if sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
layout.itemR(brush, "flip_direction") layout.itemR(brush, "flip_direction")
if brush.sculpt_tool == 'LAYER': if sculpt_tool == 'LAYER':
layout.itemR(brush, "use_persistent") layout.itemR(brush, "use_persistent")
layout.itemO("sculpt.set_persistent_base") layout.itemO("sculpt.set_persistent_base")
@@ -1375,6 +1374,7 @@ class VIEW3D_PT_3dview_properties(bpy.types.Panel):
layout.column().itemR(scene, "cursor_location", text="3D Cursor:") layout.column().itemR(scene, "cursor_location", text="3D Cursor:")
class VIEW3D_PT_3dview_item(bpy.types.Panel): class VIEW3D_PT_3dview_item(bpy.types.Panel):
bl_space_type = 'VIEW_3D' bl_space_type = 'VIEW_3D'
bl_region_type = 'UI' bl_region_type = 'UI'
@@ -1399,6 +1399,7 @@ class VIEW3D_PT_3dview_item(bpy.types.Panel):
row.itemL(text="", icon='ICON_BONE_DATA') row.itemL(text="", icon='ICON_BONE_DATA')
row.itemR(bone, "name", text="") row.itemR(bone, "name", text="")
class VIEW3D_PT_3dview_display(bpy.types.Panel): class VIEW3D_PT_3dview_display(bpy.types.Panel):
bl_space_type = 'VIEW_3D' bl_space_type = 'VIEW_3D'
bl_region_type = 'UI' bl_region_type = 'UI'
@@ -1508,7 +1509,7 @@ class VIEW3D_PT_background_image(bpy.types.Panel):
def poll(self, context): def poll(self, context):
view = context.space_data view = context.space_data
bg = context.space_data.background_image # bg = context.space_data.background_image
return (view) return (view)
def draw_header(self, context): def draw_header(self, context):

View File

@@ -514,11 +514,11 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row.itemR(brush, "strength", slider=True) row.itemR(brush, "strength", slider=True)
row.itemR(brush, "use_strength_pressure", text="") row.itemR(brush, "use_strength_pressure", text="")
''' # XXX - TODO # XXX - TODO
row = col.row(align=True) #row = col.row(align=True)
row.itemR(brush, "jitter", slider=True) #row.itemR(brush, "jitter", slider=True)
row.itemR(brush, "use_jitter_pressure", toggle=True, text="") #row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
'''
col = layout.column() col = layout.column()
if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'): if brush.sculpt_tool in ('DRAW', 'PINCH', 'INFLATE', 'LAYER', 'CLAY'):
@@ -587,11 +587,10 @@ class VIEW3D_PT_tools_brush(PaintPanel):
row.itemR(brush, "strength", slider=True) row.itemR(brush, "strength", slider=True)
row.itemR(brush, "use_strength_pressure", toggle=True, text="") row.itemR(brush, "use_strength_pressure", toggle=True, text="")
''' # XXX - TODO # XXX - TODO
row = col.row(align=True) #row = col.row(align=True)
row.itemR(brush, "jitter", slider=True) #row.itemR(brush, "jitter", slider=True)
row.itemR(brush, "use_jitter_pressure", toggle=True, text="") #row.itemR(brush, "use_jitter_pressure", toggle=True, text="")
'''
class VIEW3D_PT_tools_brush_stroke(PaintPanel): class VIEW3D_PT_tools_brush_stroke(PaintPanel):
@@ -694,8 +693,6 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
wpaint = context.tool_settings.weight_paint
col = layout.column() col = layout.column()
# col.itemL(text="Blend:") # col.itemL(text="Blend:")
col.itemO("object.vertex_group_normalize_all", text="Normalize All") col.itemO("object.vertex_group_normalize_all", text="Normalize All")