Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2009-09-01 04:33:39 +0400
committerThomas Dinges <blender@dingto.org>2009-09-01 04:33:39 +0400
commit04bbb6a0c7a7c8a6c55f1528e76132e7f5a38e6f (patch)
tree7951776dce8fb166c7f000432dcae6abfb8b3f98 /release
parent121f310fab0a3e1171293583df2e7a984112363b (diff)
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.
Diffstat (limited to 'release')
-rw-r--r--release/ui/buttons_data_armature.py2
-rw-r--r--release/ui/buttons_data_bone.py7
-rw-r--r--release/ui/buttons_data_camera.py4
-rw-r--r--release/ui/buttons_data_curve.py71
-rw-r--r--release/ui/buttons_data_lamp.py17
-rw-r--r--release/ui/buttons_data_lattice.py2
-rw-r--r--release/ui/buttons_data_mesh.py2
-rw-r--r--release/ui/buttons_data_modifier.py1
-rw-r--r--release/ui/buttons_data_text.py40
-rw-r--r--release/ui/buttons_game.py30
-rw-r--r--release/ui/buttons_material.py316
-rw-r--r--release/ui/buttons_physics_cloth.py10
-rw-r--r--release/ui/buttons_physics_field.py2
-rw-r--r--release/ui/buttons_physics_smoke.py122
-rw-r--r--release/ui/buttons_physics_softbody.py18
-rw-r--r--release/ui/buttons_scene.py8
-rw-r--r--release/ui/buttons_world.py43
-rw-r--r--release/ui/space_image.py56
-rw-r--r--release/ui/space_info.py2
-rw-r--r--release/ui/space_node.py3
-rw-r--r--release/ui/space_text.py14
-rw-r--r--release/ui/space_view3d_toolbar.py11
22 files changed, 351 insertions, 430 deletions
diff --git a/release/ui/buttons_data_armature.py b/release/ui/buttons_data_armature.py
index f207b556a6d..ed350caa3bd 100644
--- a/release/ui/buttons_data_armature.py
+++ b/release/ui/buttons_data_armature.py
@@ -83,7 +83,7 @@ class DATA_PT_bone_groups(DataButtonsPanel):
layout = self.layout
ob = context.object
- pose= ob.pose
+ pose = ob.pose
row = layout.row()
row.template_list(pose, "bone_groups", pose, "active_bone_group_index")
diff --git a/release/ui/buttons_data_bone.py b/release/ui/buttons_data_bone.py
index cfdaabadf79..8098648886b 100644
--- a/release/ui/buttons_data_bone.py
+++ b/release/ui/buttons_data_bone.py
@@ -77,6 +77,7 @@ class BONE_PT_bone(BoneButtonsPanel):
ob = context.object
bone = context.bone
arm = context.armature
+
if not bone:
bone = context.edit_bone
else:
@@ -192,18 +193,18 @@ class BONE_PT_deform(BoneButtonsPanel):
__default_closed__ = True
def draw_header(self, context):
- layout = self.layout
-
bone = context.bone
+
if not bone:
bone = context.edit_bone
- layout.itemR(bone, "deform", text="")
+ self.layout.itemR(bone, "deform", text="")
def draw(self, context):
layout = self.layout
bone = context.bone
+
if not bone:
bone = context.edit_bone
diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py
index 0480897d641..aa107d8dbdd 100644
--- a/release/ui/buttons_data_camera.py
+++ b/release/ui/buttons_data_camera.py
@@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
- return (context.camera != None)
+ return (context.camera)
class DATA_PT_context_camera(DataButtonsPanel):
__show_header__ = False
@@ -49,7 +49,7 @@ class DATA_PT_camera(DataButtonsPanel):
elif cam.type == 'ORTHO':
row.itemR(cam, "ortho_scale")
- layout.itemR(cam, "panorama");
+ layout.itemR(cam, "panorama")
split = layout.split()
diff --git a/release/ui/buttons_data_curve.py b/release/ui/buttons_data_curve.py
index 92e414ba2f3..ced3c6597e0 100644
--- a/release/ui/buttons_data_curve.py
+++ b/release/ui/buttons_data_curve.py
@@ -38,33 +38,34 @@ class DATA_PT_shape_curve(DataButtonsPanel):
curve = context.curve
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()
- colsub = col.column()
- colsub.active = curve.curve_2d
- colsub.itemL(text="Caps:")
- colsub.itemR(curve, "front")
- colsub.itemR(curve, "back")
+ col = split.column()
+ sub = col.column()
+ sub.active = curve.curve_2d
+ sub.itemL(text="Caps:")
+ sub.itemR(curve, "front")
+ sub.itemR(curve, "back")
- col.itemL(text="Textures:")
-# col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
+ col.itemL(text="Textures:")
+# col.itemR(curve, "uv_orco")
+ col.itemR(curve, "auto_texspace")
- sub = split.column()
- sub.itemL(text="Resolution:")
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "resolution_v", text="Preview V")
- sub.itemR(curve, "render_resolution_u", text="Render U")
- sub.itemR(curve, "render_resolution_v", text="Render V")
-
-# sub.itemL(text="Display:")
-# sub.itemL(text="HANDLES")
-# sub.itemL(text="NORMALS")
-# sub.itemR(curve, "vertex_normal_flip")
+ col = split.column()
+ col.itemL(text="Resolution:")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_u", text="Preview U")
+ sub.itemR(curve, "render_resolution_u", text="Render U")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_v", text="Preview V")
+ sub.itemR(curve, "render_resolution_v", text="Render V")
+
+# col.itemL(text="Display:")
+# col.itemL(text="HANDLES")
+# col.itemL(text="NORMALS")
+# col.itemR(curve, "vertex_normal_flip")
class DATA_PT_geometry_curve(DataButtonsPanel):
__label__ = "Geometry "
@@ -76,27 +77,25 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
split = layout.split()
- sub = split.column()
- sub.itemL(text="Modification:")
- sub.itemR(curve, "width")
- sub.itemR(curve, "extrude")
- sub.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
+ col = split.column()
+ col.itemL(text="Modification:")
+ col.itemR(curve, "width")
+ col.itemR(curve, "extrude")
+ col.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
- sub = split.column()
- sub.itemL(text="Bevel:")
- sub.itemR(curve, "bevel_depth", text="Depth")
- sub.itemR(curve, "bevel_resolution", text="Resolution")
- sub.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
+ col = split.column()
+ col.itemL(text="Bevel:")
+ col.itemR(curve, "bevel_depth", text="Depth")
+ col.itemR(curve, "bevel_resolution", text="Resolution")
+ col.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
class DATA_PT_pathanim(DataButtonsPanel):
__label__ = "Path Animation"
def draw_header(self, context):
- layout = self.layout
-
curve = context.curve
- layout.itemR(curve, "path", text="")
+ self.layout.itemR(curve, "path", text="")
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_data_lamp.py b/release/ui/buttons_data_lamp.py
index c1873d934c4..808a205b1b8 100644
--- a/release/ui/buttons_data_lamp.py
+++ b/release/ui/buttons_data_lamp.py
@@ -13,9 +13,7 @@ class DATA_PT_preview(DataButtonsPanel):
__label__ = "Preview"
def draw(self, context):
- layout = self.layout
-
- layout.template_preview(context.lamp)
+ self.layout.template_preview(context.lamp)
class DATA_PT_context_lamp(DataButtonsPanel):
__show_header__ = False
@@ -69,8 +67,7 @@ class DATA_PT_lamp(DataButtonsPanel):
if lamp.type == 'AREA':
col.itemR(lamp, "distance")
col.itemR(lamp, "gamma")
-
-
+
col = split.column()
col.itemR(lamp, "negative")
col.itemR(lamp, "layer", text="This Layer Only")
@@ -299,18 +296,12 @@ class DATA_PT_falloff_curve(DataButtonsPanel):
def poll(self, context):
lamp = context.lamp
- if lamp and lamp.type in ('POINT', 'SPOT'):
- if lamp.falloff_type == 'CUSTOM_CURVE':
- return True
-
- return False
+ return (lamp and lamp.type in ('POINT', 'SPOT') and lamp.falloff_type == 'CUSTOM_CURVE')
def draw(self, context):
- layout = self.layout
-
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_preview)
diff --git a/release/ui/buttons_data_lattice.py b/release/ui/buttons_data_lattice.py
index 5535f973b27..895c1a65bea 100644
--- a/release/ui/buttons_data_lattice.py
+++ b/release/ui/buttons_data_lattice.py
@@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
- return (context.lattice != None)
+ return (context.lattice)
class DATA_PT_context_lattice(DataButtonsPanel):
__show_header__ = False
diff --git a/release/ui/buttons_data_mesh.py b/release/ui/buttons_data_mesh.py
index 42b637e1f9d..33b3960b381 100644
--- a/release/ui/buttons_data_mesh.py
+++ b/release/ui/buttons_data_mesh.py
@@ -7,7 +7,7 @@ class DataButtonsPanel(bpy.types.Panel):
__context__ = "data"
def poll(self, context):
- return (context.mesh != None)
+ return (context.mesh)
class DATA_PT_context_mesh(DataButtonsPanel):
__show_header__ = False
diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py
index bc41b04d32c..66c8179f990 100644
--- a/release/ui/buttons_data_modifier.py
+++ b/release/ui/buttons_data_modifier.py
@@ -27,6 +27,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
# the mt.type enum is (ab)used for a lookup on function names
# ...to avoid lengthy if statements
# so each type must have a function here.
+
def ARMATURE(self, layout, ob, md):
layout.itemR(md, "object")
diff --git a/release/ui/buttons_data_text.py b/release/ui/buttons_data_text.py
index 1abc82cfaa3..aabf218122f 100644
--- a/release/ui/buttons_data_text.py
+++ b/release/ui/buttons_data_text.py
@@ -38,29 +38,29 @@ class DATA_PT_shape_text(DataButtonsPanel):
curve = context.curve
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.itemL(text="Caps:")
- col.itemR(curve, "front")
- col.itemR(curve, "back")
- col.itemL(text="Textures:")
- col.itemR(curve, "uv_orco")
- col.itemR(curve, "auto_texspace")
+ col = split.column()
+ col.itemL(text="Caps:")
+ col.itemR(curve, "front")
+ col.itemR(curve, "back")
+ col.itemL(text="Textures:")
+ col.itemR(curve, "uv_orco")
+ col.itemR(curve, "auto_texspace")
- col = split.column()
- col.itemL(text="Resolution:")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_u", text="Preview U")
- sub.itemR(curve, "render_resolution_u", text="Render U")
- sub = col.column(align=True)
- sub.itemR(curve, "resolution_v", text="Preview V")
- sub.itemR(curve, "render_resolution_v", text="Render V")
- col.itemL(text="Display:")
- col.itemR(curve, "fast")
+ col = split.column()
+ col.itemL(text="Resolution:")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_u", text="Preview U")
+ sub.itemR(curve, "render_resolution_u", text="Render U")
+ sub = col.column(align=True)
+ sub.itemR(curve, "resolution_v", text="Preview V")
+ sub.itemR(curve, "render_resolution_v", text="Render V")
+ col.itemL(text="Display:")
+ col.itemR(curve, "fast")
class DATA_PT_geometry_text(DataButtonsPanel):
__label__ = "Geometry"
diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py
index e28e3fda2c6..73ba566e23f 100644
--- a/release/ui/buttons_game.py
+++ b/release/ui/buttons_game.py
@@ -45,10 +45,9 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col = split.column()
col.itemL(text="Attributes:")
- sub = col.column()
- sub.itemR(game, "mass")
- sub.itemR(game, "radius")
- sub.itemR(game, "form_factor")
+ col.itemR(game, "mass")
+ col.itemR(game, "radius")
+ col.itemR(game, "form_factor")
col = split.column()
sub = col.column()
@@ -108,8 +107,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
col.itemR(soft, "dynamic_friction", slider=True)
col.itemR(soft, "margin", slider=True)
col.itemR(soft, "bending_const", text="Bending Constraints")
-
-
+
col = split.column()
col.itemR(soft, "shape_match")
sub = col.column()
@@ -134,32 +132,26 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel):
elif game.physics_type in ('SENSOR', 'INVISIBLE', 'NO_COLLISION', 'OCCLUDE'):
- col = layout.column()
- col.itemR(ob, "restrict_render", text="Invisible")
+ layout.itemR(ob, "restrict_render", text="Invisible")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel):
__label__ = "Collision Bounds"
def poll(self, context):
- ob = context.active_object
- game = ob.game
+ game = context.object.game
rd = context.scene.render_data
return (game.physics_type in ('DYNAMIC', 'RIGID_BODY', 'SENSOR', 'SOFT_BODY', 'STATIC')) and (rd.engine == 'BLENDER_GAME')
def draw_header(self, context):
- layout = self.layout
-
- ob = context.active_object
- game = ob.game
+ game = context.active_object.game
- layout.itemR(game, "use_collision_bounds", text="")
+ self.layout.itemR(game, "use_collision_bounds", text="")
def draw(self, context):
layout = self.layout
- ob = context.scene.objects[0]
- game = ob.game
-
+ game = context.active_object.game
+
layout.active = game.use_collision_bounds
layout.itemR(game, "collision_bounds", text="Bounds")
@@ -184,8 +176,6 @@ class SCENE_PT_game(SceneButtonsPanel):
def draw(self, context):
layout = self.layout
-
- rd = context.scene.render_data
row = layout.row()
row.itemO("view3d.game_start", text="Start")
diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py
index e317d990c39..dc11731d7a9 100644
--- a/release/ui/buttons_material.py
+++ b/release/ui/buttons_material.py
@@ -8,18 +8,16 @@ class MaterialButtonsPanel(bpy.types.Panel):
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
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):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER', 'BLENDER_GAME'])
def draw(self, context):
- layout = self.layout
-
- mat = context.material
-
- layout.template_preview(mat)
+ self.layout.template_preview(context.material)
class MATERIAL_PT_context_material(MaterialButtonsPanel):
__show_header__ = False
@@ -83,32 +81,27 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
layout = self.layout
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()
- sub = col.column()
- sub.active = not mat.shadeless
- sub.itemR(mat, "emit")
- sub.itemR(mat, "ambient")
- sub = col.column()
- sub.itemR(mat, "translucency")
+ col = split.column()
+ sub = col.column()
+ sub.active = not mat.shadeless
+ sub.itemR(mat, "emit")
+ sub.itemR(mat, "ambient")
+ sub = col.column()
+ sub.itemR(mat, "translucency")
- col = split.column()
- col.itemR(mat, "shadeless")
- sub = col.column()
- sub.active = not mat.shadeless
- sub.itemR(mat, "tangent_shading")
- sub.itemR(mat, "cubic")
+ col = split.column()
+ col.itemR(mat, "shadeless")
+ sub = col.column()
+ sub.active = not mat.shadeless
+ sub.itemR(mat, "tangent_shading")
+ sub.itemR(mat, "cubic")
- elif mat.type == 'HALO':
- layout.itemR(mat, "alpha")
+ elif mat.type == 'HALO':
+ layout.itemR(mat, "alpha")
class MATERIAL_PT_strand(MaterialButtonsPanel):
__label__ = "Strand"
@@ -158,8 +151,7 @@ class MATERIAL_PT_physics(MaterialButtonsPanel):
def draw(self, context):
layout = self.layout
- mat = context.material
- phys = mat.physics
+ phys = context.material.physics
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)
def draw_header(self, context):
- layout = self.layout
sss = context.material.subsurface_scattering
mat = context.material
- layout.active = (not mat.shadeless)
- layout.itemR(sss, "enabled", text="")
+ self.layout.active = (not mat.shadeless)
+ self.layout.itemR(sss, "enabled", text="")
def draw(self, context):
layout = self.layout
@@ -408,12 +399,10 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
- def draw_header(self, context):
- layout = self.layout
-
+ def draw_header(self, context):
raym = context.material.raytrace_mirror
- layout.itemR(raym, "enabled", text="")
+ self.layout.itemR(raym, "enabled", text="")
def draw(self, context):
layout = self.layout
@@ -465,11 +454,9 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
engine = context.scene.render_data.engine
return mat and (mat.type in ('SURFACE', 'WIRE')) and (engine in self.COMPAT_ENGINES)
- def draw_header(self, context):
- layout = self.layout
-
+ def draw_header(self, context):
mat = context.material
- layout.itemR(mat, "transparency", text="")
+ self.layout.itemR(mat, "transparency", text="")
def draw(self, context):
layout = self.layout
@@ -477,15 +464,14 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
mat = context.material
rayt = context.material.raytrace_transparency
- row= layout.row()
- row.itemR(mat, "transparency_method", expand=True)
+ row = layout.row()
row.active = mat.transparency and (not mat.shadeless)
+ row.itemR(mat, "transparency_method", expand=True)
split = layout.split()
col = split.column()
- row = col.row()
- row.itemR(mat, "alpha")
+ col.itemR(mat, "alpha")
row = col.row()
row.active = mat.transparency and (not mat.shadeless)
row.itemR(mat, "specular_alpha", text="Specular")
@@ -517,29 +503,130 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
sub.itemR(rayt, "gloss_threshold", text="Threshold")
sub.itemR(rayt, "gloss_samples", text="Samples")
-class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
- __label__ = "Shading"
- __default_closed__ = False
+class MATERIAL_PT_halo(MaterialButtonsPanel):
+ __label__= "Halo"
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)
+ return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
+
+ mat = context.material
+ halo = mat.halo
+
+ split = layout.split()
+
+ col = split.column()
+ col.itemR(mat, "diffuse_color", text="")
+ col.itemR(halo, "size")
+ col.itemR(halo, "hardness")
+ col.itemR(halo, "add")
+ col.itemL(text="Options:")
+ col.itemR(halo, "texture")
+ col.itemR(halo, "vertex_normal")
+ col.itemR(halo, "xalpha")
+ col.itemR(halo, "shaded")
+ col.itemR(halo, "soft")
+ col = split.column()
+ col.itemR(halo, "ring")
+ sub = col.column()
+ sub.active = halo.ring
+ sub.itemR(halo, "rings")
+ sub.itemR(mat, "mirror_color", text="")
+ col.itemS()
+ col.itemR(halo, "lines")
+ sub = col.column()
+ sub.active = halo.lines
+ sub.itemR(halo, "line_number", text="Lines")
+ sub.itemR(mat, "specular_color", text="")
+ col.itemS()
+ col.itemR(halo, "star")
+ sub = col.column()
+ sub.active = halo.star
+ sub.itemR(halo, "star_tips")
+
+class MATERIAL_PT_flare(MaterialButtonsPanel):
+ __label__= "Flare"
+ COMPAT_ENGINES = set(['BLENDER_RENDER'])
+
+ def poll(self, context):
mat = context.material
- vol = context.material.volume
+ engine = context.scene.render_data.engine
+ return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
+
+ def draw_header(self, context):
+ layout = self.layout
+
+ mat = context.material
+ halo = mat.halo
+ layout.itemR(halo, "flare_mode", text="")
+
+ def draw(self, context):
+ layout = self.layout
+
+ mat = context.material
+ halo = mat.halo
+
+ layout.active = halo.flare_mode
split = layout.split()
- row = split.row()
+ col = split.column()
+ col.itemR(halo, "flare_size", text="Size")
+ col.itemR(halo, "flare_boost", text="Boost")
+ col.itemR(halo, "flare_seed", text="Seed")
+ col = split.column()
+ col.itemR(halo, "flares_sub", text="Subflares")
+ col.itemR(halo, "flare_subsize", text="Subsize")
+
+bpy.types.register(MATERIAL_PT_context_material)
+bpy.types.register(MATERIAL_PT_preview)
+bpy.types.register(MATERIAL_PT_diffuse)
+bpy.types.register(MATERIAL_PT_specular)
+bpy.types.register(MATERIAL_PT_shading)
+bpy.types.register(MATERIAL_PT_transp)
+bpy.types.register(MATERIAL_PT_mirror)
+bpy.types.register(MATERIAL_PT_sss)
+bpy.types.register(MATERIAL_PT_halo)
+bpy.types.register(MATERIAL_PT_flare)
+bpy.types.register(MATERIAL_PT_physics)
+bpy.types.register(MATERIAL_PT_strand)
+bpy.types.register(MATERIAL_PT_options)
+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="")
@@ -548,20 +635,14 @@ class MATERIAL_PT_volume_shading(MaterialButtonsPanel):
col.itemR(vol, "emission")
col.itemR(vol, "emission_color", text="")
-class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
+class MATERIAL_PT_volume_scattering(VolumeButtonsPanel):
__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()
@@ -587,17 +668,9 @@ class MATERIAL_PT_volume_scattering(MaterialButtonsPanel):
if vol.phase_function in ('SCHLICK', 'HENYEY-GREENSTEIN'):
col.itemR(vol, "asymmetry")
-class MATERIAL_PT_volume_transp(MaterialButtonsPanel):
+class MATERIAL_PT_volume_transp(VolumeButtonsPanel):
__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
@@ -609,16 +682,11 @@ class MATERIAL_PT_volume_transp(MaterialButtonsPanel):
row.itemR(mat, "transparency_method", expand=True)
row.active = mat.transparency and (not mat.shadeless)
-class MATERIAL_PT_volume_integration(MaterialButtonsPanel):
+class MATERIAL_PT_volume_integration(VolumeButtonsPanel):
__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
@@ -638,104 +706,8 @@ class MATERIAL_PT_volume_integration(MaterialButtonsPanel):
col.itemL()
col.itemR(vol, "depth_cutoff")
col.itemR(vol, "density_scale")
-
-
-class MATERIAL_PT_halo(MaterialButtonsPanel):
- __label__= "Halo"
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- halo = mat.halo
-
- split = layout.split()
-
- col = split.column()
- col.itemR(mat, "diffuse_color", text="")
- col.itemR(halo, "size")
- col.itemR(halo, "hardness")
- col.itemR(halo, "add")
- col.itemL(text="Options:")
- col.itemR(halo, "texture")
- col.itemR(halo, "vertex_normal")
- col.itemR(halo, "xalpha")
- col.itemR(halo, "shaded")
- col.itemR(halo, "soft")
-
- col = split.column()
- col.itemR(halo, "ring")
- sub = col.column()
- sub.active = halo.ring
- sub.itemR(halo, "rings")
- sub.itemR(mat, "mirror_color", text="")
- col.itemS()
- col.itemR(halo, "lines")
- sub = col.column()
- sub.active = halo.lines
- sub.itemR(halo, "line_number", text="Lines")
- sub.itemR(mat, "specular_color", text="")
- col.itemS()
- col.itemR(halo, "star")
- sub = col.column()
- sub.active = halo.star
- sub.itemR(halo, "star_tips")
-
-class MATERIAL_PT_flare(MaterialButtonsPanel):
- __label__= "Flare"
- COMPAT_ENGINES = set(['BLENDER_RENDER'])
-
- def poll(self, context):
- mat = context.material
- engine = context.scene.render_data.engine
- return mat and (mat.type == 'HALO') and (engine in self.COMPAT_ENGINES)
-
- def draw_header(self, context):
- layout = self.layout
-
- mat = context.material
- halo = mat.halo
- layout.itemR(halo, "flare_mode", text="")
-
- def draw(self, context):
- layout = self.layout
-
- mat = context.material
- halo = mat.halo
-
- layout.active = halo.flare_mode
-
- split = layout.split()
-
- col = split.column()
- col.itemR(halo, "flare_size", text="Size")
- col.itemR(halo, "flare_boost", text="Boost")
- col.itemR(halo, "flare_seed", text="Seed")
- col = split.column()
- col.itemR(halo, "flares_sub", text="Subflares")
- col.itemR(halo, "flare_subsize", text="Subsize")
-bpy.types.register(MATERIAL_PT_context_material)
-bpy.types.register(MATERIAL_PT_preview)
-bpy.types.register(MATERIAL_PT_diffuse)
-bpy.types.register(MATERIAL_PT_specular)
-bpy.types.register(MATERIAL_PT_shading)
-bpy.types.register(MATERIAL_PT_transp)
-bpy.types.register(MATERIAL_PT_mirror)
-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_flare)
-bpy.types.register(MATERIAL_PT_physics)
-bpy.types.register(MATERIAL_PT_strand)
-bpy.types.register(MATERIAL_PT_options)
-bpy.types.register(MATERIAL_PT_shadow)
diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py
index a1978f44c18..5cdca3c2c74 100644
--- a/release/ui/buttons_physics_cloth.py
+++ b/release/ui/buttons_physics_cloth.py
@@ -103,11 +103,10 @@ class PHYSICS_PT_cloth_collision(PhysicButtonsPanel):
return (context.cloth)
def draw_header(self, context):
- layout = self.layout
cloth = context.cloth.collision_settings
- layout.active = cloth_panel_enabled(context.cloth)
- layout.itemR(cloth, "enable_collision", text="")
+ self.layout.active = cloth_panel_enabled(context.cloth)
+ self.layout.itemR(cloth, "enable_collision", text="")
def draw(self, context):
layout = self.layout
@@ -139,11 +138,10 @@ class PHYSICS_PT_cloth_stiffness(PhysicButtonsPanel):
return (context.cloth != None)
def draw_header(self, context):
- layout = self.layout
cloth = context.cloth.settings
- layout.active = cloth_panel_enabled(context.cloth)
- layout.itemR(cloth, "stiffness_scaling", text="")
+ self.layout.active = cloth_panel_enabled(context.cloth)
+ self.layout.itemR(cloth, "stiffness_scaling", text="")
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_physics_field.py b/release/ui/buttons_physics_field.py
index 3c68327ba79..58033d2c431 100644
--- a/release/ui/buttons_physics_field.py
+++ b/release/ui/buttons_physics_field.py
@@ -8,7 +8,7 @@ class PhysicButtonsPanel(bpy.types.Panel):
def poll(self, context):
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):
__label__ = "Force Fields"
diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py
index d7313632638..c87f71bff42 100644
--- a/release/ui/buttons_physics_smoke.py
+++ b/release/ui/buttons_physics_smoke.py
@@ -97,10 +97,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
def poll(self, context):
md = context.smoke
- if md:
- return (md.smoke_type == 'TYPE_DOMAIN')
-
- return False
+ return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
layout = self.layout
@@ -126,22 +123,15 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
def poll(self, context):
md = context.smoke
- if md:
- return (md.smoke_type == 'TYPE_DOMAIN')
-
- return False
+ return md and (md.smoke_type == 'TYPE_DOMAIN')
def draw(self, context):
layout = self.layout
- md = context.smoke
-
- if md.smoke_type == 'TYPE_DOMAIN':
-
- domain = md.domain_settings
- cache = domain.point_cache
+ md = context.smoke.domain_settings
+ cache = md.point_cache
- point_cache_ui(self, cache, cache.baked==False, 0, 1)
+ point_cache_ui(self, cache, cache.baked==False, 0, 1)
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
__label__ = "Smoke High Resolution"
@@ -149,95 +139,85 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
def poll(self, context):
md = context.smoke
- if md:
- return (md.smoke_type == 'TYPE_DOMAIN')
-
- return False
+ return md and (md.smoke_type == 'TYPE_DOMAIN')
- def draw_header(self, context):
- layout = self.layout
-
+ def draw_header(self, context):
high = context.smoke.domain_settings
- layout.itemR(high, "highres", text="")
+ self.layout.itemR(high, "highres", text="")
def draw(self, context):
layout = self.layout
md = context.smoke.domain_settings
-
- if md:
-
- split = layout.split()
+
+ split = layout.split()
- col = split.column()
- col.itemL(text="Resolution:")
- col.itemR(md, "amplify", text="Divisions")
+ col = split.column()
+ col.itemL(text="Resolution:")
+ col.itemR(md, "amplify", text="Divisions")
- sub = split.column()
- sub.itemL(text="Noise Method:")
- sub.row().itemR(md, "noise_type", text="")
- sub.itemR(md, "strength")
- sub.itemR(md, "show_highres")
+ col = split.column()
+ col.itemL(text="Noise Method:")
+ col.row().itemR(md, "noise_type", text="")
+ col.itemR(md, "strength")
+ col.itemR(md, "show_highres")
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
__label__ = "Smoke Cache"
__default_closed__ = True
def poll(self, context):
- return (context.smoke != None)
+ return (context.smoke)
def draw(self, context):
layout = self.layout
md = context.smoke
-
- if md:
-
- cache = md.point_cache
+
+ cache = md.point_cache
- layout.set_context_pointer("PointCache", 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.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, "name")
- row = layout.row()
- row.itemR(cache, "start_frame")
- row.itemR(cache, "end_frame")
+ row = layout.row()
+ row.itemR(cache, "start_frame")
+ row.itemR(cache, "end_frame")
- row = layout.row()
+ 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")
+ 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")
+ 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)
+ row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
- row = layout.row()
- #row.enabled = smoke_panel_enabled(psys)
+ row = layout.row()
+ #row.enabled = smoke_panel_enabled(psys)
- layout.itemL(text=cache.info)
+ layout.itemL(text=cache.info)
- layout.itemS()
+ 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")
-
+ 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_cache)
diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py
index 73eb15d2212..703977a056f 100644
--- a/release/ui/buttons_physics_softbody.py
+++ b/release/ui/buttons_physics_softbody.py
@@ -77,12 +77,10 @@ class PHYSICS_PT_softbody_goal(PhysicButtonsPanel):
return (context.soft_body)
def draw_header(self, context):
- layout = self.layout
-
softbody = context.soft_body.settings
- layout.active = softbody_panel_enabled(context.soft_body)
- layout.itemR(softbody, "use_goal", text="")
+ self.layout.active = softbody_panel_enabled(context.soft_body)
+ self.layout.itemR(softbody, "use_goal", text="")
def draw(self, context):
layout = self.layout
@@ -120,12 +118,10 @@ class PHYSICS_PT_softbody_edge(PhysicButtonsPanel):
return (context.soft_body)
def draw_header(self, context):
- #layout = self.layout
-
softbody = context.soft_body.settings
- layout.active = softbody_panel_enabled(context.soft_body)
- layout.itemR(softbody, "use_edges", text="")
+ self.layout.active = softbody_panel_enabled(context.soft_body)
+ self.layout.itemR(softbody, "use_edges", text="")
def draw(self, context):
layout = self.layout
@@ -170,12 +166,10 @@ class PHYSICS_PT_softbody_collision(PhysicButtonsPanel):
return (context.soft_body)
def draw_header(self, context):
- layout = self.layout
-
softbody = context.soft_body.settings
- layout.active = softbody_panel_enabled(context.soft_body)
- layout.itemR(softbody, "self_collision", text="")
+ self.layout.active = softbody_panel_enabled(context.soft_body)
+ self.layout.itemR(softbody, "self_collision", text="")
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_scene.py b/release/ui/buttons_scene.py
index abd42e32e35..126afc4ef23 100644
--- a/release/ui/buttons_scene.py
+++ b/release/ui/buttons_scene.py
@@ -323,11 +323,9 @@ class SCENE_PT_antialiasing(RenderButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
-
rd = context.scene.render_data
- layout.itemR(rd, "antialiasing", text="")
+ self.layout.itemR(rd, "antialiasing", text="")
def draw(self, context):
layout = self.layout
@@ -391,11 +389,9 @@ class SCENE_PT_stamp(RenderButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
-
rd = context.scene.render_data
- layout.itemR(rd, "render_stamp", text="")
+ self.layout.itemR(rd, "render_stamp", text="")
def draw(self, context):
layout = self.layout
diff --git a/release/ui/buttons_world.py b/release/ui/buttons_world.py
index 342adfaf4af..b02673d126f 100644
--- a/release/ui/buttons_world.py
+++ b/release/ui/buttons_world.py
@@ -9,17 +9,14 @@ class WorldButtonsPanel(bpy.types.Panel):
def poll(self, context):
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):
__label__ = "Preview"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw(self, context):
- layout = self.layout
- world = context.world
-
- layout.template_preview(world)
+ self.layout.template_preview(context.world)
class WORLD_PT_context_world(WorldButtonsPanel):
__show_header__ = False
@@ -52,32 +49,30 @@ class WORLD_PT_world(WorldButtonsPanel):
world = context.world
- if world:
-
- row = layout.row()
- row.itemR(world, "paper_sky")
- row.itemR(world, "blend_sky")
- row.itemR(world, "real_sky")
+ row = layout.row()
+ row.itemR(world, "paper_sky")
+ row.itemR(world, "blend_sky")
+ row.itemR(world, "real_sky")
- row = layout.row()
- row.column().itemR(world, "horizon_color")
- col = row.column()
- col.itemR(world, "zenith_color")
- col.active = world.blend_sky
- row.column().itemR(world, "ambient_color")
+ row = layout.row()
+ row.column().itemR(world, "horizon_color")
+ col = row.column()
+ col.itemR(world, "zenith_color")
+ col.active = world.blend_sky
+ row.column().itemR(world, "ambient_color")
class WORLD_PT_mist(WorldButtonsPanel):
__label__ = "Mist"
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.mist, "enabled", text="")
+ self.layout.itemR(world.mist, "enabled", text="")
def draw(self, context):
layout = self.layout
+
world = context.world
layout.active = world.mist.enabled
@@ -87,7 +82,6 @@ class WORLD_PT_mist(WorldButtonsPanel):
flow.itemR(world.mist, "start")
flow.itemR(world.mist, "depth")
flow.itemR(world.mist, "height")
-
layout.itemR(world.mist, "falloff")
@@ -96,13 +90,13 @@ class WORLD_PT_stars(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.stars, "enabled", text="")
+ self.layout.itemR(world.stars, "enabled", text="")
def draw(self, context):
layout = self.layout
+
world = context.world
layout.active = world.stars.enabled
@@ -118,13 +112,13 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel):
COMPAT_ENGINES = set(['BLENDER_RENDER'])
def draw_header(self, context):
- layout = self.layout
world = context.world
- layout.itemR(world.ambient_occlusion, "enabled", text="")
+ self.layout.itemR(world.ambient_occlusion, "enabled", text="")
def draw(self, context):
layout = self.layout
+
ao = context.world.ambient_occlusion
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_mist)
bpy.types.register(WORLD_PT_stars)
-
diff --git a/release/ui/space_image.py b/release/ui/space_image.py
index 8dc016f55b7..3f82727da47 100644
--- a/release/ui/space_image.py
+++ b/release/ui/space_image.py
@@ -7,6 +7,7 @@ class IMAGE_MT_view(bpy.types.Menu):
def draw(self, context):
layout = self.layout
+
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
@@ -69,6 +70,7 @@ class IMAGE_MT_image(bpy.types.Menu):
def draw(self, context):
layout = self.layout
+
sima = context.space_data
ima = sima.image
@@ -148,13 +150,13 @@ class IMAGE_MT_uvs_weldalign(bpy.types.Menu):
layout.itemO("uv.weld") # W, 1
layout.items_enumO("uv.align", "axis") # W, 2/3/4
-
class IMAGE_MT_uvs(bpy.types.Menu):
__space_type__ = 'IMAGE_EDITOR'
__label__ = "UVs"
def draw(self, context):
layout = self.layout
+
sima = context.space_data
uv = sima.uv_editor
settings = context.tool_settings
@@ -195,10 +197,11 @@ class IMAGE_HT_header(bpy.types.Header):
__space_type__ = 'IMAGE_EDITOR'
def draw(self, context):
+ layout = self.layout
+
sima = context.space_data
ima = sima.image
iuser = sima.image_user
- layout = self.layout
settings = context.tool_settings
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')
def draw(self, context):
- sima = context.space_data
layout = self.layout
-
+
+ sima = context.space_data
ima = sima.image
- if ima:
- split = layout.split()
-
- col = split.column()
-
- subcol = col.column(align=True)
- subcol.itemR(ima, "clamp_x")
- subcol.itemR(ima, "clamp_y")
+ split = layout.split()
- col.itemR(ima, "mapping", expand=True)
- col.itemR(ima, "tiles")
+ col = split.column()
+ col.itemR(ima, "clamp_x")
+ col.itemR(ima, "clamp_y")
+ col.itemR(ima, "mapping", expand=True)
+ col.itemR(ima, "tiles")
- col = split.column()
+ col = split.column()
- subcol = col.column(align=True)
- subcol.itemR(ima, "animated")
+ sub = col.column(align=True)
+ sub.itemR(ima, "animated")
- subcol = subcol.column()
- 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
+ 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")
- 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
+ sub = col.row(align=True)
+ sub.active = ima.tiles or ima.animated
+ sub.itemR(ima, "tiles_x", text="X")
+ sub.itemR(ima, "tiles_y", text="Y")
class IMAGE_PT_view_properties(bpy.types.Panel):
__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))
def draw(self, context):
- sima = context.space_data
layout = self.layout
-
+
+ sima = context.space_data
ima = sima.image
show_uvedit = sima.show_uvedit
uvedit = sima.uv_editor
@@ -376,4 +375,3 @@ bpy.types.register(IMAGE_MT_uvs)
bpy.types.register(IMAGE_HT_header)
bpy.types.register(IMAGE_PT_game_properties)
bpy.types.register(IMAGE_PT_view_properties)
-
diff --git a/release/ui/space_info.py b/release/ui/space_info.py
index 4188209e393..79937816791 100644
--- a/release/ui/space_info.py
+++ b/release/ui/space_info.py
@@ -79,6 +79,8 @@ class INFO_MT_file_import(bpy.types.Menu):
def draw(self, context):
layout = self.layout
+
+ layout.itemL(text="Nothing yet")
class INFO_MT_file_export(bpy.types.Menu):
__space_type__ = 'INFO'
diff --git a/release/ui/space_node.py b/release/ui/space_node.py
index 875aca7fd82..6ac1ac84f35 100644
--- a/release/ui/space_node.py
+++ b/release/ui/space_node.py
@@ -6,6 +6,7 @@ class NODE_HT_header(bpy.types.Header):
def draw(self, context):
layout = self.layout
+
snode = context.space_data
row = layout.row(align=True)
@@ -113,9 +114,7 @@ class NODE_MT_node(bpy.types.Menu):
# layout.itemS()
# layout.itemO("node.show_cyclic_dependencies")
-
bpy.types.register(NODE_HT_header)
bpy.types.register(NODE_MT_view)
bpy.types.register(NODE_MT_select)
bpy.types.register(NODE_MT_node)
-
diff --git a/release/ui/space_text.py b/release/ui/space_text.py
index 7b7ec176b72..117033c50a1 100644
--- a/release/ui/space_text.py
+++ b/release/ui/space_text.py
@@ -5,9 +5,10 @@ class TEXT_HT_header(bpy.types.Header):
__space_type__ = 'TEXT_EDITOR'
def draw(self, context):
+ layout = self.layout
+
st = context.space_data
text = st.text
- layout = self.layout
row = layout.row(align=True)
row.template_header()
@@ -50,8 +51,9 @@ class TEXT_PT_properties(bpy.types.Panel):
__label__ = "Properties"
def draw(self, context):
- st = context.space_data
layout = self.layout
+
+ st = context.space_data
flow = layout.column_flow()
flow.itemR(st, "line_numbers")
@@ -69,8 +71,9 @@ class TEXT_PT_find(bpy.types.Panel):
__label__ = "Find"
def draw(self, context):
- st = context.space_data
layout = self.layout
+
+ st = context.space_data
# find
col = layout.column(align=True)
@@ -100,6 +103,7 @@ class TEXT_MT_text(bpy.types.Menu):
def draw(self, context):
layout = self.layout
+
st = context.space_data
text = st.text
@@ -200,8 +204,7 @@ class TEXT_MT_edit(bpy.types.Menu):
__label__ = "Edit"
def poll(self, context):
- st = context.space_data
- return st.text != None
+ return (context.space_data.text)
def draw(self, context):
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_markers)
bpy.types.register(TEXT_MT_edit_to3d)
-
diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py
index 517571e1b09..0b7ccb15d6c 100644
--- a/release/ui/space_view3d_toolbar.py
+++ b/release/ui/space_view3d_toolbar.py
@@ -420,10 +420,11 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
context.texture_paint_object))
def draw(self, context):
+ layout = self.layout
+
settings = self.paint_settings(context)
brush = settings.brush
texture_paint = context.texture_paint_object
- layout = self.layout
if not texture_paint:
layout.itemR(brush, "smooth_stroke")
@@ -444,7 +445,6 @@ class VIEW3D_PT_tools_brush_stroke(PaintPanel):
col.active = brush.airbrush
col.itemR(brush, "rate", slider=True)
-
class VIEW3D_PT_tools_brush_curve(PaintPanel):
__label__ = "Curve"
__default_closed__ = True
@@ -454,9 +454,10 @@ class VIEW3D_PT_tools_brush_curve(PaintPanel):
return (settings and settings.brush and settings.brush.curve)
def draw(self, context):
+ layout = self.layout
+
settings = self.paint_settings(context)
brush = settings.brush
- layout = self.layout
layout.template_curve_mapping(brush.curve)
layout.item_menu_enumO("brush.curve_preset", property="shape")
@@ -469,6 +470,7 @@ class VIEW3D_PT_sculpt_options(PaintPanel):
def draw(self, context):
layout = self.layout
+
sculpt = context.tool_settings.sculpt
col = layout.column()
@@ -497,6 +499,7 @@ class VIEW3D_PT_tools_weightpaint(View3DPanel):
def draw(self, context):
layout = self.layout
+
wpaint = context.tool_settings.weight_paint
col = layout.column()
@@ -524,6 +527,7 @@ class VIEW3D_PT_tools_vertexpaint(View3DPanel):
def draw(self, context):
layout = self.layout
+
vpaint = context.tool_settings.vertex_paint
col = layout.column()
@@ -598,6 +602,7 @@ class VIEW3D_PT_tools_particlemode(View3DPanel):
def draw(self, context):
layout = self.layout
+
pe = context.tool_settings.particle_edit
ob = pe.object