2.5: Layout Python Files:

* Code cleanup.
* Made some files match the code guidelines, should be all now.
Please everybody use them: http://wiki.blender.org/index.php/Dev:Py/Blender2.5/Layouts/Guidelines
* Made polls and header_draw functions as small as possible. 

* Small fixes here and there.
This commit is contained in:
2009-09-01 00:33:39 +00:00
parent 121f310fab
commit 04bbb6a0c7
22 changed files with 362 additions and 441 deletions

View File

@@ -83,7 +83,7 @@ class DATA_PT_bone_groups(DataButtonsPanel):
layout = self.layout layout = self.layout
ob = context.object ob = context.object
pose= ob.pose pose = ob.pose
row = layout.row() row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index") row.template_list(pose, "bone_groups", pose, "active_bone_group_index")

View File

@@ -77,6 +77,7 @@ class BONE_PT_bone(BoneButtonsPanel):
ob = context.object ob = context.object
bone = context.bone bone = context.bone
arm = context.armature arm = context.armature
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
else: else:
@@ -192,18 +193,18 @@ class BONE_PT_deform(BoneButtonsPanel):
__default_closed__ = True __default_closed__ = True
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
bone = context.bone bone = context.bone
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone
layout.itemR(bone, "deform", text="") self.layout.itemR(bone, "deform", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
bone = context.bone bone = context.bone
if not bone: if not bone:
bone = context.edit_bone bone = context.edit_bone

View File

@@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data" __context__ = "data"
def poll(self, context): def poll(self, context):
return (context.camera != None) return (context.camera)
class DATA_PT_context_camera(DataButtonsPanel): class DATA_PT_context_camera(DataButtonsPanel):
__show_header__ = False __show_header__ = False
@@ -49,7 +49,7 @@ class DATA_PT_camera(DataButtonsPanel):
elif cam.type == 'ORTHO': elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale") row.itemR(cam, "ortho_scale")
layout.itemR(cam, "panorama"); layout.itemR(cam, "panorama")
split = layout.split() split = layout.split()

View File

@@ -38,33 +38,34 @@ class DATA_PT_shape_curve(DataButtonsPanel):
curve = context.curve curve = context.curve
space = context.space_data space = context.space_data
if curve: layout.itemR(curve, "curve_2d")
layout.itemR(curve, "curve_2d")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
colsub = col.column() sub = col.column()
colsub.active = curve.curve_2d sub.active = curve.curve_2d
colsub.itemL(text="Caps:") sub.itemL(text="Caps:")
colsub.itemR(curve, "front") sub.itemR(curve, "front")
colsub.itemR(curve, "back") sub.itemR(curve, "back")
col.itemL(text="Textures:") col.itemL(text="Textures:")
# col.itemR(curve, "uv_orco") # col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace") col.itemR(curve, "auto_texspace")
sub = split.column() col = split.column()
sub.itemL(text="Resolution:") col.itemL(text="Resolution:")
sub.itemR(curve, "resolution_u", text="Preview U") sub = col.column(align=True)
sub.itemR(curve, "resolution_v", text="Preview V") sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "render_resolution_u", text="Render U") sub.itemR(curve, "render_resolution_u", text="Render U")
sub.itemR(curve, "render_resolution_v", text="Render V") sub = col.column(align=True)
sub.itemR(curve, "resolution_v", text="Preview V")
sub.itemR(curve, "render_resolution_v", text="Render V")
# sub.itemL(text="Display:") # col.itemL(text="Display:")
# sub.itemL(text="HANDLES") # col.itemL(text="HANDLES")
# sub.itemL(text="NORMALS") # col.itemL(text="NORMALS")
# sub.itemR(curve, "vertex_normal_flip") # col.itemR(curve, "vertex_normal_flip")
class DATA_PT_geometry_curve(DataButtonsPanel): class DATA_PT_geometry_curve(DataButtonsPanel):
__label__ = "Geometry " __label__ = "Geometry "
@@ -76,27 +77,25 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
split = layout.split() split = layout.split()
sub = split.column() col = split.column()
sub.itemL(text="Modification:") col.itemL(text="Modification:")
sub.itemR(curve, "width") col.itemR(curve, "width")
sub.itemR(curve, "extrude") col.itemR(curve, "extrude")
sub.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE') col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
sub = split.column() col = split.column()
sub.itemL(text="Bevel:") col.itemL(text="Bevel:")
sub.itemR(curve, "bevel_depth", text="Depth") col.itemR(curve, "bevel_depth", text="Depth")
sub.itemR(curve, "bevel_resolution", text="Resolution") col.itemR(curve, "bevel_resolution", text="Resolution")
sub.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE') col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
class DATA_PT_pathanim(DataButtonsPanel): class DATA_PT_pathanim(DataButtonsPanel):
__label__ = "Path Animation" __label__ = "Path Animation"
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
curve = context.curve curve = context.curve
layout.itemR(curve, "path", text="") self.layout.itemR(curve, "path", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout

View File

@@ -13,9 +13,7 @@ class DATA_PT_preview(DataButtonsPanel):
__label__ = "Preview" __label__ = "Preview"
def draw(self, context): def draw(self, context):
layout = self.layout self.layout.template_preview(context.lamp)
layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel): class DATA_PT_context_lamp(DataButtonsPanel):
__show_header__ = False __show_header__ = False
@@ -69,8 +67,7 @@ class DATA_PT_lamp(DataButtonsPanel):
if lamp.type == 'AREA': if lamp.type == 'AREA':
col.itemR(lamp, "distance") col.itemR(lamp, "distance")
col.itemR(lamp, "gamma") col.itemR(lamp, "gamma")
col = split.column() col = split.column()
col.itemR(lamp, "negative") col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only") col.itemR(lamp, "layer", text="This Layer Only")
@@ -299,18 +296,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
def poll(self, context): def poll(self, context):
lamp = context.lamp lamp = context.lamp
if lamp and lamp.type in ('POINT', 'SPOT'): return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
if lamp.falloff_type == 'CUSTOM_CURVE':
return True
return False
def draw(self, context): def draw(self, context):
layout = self.layout
lamp = context.lamp lamp = context.lamp
layout.template_curve_mapping(lamp.falloff_curve) self.layout.template_curve_mapping(lamp.falloff_curve)
bpy.types.register(DATA_PT_context_lamp) bpy.types.register(DATA_PT_context_lamp)
bpy.types.register(DATA_PT_preview) bpy.types.register(DATA_PT_preview)

View File

@@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data" __context__ = "data"
def poll(self, context): def poll(self, context):
return (context.lattice != None) return (context.lattice)
class DATA_PT_context_lattice(DataButtonsPanel): class DATA_PT_context_lattice(DataButtonsPanel):
__show_header__ = False __show_header__ = False

View File

@@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data" __context__ = "data"
def poll(self, context): def poll(self, context):
return (context.mesh != None) return (context.mesh)
class DATA_PT_context_mesh(DataButtonsPanel): class DATA_PT_context_mesh(DataButtonsPanel):
__show_header__ = False __show_header__ = False

View File

@@ -27,6 +27,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
# the mt.type enum is (ab)used for a lookup on function names # the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements # ...to avoid lengthy if statements
# so each type must have a function here. # so each type must have a function here.
def ARMATURE(self, layout, ob, md): def ARMATURE(self, layout, ob, md):
layout.itemR(md, "object") layout.itemR(md, "object")

View File

@@ -38,29 +38,29 @@ class DATA_PT_shape_text(DataButtonsPanel):
curve = context.curve curve = context.curve
space = context.space_data space = context.space_data
if curve:
layout.itemR(curve, "curve_2d") layout.itemR(curve, "curve_2d")
split = layout.split() split = layout.split()
col = split.column() col = split.column()
col.itemL(text="Caps:") col.itemL(text="Caps:")
col.itemR(curve, "front") col.itemR(curve, "front")
col.itemR(curve, "back") col.itemR(curve, "back")
col.itemL(text="Textures:") col.itemL(text="Textures:")
col.itemR(curve, "uv_orco") col.itemR(curve, "uv_orco")
col.itemR(curve, "auto_texspace") col.itemR(curve, "auto_texspace")
col = split.column() col = split.column()
col.itemL(text="Resolution:") col.itemL(text="Resolution:")
sub = col.column(align=True) sub = col.column(align=True)
sub.itemR(curve, "resolution_u", text="Preview U") sub.itemR(curve, "resolution_u", text="Preview U")
sub.itemR(curve, "render_resolution_u", text="Render U") sub.itemR(curve, "render_resolution_u", text="Render U")
sub = col.column(align=True) sub = col.column(align=True)
sub.itemR(curve, "resolution_v", text="Preview V") sub.itemR(curve, "resolution_v", text="Preview V")
sub.itemR(curve, "render_resolution_v", text="Render V") sub.itemR(curve, "render_resolution_v", text="Render V")
col.itemL(text="Display:") col.itemL(text="Display:")
col.itemR(curve, "fast") col.itemR(curve, "fast")
class DATA_PT_geometry_text(DataButtonsPanel): class DATA_PT_geometry_text(DataButtonsPanel):
__label__ = "Geometry" __label__ = "Geometry"

View File

@@ -45,10 +45,9 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col = split.column() col = split.column()
col.itemL(text="Attributes:") col.itemL(text="Attributes:")
sub = col.column() col.itemR(game, "mass")
sub.itemR(game, "mass") col.itemR(game, "radius")
sub.itemR(game, "radius") col.itemR(game, "form_factor")
sub.itemR(game, "form_factor")
col = split.column() col = split.column()
sub = col.column() sub = col.column()
@@ -108,8 +107,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemR(soft, "dynamic_friction", slider=True) col.itemR(soft, "dynamic_friction", slider=True)
col.itemR(soft, "margin", slider=True) col.itemR(soft, "margin", slider=True)
col.itemR(soft, "bending_const", text="Bending Constraints") col.itemR(soft, "bending_const", text="Bending Constraints")
col = split.column() col = split.column()
col.itemR(soft, "shape_match") col.itemR(soft, "shape_match")
sub = col.column() sub = col.column()
@@ -134,32 +132,26 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'): elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
col = layout.column() layout.itemR(ob, "restrict_render", text="Invisible")
col.itemR(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel): class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
__label__ = "Collision Bounds" __label__ = "Collision Bounds"
def poll(self, context): def poll(self, context):
ob = context.active_object game = context.object.game
game = ob.game
rd = context.scene.render_data rd = context.scene.render_data
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME') return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
def draw_header(self, context): def draw_header(self, context):
layout = self.layout game = context.active_object.game
ob = context.active_object
game = ob.game
layout.itemR(game, "use_collision_bounds", text="") self.layout.itemR(game, "use_collision_bounds", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
ob = context.scene.objects[0] game = context.active_object.game
game = ob.game
layout.active = game.use_collision_bounds layout.active = game.use_collision_bounds
layout.itemR(game, "collision_bounds", text="Bounds") layout.itemR(game, "collision_bounds", text="Bounds")
@@ -184,8 +176,6 @@ class SCENE_PT_game(SceneButtonsPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
rd = context.scene.render_data
row = layout.row() row = layout.row()
row.itemO("view3d.game_start", text="Start") row.itemO("view3d.game_start", text="Start")

View File

@@ -8,18 +8,16 @@ class MaterialButtonsPanel(bpy.types.Panel):
# 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):
return (context.material) and (context.scene.render_data.engine in self.COMPAT_ENGINES) mat = context.material
engine = context.scene.render_data.engine
return mat and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_preview(MaterialButtonsPanel): class MATERIAL_PT_preview(MaterialButtonsPanel):
__label__ = "Preview" __label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME']) COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def draw(self, context): def draw(self, context):
layout = self.layout self.layout.template_preview(context.material)
mat = context.material
layout.template_preview(mat)
class MATERIAL_PT_context_material(MaterialButtonsPanel): class MATERIAL_PT_context_material(MaterialButtonsPanel):
__show_header__ = False __show_header__ = False
@@ -83,32 +81,27 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
layout = self.layout layout = self.layout
mat = context.material mat = context.material
ob = context.object
slot = context.material_slot
space = context.space_data
if mat: if mat.type in ('SURFACE', 'WIRE'):
split = layout.split()
if mat.type in ('SURFACE', 'WIRE'):
split = layout.split()
col = split.column() col = split.column()
sub = col.column() sub = col.column()
sub.active = not mat.shadeless sub.active = not mat.shadeless
sub.itemR(mat, "emit") sub.itemR(mat, "emit")
sub.itemR(mat, "ambient") sub.itemR(mat, "ambient")
sub = col.column() sub = col.column()
sub.itemR(mat, "translucency") sub.itemR(mat, "translucency")
col = split.column() col = split.column()
col.itemR(mat, "shadeless") col.itemR(mat, "shadeless")
sub = col.column() sub = col.column()
sub.active = not mat.shadeless sub.active = not mat.shadeless
sub.itemR(mat, "tangent_shading") sub.itemR(mat, "tangent_shading")
sub.itemR(mat, "cubic") sub.itemR(mat, "cubic")
elif mat.type == 'HALO': elif mat.type == 'HALO':
layout.itemR(mat, "alpha") layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel): class MATERIAL_PT_strand(MaterialButtonsPanel):
__label__ = "Strand" __label__ = "Strand"
@@ -158,8 +151,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
mat = context.material phys = context.material.physics
phys = mat.physics
split = layout.split() split = layout.split()
@@ -363,12 +355,11 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
sss = context.material.subsurface_scattering sss = context.material.subsurface_scattering
mat = context.material mat = context.material
layout.active = (not mat.shadeless) self.layout.active = (not mat.shadeless)
layout.itemR(sss, "enabled", text="") self.layout.itemR(sss, "enabled", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -408,12 +399,10 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
engine = context.scene.render_data.engine engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
raym = context.material.raytrace_mirror raym = context.material.raytrace_mirror
layout.itemR(raym, "enabled", text="") self.layout.itemR(raym, "enabled", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -465,11 +454,9 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
engine = context.scene.render_data.engine engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES) return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
mat = context.material mat = context.material
layout.itemR(mat, "transparency", text="") self.layout.itemR(mat, "transparency", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -477,15 +464,14 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
mat = context.material mat = context.material
rayt = context.material.raytrace_transparency rayt = context.material.raytrace_transparency
row= layout.row() row = layout.row()
row.itemR(mat, "transparency_method", expand=True)
row.active = mat.transparency and (not mat.shadeless) row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "transparency_method", expand=True)
split = layout.split() split = layout.split()
col = split.column() col = split.column()
row = col.row() col.itemR(mat, "alpha")
row.itemR(mat, "alpha")
row = col.row() row = col.row()
row.active = mat.transparency and (not mat.shadeless) row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular") row.itemR(mat, "specular_alpha", text="Specular")
@@ -517,129 +503,6 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
sub.itemR(rayt, "gloss_threshold", text="Threshold") sub.itemR(rayt, "gloss_threshold", text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples") sub.itemR(rayt, "gloss_samples", text="Samples")
class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
__label__ = "Shading"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
vol = context.material.volume
split = layout.split()
row = split.row()
row.itemR(vol, "density")
row.itemR(vol, "scattering")
split = layout.split()
col = split.column()
col.itemR(vol, "absorption")
col.itemR(vol, "absorption_color", text="")
col = split.column()
col.itemR(vol, "emission")
col.itemR(vol, "emission_color", text="")
class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
__label__ = "Scattering"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
vol = context.material.volume
split = layout.split()
col = split.column()
col.itemR(vol, "scattering_mode", text="")
if vol.scattering_mode == 'SINGLE_SCATTERING':
col.itemR(vol, "light_cache")
sub = col.column()
sub.active = vol.light_cache
sub.itemR(vol, "cache_resolution")
elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
col.itemR(vol, "cache_resolution")
col = col.column(align=True)
col.itemR(vol, "ms_diffusion")
col.itemR(vol, "ms_spread")
col.itemR(vol, "ms_intensity")
col = split.column()
# col.itemL(text="Anisotropic Scattering:")
col.itemR(vol, "phase_function", text="")
if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
col.itemR(vol, "asymmetry")
class MATERIAL_PT_volume_transp(MaterialButtonsPanel):
__label__= "Transparency"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw_header(self, context):
layout = self.layout
def draw(self, context):
layout = self.layout
mat = context.material
rayt = context.material.raytrace_transparency
row= layout.row()
row.itemR(mat, "transparency_method", expand=True)
row.active = mat.transparency and (not mat.shadeless)
class MATERIAL_PT_volume_integration(MaterialButtonsPanel):
__label__ = "Integration"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
mat = context.material
vol = context.material.volume
split = layout.split()
col = split.column()
col.itemL(text="Step Calculation:")
col.itemR(vol, "step_calculation", text="")
col = col.column(align=True)
col.itemR(vol, "step_size")
col.itemR(vol, "shading_step_size")
col = split.column()
col.itemL()
col.itemR(vol, "depth_cutoff")
col.itemR(vol, "density_scale")
class MATERIAL_PT_halo(MaterialButtonsPanel): class MATERIAL_PT_halo(MaterialButtonsPanel):
__label__= "Halo" __label__= "Halo"
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
@@ -720,7 +583,7 @@ class MATERIAL_PT_flare(MaterialButtonsPanel):
col = split.column() col = split.column()
col.itemR(halo, "flares_sub", text="Subflares") col.itemR(halo, "flares_sub", text="Subflares")
col.itemR(halo, "flare_subsize", text="Subsize") col.itemR(halo, "flare_subsize", text="Subsize")
bpy.types.register(MATERIAL_PT_context_material) bpy.types.register(MATERIAL_PT_context_material)
bpy.types.register(MATERIAL_PT_preview) bpy.types.register(MATERIAL_PT_preview)
bpy.types.register(MATERIAL_PT_diffuse) bpy.types.register(MATERIAL_PT_diffuse)
@@ -729,13 +592,122 @@ bpy.types.register(MATERIAL_PT_shading)
bpy.types.register(MATERIAL_PT_transp) bpy.types.register(MATERIAL_PT_transp)
bpy.types.register(MATERIAL_PT_mirror) bpy.types.register(MATERIAL_PT_mirror)
bpy.types.register(MATERIAL_PT_sss) bpy.types.register(MATERIAL_PT_sss)
bpy.types.register(MATERIAL_PT_volume_shading)
bpy.types.register(MATERIAL_PT_volume_scattering)
bpy.types.register(MATERIAL_PT_volume_transp)
bpy.types.register(MATERIAL_PT_volume_integration)
bpy.types.register(MATERIAL_PT_halo) bpy.types.register(MATERIAL_PT_halo)
bpy.types.register(MATERIAL_PT_flare) bpy.types.register(MATERIAL_PT_flare)
bpy.types.register(MATERIAL_PT_physics) bpy.types.register(MATERIAL_PT_physics)
bpy.types.register(MATERIAL_PT_strand) bpy.types.register(MATERIAL_PT_strand)
bpy.types.register(MATERIAL_PT_options) bpy.types.register(MATERIAL_PT_options)
bpy.types.register(MATERIAL_PT_shadow) bpy.types.register(MATERIAL_PT_shadow)
# Volumetrics
class VolumeButtonsPanel(bpy.types.Panel):
__space_type__ = 'PROPERTIES'
__region_type__ = 'WINDOW'
__context__ = "material"
def poll(self, context):
mat = context.material
engine = context.scene.render_data.engine
return mat and (mat.type == 'VOLUME') and (engine in self.COMPAT_ENGINES)
class MATERIAL_PT_volume_shading(VolumeButtonsPanel):
__label__ = "Shading"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
mat = context.material
vol = context.material.volume
row = layout.row()
row.itemR(vol, "density")
row.itemR(vol, "scattering")
split = layout.split()
col = split.column()
col.itemR(vol, "absorption")
col.itemR(vol, "absorption_color", text="")
col = split.column()
col.itemR(vol, "emission")
col.itemR(vol, "emission_color", text="")
class MATERIAL_PT_volume_scattering(VolumeButtonsPanel):
__label__ = "Scattering"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
vol = context.material.volume
split = layout.split()
col = split.column()
col.itemR(vol, "scattering_mode", text="")
if vol.scattering_mode == 'SINGLE_SCATTERING':
col.itemR(vol, "light_cache")
sub = col.column()
sub.active = vol.light_cache
sub.itemR(vol, "cache_resolution")
elif vol.scattering_mode in ('MULTIPLE_SCATTERING', 'SINGLE_PLUS_MULTIPLE_SCATTERING'):
col.itemR(vol, "cache_resolution")
col = col.column(align=True)
col.itemR(vol, "ms_diffusion")
col.itemR(vol, "ms_spread")
col.itemR(vol, "ms_intensity")
col = split.column()
# col.itemL(text="Anisotropic Scattering:")
col.itemR(vol, "phase_function", text="")
if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
col.itemR(vol, "asymmetry")
class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
__label__= "Transparency"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
mat = context.material
rayt = context.material.raytrace_transparency
row= layout.row()
row.itemR(mat, "transparency_method", expand=True)
row.active = mat.transparency and (not mat.shadeless)
class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
__label__ = "Integration"
__default_closed__ = False
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
layout = self.layout
mat = context.material
vol = context.material.volume
split = layout.split()
col = split.column()
col.itemL(text="Step Calculation:")
col.itemR(vol, "step_calculation", text="")
col = col.column(align=True)
col.itemR(vol, "step_size")
col.itemR(vol, "shading_step_size")
col = split.column()
col.itemL()
col.itemR(vol, "depth_cutoff")
col.itemR(vol, "density_scale")
bpy.types.register(MATERIAL_PT_volume_shading)
bpy.types.register(MATERIAL_PT_volume_scattering)
bpy.types.register(MATERIAL_PT_volume_transp)
bpy.types.register(MATERIAL_PT_volume_integration)

View File

@@ -103,11 +103,10 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
return (context.cloth) return (context.cloth)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
cloth = context.cloth.collision_settings cloth = context.cloth.collision_settings
layout.active = cloth_panel_enabled(context.cloth) self.layout.active = cloth_panel_enabled(context.cloth)
layout.itemR(cloth, "enable_collision", text="") self.layout.itemR(cloth, "enable_collision", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -139,11 +138,10 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
return (context.cloth != None) return (context.cloth != None)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
cloth = context.cloth.settings cloth = context.cloth.settings
layout.active = cloth_panel_enabled(context.cloth) self.layout.active = cloth_panel_enabled(context.cloth)
layout.itemR(cloth, "stiffness_scaling", text="") self.layout.itemR(cloth, "stiffness_scaling", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout

View File

@@ -8,7 +8,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
def poll(self, context): def poll(self, context):
rd = context.scene.render_data rd = context.scene.render_data
return (context.object != None) and (not rd.use_game_engine) return (context.object) and (not rd.use_game_engine)
class PHYSICS_PT_field(PhysicButtonsPanel): class PHYSICS_PT_field(PhysicButtonsPanel):
__label__ = "Force Fields" __label__ = "Force Fields"

View File

@@ -97,10 +97,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
def poll(self, context): def poll(self, context):
md = context.smoke md = context.smoke
if md: return md and (md.smoke_type == 'TYPE_DOMAIN')
return (md.smoke_type == 'TYPE_DOMAIN')
return False
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -126,22 +123,15 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
def poll(self, context): def poll(self, context):
md = context.smoke md = context.smoke
if md: return md and (md.smoke_type == 'TYPE_DOMAIN')
return (md.smoke_type == 'TYPE_DOMAIN')
return False
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
md = context.smoke md = context.smoke.domain_settings
cache = md.point_cache
if md.smoke_type == 'TYPE_DOMAIN':
domain = md.domain_settings point_cache_ui(self, cache, cache.baked==False, 0, 1)
cache = domain.point_cache
point_cache_ui(self, cache, cache.baked==False, 0, 1)
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
__label__ = "Smoke High Resolution" __label__ = "Smoke High Resolution"
@@ -149,95 +139,85 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
def poll(self, context): def poll(self, context):
md = context.smoke md = context.smoke
if md: return md and (md.smoke_type == 'TYPE_DOMAIN')
return (md.smoke_type == 'TYPE_DOMAIN')
return False
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
high = context.smoke.domain_settings high = context.smoke.domain_settings
layout.itemR(high, "highres", text="") self.layout.itemR(high, "highres", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
md = context.smoke.domain_settings md = context.smoke.domain_settings
if md: split = layout.split()
split = layout.split()
col = split.column() col = split.column()
col.itemL(text="Resolution:") col.itemL(text="Resolution:")
col.itemR(md, "amplify", text="Divisions") col.itemR(md, "amplify", text="Divisions")
sub = split.column() col = split.column()
sub.itemL(text="Noise Method:") col.itemL(text="Noise Method:")
sub.row().itemR(md, "noise_type", text="") col.row().itemR(md, "noise_type", text="")
sub.itemR(md, "strength") col.itemR(md, "strength")
sub.itemR(md, "show_highres") col.itemR(md, "show_highres")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
__label__ = "Smoke Cache" __label__ = "Smoke Cache"
__default_closed__ = True __default_closed__ = True
def poll(self, context): def poll(self, context):
return (context.smoke != None) return (context.smoke)
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
md = context.smoke md = context.smoke
if md:
cache = md.point_cache
layout.set_context_pointer("PointCache", cache)
row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
col = row.column(align=True)
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
row = layout.row()
row.itemR(cache, "name")
row = layout.row()
row.itemR(cache, "start_frame")
row.itemR(cache, "end_frame")
row = layout.row()
if cache.baked == True:
row.itemO("ptcache.free_bake", text="Free Bake")
else:
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
subrow = row.row()
subrow.enabled = cache.frames_skipped or cache.outdated
subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
row = layout.row()
#row.enabled = smoke_panel_enabled(psys)
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
row = layout.row()
#row.enabled = smoke_panel_enabled(psys)
layout.itemL(text=cache.info)
layout.itemS()
row = layout.row()
row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
cache = md.point_cache
layout.set_context_pointer("PointCache", cache)
row = layout.row()
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
col = row.column(align=True)
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
row = layout.row()
row.itemR(cache, "name")
row = layout.row()
row.itemR(cache, "start_frame")
row.itemR(cache, "end_frame")
row = layout.row()
if cache.baked == True:
row.itemO("ptcache.free_bake", text="Free Bake")
else:
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
subrow = row.row()
subrow.enabled = cache.frames_skipped or cache.outdated
subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
row = layout.row()
#row.enabled = smoke_panel_enabled(psys)
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
row = layout.row()
#row.enabled = smoke_panel_enabled(psys)
layout.itemL(text=cache.info)
layout.itemS()
row = layout.row()
row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
bpy.types.register(PHYSICS_PT_smoke) bpy.types.register(PHYSICS_PT_smoke)
bpy.types.register(PHYSICS_PT_smoke_cache) bpy.types.register(PHYSICS_PT_smoke_cache)

View File

@@ -77,12 +77,10 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
return (context.soft_body) return (context.soft_body)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
softbody = context.soft_body.settings softbody = context.soft_body.settings
layout.active = softbody_panel_enabled(context.soft_body) self.layout.active = softbody_panel_enabled(context.soft_body)
layout.itemR(softbody, "use_goal", text="") self.layout.itemR(softbody, "use_goal", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -120,12 +118,10 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
return (context.soft_body) return (context.soft_body)
def draw_header(self, context): def draw_header(self, context):
#layout = self.layout
softbody = context.soft_body.settings softbody = context.soft_body.settings
layout.active = softbody_panel_enabled(context.soft_body) self.layout.active = softbody_panel_enabled(context.soft_body)
layout.itemR(softbody, "use_edges", text="") self.layout.itemR(softbody, "use_edges", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -170,12 +166,10 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
return (context.soft_body) return (context.soft_body)
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
softbody = context.soft_body.settings softbody = context.soft_body.settings
layout.active = softbody_panel_enabled(context.soft_body) self.layout.active = softbody_panel_enabled(context.soft_body)
layout.itemR(softbody, "self_collision", text="") self.layout.itemR(softbody, "self_collision", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout

View File

@@ -323,11 +323,9 @@ class SCENE_PT_antialiasing(RenderButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
rd = context.scene.render_data rd = context.scene.render_data
layout.itemR(rd, "antialiasing", text="") self.layout.itemR(rd, "antialiasing", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -391,11 +389,9 @@ class SCENE_PT_stamp(RenderButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
rd = context.scene.render_data rd = context.scene.render_data
layout.itemR(rd, "render_stamp", text="") self.layout.itemR(rd, "render_stamp", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout

View File

@@ -9,17 +9,14 @@ class WorldButtonsPanel(bpy.types.Panel):
def poll(self, context): def poll(self, context):
rd = context.scene.render_data rd = context.scene.render_data
return (context.world != None) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES) return (context.world) and (not rd.use_game_engine) and (rd.engine in self.COMPAT_ENGINES)
class WORLD_PT_preview(WorldButtonsPanel): class WORLD_PT_preview(WorldButtonsPanel):
__label__ = "Preview" __label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context): def draw(self, context):
layout = self.layout self.layout.template_preview(context.world)
world = context.world
layout.template_preview(world)
class WORLD_PT_context_world(WorldButtonsPanel): class WORLD_PT_context_world(WorldButtonsPanel):
__show_header__ = False __show_header__ = False
@@ -52,32 +49,30 @@ class WORLD_PT_world(WorldButtonsPanel):
world = context.world world = context.world
if world: row = layout.row()
row.itemR(world, "paper_sky")
row = layout.row() row.itemR(world, "blend_sky")
row.itemR(world, "paper_sky") row.itemR(world, "real_sky")
row.itemR(world, "blend_sky")
row.itemR(world, "real_sky")
row = layout.row() row = layout.row()
row.column().itemR(world, "horizon_color") row.column().itemR(world, "horizon_color")
col = row.column() col = row.column()
col.itemR(world, "zenith_color") col.itemR(world, "zenith_color")
col.active = world.blend_sky col.active = world.blend_sky
row.column().itemR(world, "ambient_color") row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel): class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist" __label__ = "Mist"
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
world = context.world world = context.world
layout.itemR(world.mist, "enabled", text="") self.layout.itemR(world.mist, "enabled", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
world = context.world world = context.world
layout.active = world.mist.enabled layout.active = world.mist.enabled
@@ -87,7 +82,6 @@ class WORLD_PT_mist(WorldButtonsPanel):
flow.itemR(world.mist, "start") flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth") flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height") flow.itemR(world.mist, "height")
layout.itemR(world.mist, "falloff") layout.itemR(world.mist, "falloff")
@@ -96,13 +90,13 @@ class WORLD_PT_stars(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
world = context.world world = context.world
layout.itemR(world.stars, "enabled", text="") self.layout.itemR(world.stars, "enabled", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
world = context.world world = context.world
layout.active = world.stars.enabled layout.active = world.stars.enabled
@@ -118,13 +112,13 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER']) COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context): def draw_header(self, context):
layout = self.layout
world = context.world world = context.world
layout.itemR(world.ambient_occlusion, "enabled", text="") self.layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
ao = context.world.ambient_occlusion ao = context.world.ambient_occlusion
layout.active = ao.enabled layout.active = ao.enabled
@@ -186,4 +180,3 @@ bpy.types.register(WORLD_PT_world)
bpy.types.register(WORLD_PT_ambient_occlusion) bpy.types.register(WORLD_PT_ambient_occlusion)
bpy.types.register(WORLD_PT_mist) bpy.types.register(WORLD_PT_mist)
bpy.types.register(WORLD_PT_stars) bpy.types.register(WORLD_PT_stars)

View File

@@ -7,6 +7,7 @@ class IMAGE_MT_view(bpy.types.Menu):
def draw(self, context): def draw(self, context):
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
@@ -69,6 +70,7 @@ class IMAGE_MT_image(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
sima = context.space_data sima = context.space_data
ima = sima.image ima = sima.image
@@ -148,13 +150,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
layout.itemO("uv.weld") # W, 1 layout.itemO("uv.weld") # W, 1
layout.items_enumO("uv.align", "axis") # W, 2/3/4 layout.items_enumO("uv.align", "axis") # W, 2/3/4
class IMAGE_MT_uvs(bpy.types.Menu): class IMAGE_MT_uvs(bpy.types.Menu):
__space_type__ = 'IMAGE_EDITOR' __space_type__ = 'IMAGE_EDITOR'
__label__ = "UVs" __label__ = "UVs"
def draw(self, context): def draw(self, context):
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
@@ -195,10 +197,11 @@ class IMAGE_HT_header(bpy.types.Header):
__space_type__ = 'IMAGE_EDITOR' __space_type__ = 'IMAGE_EDITOR'
def draw(self, context): def draw(self, context):
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 = self.layout
settings = context.tool_settings settings = context.tool_settings
show_render = sima.show_render show_render = sima.show_render
@@ -281,38 +284,34 @@ class IMAGE_PT_game_properties(bpy.types.Panel):
return (sima and sima.image) and (rd.engine == 'BLENDER_GAME') return (sima and sima.image) and (rd.engine == 'BLENDER_GAME')
def draw(self, context): def draw(self, context):
sima = context.space_data
layout = self.layout layout = self.layout
sima = context.space_data
ima = sima.image ima = sima.image
if ima: split = layout.split()
split = layout.split()
col = split.column() col = split.column()
col.itemR(ima, "clamp_x")
col.itemR(ima, "clamp_y")
col.itemR(ima, "mapping", expand=True)
col.itemR(ima, "tiles")
subcol = col.column(align=True) col = split.column()
subcol.itemR(ima, "clamp_x")
subcol.itemR(ima, "clamp_y")
col.itemR(ima, "mapping", expand=True) sub = col.column(align=True)
col.itemR(ima, "tiles") sub.itemR(ima, "animated")
col = split.column() subsub = sub.column()
subsub.active = ima.animated
subsub.itemR(ima, "animation_start", text="Start")
subsub.itemR(ima, "animation_end", text="End")
subsub.itemR(ima, "animation_speed", text="Speed")
subcol = col.column(align=True) sub = col.row(align=True)
subcol.itemR(ima, "animated") sub.active = ima.tiles or ima.animated
sub.itemR(ima, "tiles_x", text="X")
subcol = subcol.column() sub.itemR(ima, "tiles_y", text="Y")
subcol.itemR(ima, "animation_start", text="Start")
subcol.itemR(ima, "animation_end", text="End")
subcol.itemR(ima, "animation_speed", text="Speed")
subcol.active = ima.animated
subrow = col.row(align=True)
subrow.itemR(ima, "tiles_x", text="X")
subrow.itemR(ima, "tiles_y", text="Y")
subrow.active = ima.tiles or ima.animated
class IMAGE_PT_view_properties(bpy.types.Panel): class IMAGE_PT_view_properties(bpy.types.Panel):
__space_type__ = 'IMAGE_EDITOR' __space_type__ = 'IMAGE_EDITOR'
@@ -324,9 +323,9 @@ class IMAGE_PT_view_properties(bpy.types.Panel):
return (sima and (sima.image or sima.show_uvedit)) return (sima and (sima.image or sima.show_uvedit))
def draw(self, context): def draw(self, context):
sima = context.space_data
layout = self.layout layout = self.layout
sima = context.space_data
ima = sima.image ima = sima.image
show_uvedit = sima.show_uvedit show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor uvedit = sima.uv_editor
@@ -376,4 +375,3 @@ bpy.types.register(IMAGE_MT_uvs)
bpy.types.register(IMAGE_HT_header) bpy.types.register(IMAGE_HT_header)
bpy.types.register(IMAGE_PT_game_properties) bpy.types.register(IMAGE_PT_game_properties)
bpy.types.register(IMAGE_PT_view_properties) bpy.types.register(IMAGE_PT_view_properties)

View File

@@ -79,6 +79,8 @@ class INFO_MT_file_import(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
layout.itemL(text="Nothing yet")
class INFO_MT_file_export(bpy.types.Menu): class INFO_MT_file_export(bpy.types.Menu):
__space_type__ = 'INFO' __space_type__ = 'INFO'

View File

@@ -6,6 +6,7 @@ class NODE_HT_header(bpy.types.Header):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
snode = context.space_data snode = context.space_data
row = layout.row(align=True) row = layout.row(align=True)
@@ -113,9 +114,7 @@ class NODE_MT_node(bpy.types.Menu):
# layout.itemS() # layout.itemS()
# layout.itemO("node.show_cyclic_dependencies") # layout.itemO("node.show_cyclic_dependencies")
bpy.types.register(NODE_HT_header) bpy.types.register(NODE_HT_header)
bpy.types.register(NODE_MT_view) bpy.types.register(NODE_MT_view)
bpy.types.register(NODE_MT_select) bpy.types.register(NODE_MT_select)
bpy.types.register(NODE_MT_node) bpy.types.register(NODE_MT_node)

View File

@@ -5,9 +5,10 @@ class TEXT_HT_header(bpy.types.Header):
__space_type__ = 'TEXT_EDITOR' __space_type__ = 'TEXT_EDITOR'
def draw(self, context): def draw(self, context):
layout = self.layout
st = context.space_data st = context.space_data
text = st.text text = st.text
layout = self.layout
row = layout.row(align=True) row = layout.row(align=True)
row.template_header() row.template_header()
@@ -50,8 +51,9 @@ class TEXT_PT_properties(bpy.types.Panel):
__label__ = "Properties" __label__ = "Properties"
def draw(self, context): def draw(self, context):
st = context.space_data
layout = self.layout layout = self.layout
st = context.space_data
flow = layout.column_flow() flow = layout.column_flow()
flow.itemR(st, "line_numbers") flow.itemR(st, "line_numbers")
@@ -69,8 +71,9 @@ class TEXT_PT_find(bpy.types.Panel):
__label__ = "Find" __label__ = "Find"
def draw(self, context): def draw(self, context):
st = context.space_data
layout = self.layout layout = self.layout
st = context.space_data
# find # find
col = layout.column(align=True) col = layout.column(align=True)
@@ -100,6 +103,7 @@ class TEXT_MT_text(bpy.types.Menu):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
st = context.space_data st = context.space_data
text = st.text text = st.text
@@ -200,8 +204,7 @@ class TEXT_MT_edit(bpy.types.Menu):
__label__ = "Edit" __label__ = "Edit"
def poll(self, context): def poll(self, context):
st = context.space_data return (context.space_data.text)
return st.text != None
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
@@ -240,4 +243,3 @@ bpy.types.register(TEXT_MT_edit_view)
bpy.types.register(TEXT_MT_edit_select) bpy.types.register(TEXT_MT_edit_select)
bpy.types.register(TEXT_MT_edit_markers) bpy.types.register(TEXT_MT_edit_markers)
bpy.types.register(TEXT_MT_edit_to3d) bpy.types.register(TEXT_MT_edit_to3d)

View File

@@ -420,10 +420,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
context.texture_paint_object)) context.texture_paint_object))
def draw(self, context): def draw(self, context):
layout = self.layout
settings = self.paint_settings(context) settings = self.paint_settings(context)
brush = settings.brush brush = settings.brush
texture_paint = context.texture_paint_object texture_paint = context.texture_paint_object
layout = self.layout
if not texture_paint: if not texture_paint:
layout.itemR(brush, "smooth_stroke") layout.itemR(brush, "smooth_stroke")
@@ -444,7 +445,6 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
col.active = brush.airbrush col.active = brush.airbrush
col.itemR(brush, "rate", slider=True) col.itemR(brush, "rate", slider=True)
class VIEW3D_PT_tools_brush_curve(PaintPanel): class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve" __label__ = "Curve"
__default_closed__ = True __default_closed__ = True
@@ -454,9 +454,10 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel):
return (settings and settings.brush and settings.brush.curve) return (settings and settings.brush and settings.brush.curve)
def draw(self, context): def draw(self, context):
layout = self.layout
settings = self.paint_settings(context) settings = self.paint_settings(context)
brush = settings.brush brush = settings.brush
layout = self.layout
layout.template_curve_mapping(brush.curve) layout.template_curve_mapping(brush.curve)
layout.item_menu_enumO("brush.curve_preset", property="shape") layout.item_menu_enumO("brush.curve_preset", property="shape")
@@ -469,6 +470,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
sculpt = context.tool_settings.sculpt sculpt = context.tool_settings.sculpt
col = layout.column() col = layout.column()
@@ -497,6 +499,7 @@ 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 wpaint = context.tool_settings.weight_paint
col = layout.column() col = layout.column()
@@ -524,6 +527,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
vpaint = context.tool_settings.vertex_paint vpaint = context.tool_settings.vertex_paint
col = layout.column() col = layout.column()
@@ -598,6 +602,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
def draw(self, context): def draw(self, context):
layout = self.layout layout = self.layout
pe = context.tool_settings.particle_edit pe = context.tool_settings.particle_edit
ob = pe.object ob = pe.object