From 07ed54218795bf14a3049f8e1a9ab1011e239656 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 6 Aug 2009 13:15:23 +0000 Subject: pedantic changes to python UI scripts - SOFTBODY -> SOFT_BODY - Use getattr() with enum value to get the modifier function rather then a lot of elif's --- release/ui/buttons_data_camera.py | 2 +- release/ui/buttons_data_metaball.py | 2 +- release/ui/buttons_data_modifier.py | 136 ++++++++++----------------------- release/ui/buttons_game.py | 2 +- release/ui/buttons_material.py | 18 ++--- release/ui/buttons_physics_cloth.py | 4 +- release/ui/buttons_physics_fluid.py | 4 +- release/ui/buttons_physics_softbody.py | 2 +- release/ui/buttons_texture.py | 29 +++---- release/ui/space_image.py | 10 +-- release/ui/space_info.py | 20 ++--- release/ui/space_text.py | 8 +- release/ui/space_view3d.py | 8 +- release/ui/space_view3d_toolbar.py | 8 +- 14 files changed, 95 insertions(+), 158 deletions(-) (limited to 'release') diff --git a/release/ui/buttons_data_camera.py b/release/ui/buttons_data_camera.py index 811858e3627..51d8c8c61e6 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) + return (context.camera != None) class DATA_PT_context_camera(DataButtonsPanel): __show_header__ = False diff --git a/release/ui/buttons_data_metaball.py b/release/ui/buttons_data_metaball.py index 74731473683..08959dab085 100644 --- a/release/ui/buttons_data_metaball.py +++ b/release/ui/buttons_data_metaball.py @@ -109,4 +109,4 @@ class DATA_PT_metaball_element(DataButtonsPanel): bpy.types.register(DATA_PT_context_metaball) bpy.types.register(DATA_PT_metaball) -bpy.types.register(DATA_PT_metaball_element) \ No newline at end of file +bpy.types.register(DATA_PT_metaball_element) diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index bd39ff1e70e..03950c707d2 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -16,76 +16,20 @@ class DATA_PT_modifiers(DataButtonsPanel): row = layout.row() row.item_menu_enumO("object.modifier_add", "type") - row.itemL(); + row.itemL() + + class_dict = self.__class__.__dict__ for md in ob.modifiers: box = layout.template_modifier(md) - if box: - if md.type == 'ARMATURE': - self.armature(box, ob, md) - elif md.type == 'ARRAY': - self.array(box, ob, md) - elif md.type == 'BEVEL': - self.bevel(box, ob, md) - elif md.type == 'BOOLEAN': - self.boolean(box, ob, md) - elif md.type == 'BUILD': - self.build(box, ob, md) - elif md.type == 'CAST': - self.cast(box, ob, md) - elif md.type == 'CLOTH': - self.cloth(box, ob, md) - elif md.type == 'COLLISION': - self.collision(box, ob, md) - elif md.type == 'CURVE': - self.curve(box, ob, md) - elif md.type == 'DECIMATE': - self.decimate(box, ob, md) - elif md.type == 'DISPLACE': - self.displace(box, ob, md) - elif md.type == 'EDGE_SPLIT': - self.edgesplit(box, ob, md) - elif md.type == 'EXPLODE': - self.explode(box, ob, md) - elif md.type == 'FLUID_SIMULATION': - self.fluid(box, ob, md) - elif md.type == 'HOOK': - self.hook(box, ob, md) - elif md.type == 'LATTICE': - self.lattice(box, ob, md) - elif md.type == 'MASK': - self.mask(box, ob, md) - elif md.type == 'MESH_DEFORM': - self.mesh_deform(box, ob, md) - elif md.type == 'MIRROR': - self.mirror(box, ob, md) - elif md.type == 'MULTIRES': - self.multires(box, ob, md) - elif md.type == 'PARTICLE_INSTANCE': - self.particleinstance(box, ob, md) - elif md.type == 'PARTICLE_SYSTEM': - self.particlesystem(box, ob, md) - elif md.type == 'SHRINKWRAP': - self.shrinkwrap(box, ob, md) - elif md.type == 'SIMPLE_DEFORM': - self.simpledeform(box, ob, md) - elif md.type == 'SMOKE': - self.smoke(box, ob, md) - elif md.type == 'SMOOTH': - self.smooth(box, ob, md) - elif md.type == 'SOFTBODY': - self.softbody(box, ob, md) - elif md.type == 'SUBSURF': - self.subsurf(box, ob, md) - elif md.type == 'SURFACE': - self.surface(box, ob, md) - elif md.type == 'UV_PROJECT': - self.uvproject(box, ob, md) - elif md.type == 'WAVE': - self.wave(box, ob, md) - - def armature(self, layout, ob, md): + # match enum type to our functions, avoids a lookup table. + getattr(self, md.type)(box, ob, md) + + # 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") row = layout.row() @@ -98,7 +42,7 @@ class DATA_PT_modifiers(DataButtonsPanel): flow.itemR(md, "quaternion") flow.itemR(md, "multi_modifier") - def array(self, layout, ob, md): + def ARRAY(self, layout, ob, md): layout.itemR(md, "fit_type") if md.fit_type == 'FIXED_COUNT': layout.itemR(md, "count") @@ -144,7 +88,7 @@ class DATA_PT_modifiers(DataButtonsPanel): col.itemR(md, "start_cap") col.itemR(md, "end_cap") - def bevel(self, layout, ob, md): + def BEVEL(self, layout, ob, md): row = layout.row() row.itemR(md, "width") row.itemR(md, "only_vertices") @@ -156,11 +100,11 @@ class DATA_PT_modifiers(DataButtonsPanel): elif md.limit_method == 'WEIGHT': layout.row().itemR(md, "edge_weight_method", expand=True) - def boolean(self, layout, ob, md): + def BOOLEAN(self, layout, ob, md): layout.itemR(md, "operation") layout.itemR(md, "object") - def build(self, layout, ob, md): + def BUILD(self, layout, ob, md): split = layout.split() col = split.column() @@ -173,7 +117,7 @@ class DATA_PT_modifiers(DataButtonsPanel): sub.active = md.randomize sub.itemR(md, "seed") - def cast(self, layout, ob, md): + def CAST(self, layout, ob, md): layout.itemR(md, "cast_type") layout.itemR(md, "object") if md.object: @@ -191,22 +135,22 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") - def cloth(self, layout, ob, md): + def CLOTH(self, layout, ob, md): layout.itemL(text="See Cloth panel.") - def collision(self, layout, ob, md): + def COLLISION(self, layout, ob, md): layout.itemL(text="See Collision panel.") - def curve(self, layout, ob, md): + def CURVE(self, layout, ob, md): layout.itemR(md, "object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "deform_axis") - def decimate(self, layout, ob, md): + def DECIMATE(self, layout, ob, md): layout.itemR(md, "ratio") layout.itemR(md, "face_count") - def displace(self, layout, ob, md): + def DISPLACE(self, layout, ob, md): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "texture") layout.itemR(md, "midlevel") @@ -218,7 +162,7 @@ class DATA_PT_modifiers(DataButtonsPanel): elif md.texture_coordinates == 'UV' and ob.type == 'MESH': layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") - def edgesplit(self, layout, ob, md): + def EDGE_SPLIT(self, layout, ob, md): split = layout.split() col = split.column() @@ -230,7 +174,7 @@ class DATA_PT_modifiers(DataButtonsPanel): col = split.column() col.itemR(md, "use_sharp", text="Sharp Edges") - def explode(self, layout, ob, md): + def EXPLODE(self, layout, ob, md): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "protect") layout.itemR(md, "split_edges") @@ -239,21 +183,21 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemR(md, "dead") # Missing: "Refresh" and "Clear Vertex Group" Operator - def fluid(self, layout, ob, md): + def FLUID_SIMULATION(self, layout, ob, md): layout.itemL(text="See Fluid panel.") - def hook(self, layout, ob, md): + def HOOK(self, layout, ob, md): layout.itemR(md, "falloff") layout.itemR(md, "force", slider=True) layout.itemR(md, "object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") # Missing: "Reset" and "Recenter" Operator - def lattice(self, layout, ob, md): + def LATTICE(self, layout, ob, md): layout.itemR(md, "object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") - def mask(self, layout, ob, md): + def MASK(self, layout, ob, md): layout.itemR(md, "mode") if md.mode == 'ARMATURE': layout.itemR(md, "armature") @@ -261,7 +205,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "inverse") - def mesh_deform(self, layout, ob, md): + def MESH_DEFORM(self, layout, ob, md): layout.itemR(md, "object") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "invert") @@ -273,7 +217,7 @@ class DATA_PT_modifiers(DataButtonsPanel): row.itemR(md, "precision") row.itemR(md, "dynamic") - def mirror(self, layout, ob, md): + def MIRROR(self, layout, ob, md): layout.itemR(md, "merge_limit") split = layout.split() @@ -293,12 +237,12 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemR(md, "mirror_object") - def multires(self, layout, ob, md): + def MULTIRES(self, layout, ob, md): layout.itemR(md, "subdivision_type") layout.itemO("object.multires_subdivide", text="Subdivide") layout.itemR(md, "level") - def particleinstance(self, layout, ob, md): + def PARTICLE_INSTANCE(self, layout, ob, md): layout.itemR(md, "object") layout.itemR(md, "particle_system_number") @@ -321,10 +265,10 @@ class DATA_PT_modifiers(DataButtonsPanel): row.itemR(md, "position", slider=True) row.itemR(md, "random_position", text = "Random", slider=True) - def particlesystem(self, layout, ob, md): + def PARTICLE_SYSTEM(self, layout, ob, md): layout.itemL(text="See Particle panel.") - def shrinkwrap(self, layout, ob, md): + def SHRINKWRAP(self, layout, ob, md): layout.itemR(md, "target") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "offset") @@ -347,7 +291,7 @@ class DATA_PT_modifiers(DataButtonsPanel): elif md.mode == 'NEAREST_SURFACEPOINT': layout.itemR(md, "keep_above_surface") - def simpledeform(self, layout, ob, md): + def SIMPLE_DEFORM(self, layout, ob, md): layout.itemR(md, "mode") layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") layout.itemR(md, "origin") @@ -358,7 +302,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemR(md, "lock_x_axis") layout.itemR(md, "lock_y_axis") - def smoke(self, layout, ob, md): + def SMOKE(self, layout, ob, md): layout.itemR(md, "smoke_type") if md.smoke_type == 'TYPE_DOMAIN': @@ -383,7 +327,7 @@ class DATA_PT_modifiers(DataButtonsPanel): elif md.smoke_type == 'TYPE_COLL': layout.itemS() - def smooth(self, layout, ob, md): + def SMOOTH(self, layout, ob, md): split = layout.split() col = split.column() @@ -397,10 +341,10 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.item_pointerR(md, "vertex_group", ob, "vertex_groups") - def softbody(self, layout, ob, md): + def SOFT_BODY(self, layout, ob, md): layout.itemL(text="See Soft Body panel.") - def subsurf(self, layout, ob, md): + def SUBSURF(self, layout, ob, md): layout.itemR(md, "subdivision_type") flow = layout.column_flow() @@ -409,10 +353,10 @@ class DATA_PT_modifiers(DataButtonsPanel): flow.itemR(md, "optimal_draw", text="Optimal Display") flow.itemR(md, "subsurf_uv") - def surface(self, layout, ob, md): + def SURFACE(self, layout, ob, md): layout.itemL(text="See Fields panel.") - def uvproject(self, layout, ob, md): + def UV_PROJECT(self, layout, ob, md): if ob.type == 'MESH': layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers") #layout.itemR(md, "projectors") @@ -422,7 +366,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemR(md, "override_image") #"Projectors" don't work. - def wave(self, layout, ob, md): + def WAVE(self, layout, ob, md): split = layout.split() col = split.column() diff --git a/release/ui/buttons_game.py b/release/ui/buttons_game.py index 9635ecfa67c..2d29a45028d 100644 --- a/release/ui/buttons_game.py +++ b/release/ui/buttons_game.py @@ -279,7 +279,7 @@ class WORLD_PT_game_physics(WorldButtonsPanel): gs = context.scene.game_data layout.itemR(gs, "physics_engine") - if gs.physics_engine != "NONE": + if gs.physics_engine != 'NONE': layout.itemR(gs, "physics_gravity", text="Gravity") split = layout.split() diff --git a/release/ui/buttons_material.py b/release/ui/buttons_material.py index b570deebfe2..4e03b2b4fd0 100644 --- a/release/ui/buttons_material.py +++ b/release/ui/buttons_material.py @@ -127,7 +127,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): col.itemR(tan, "min_size", text="Minimum") col.itemR(tan, "blender_units") sub = col.column() - sub.active = mat.shadeless == False + sub.active = (not mat.shadeless) sub.itemR(tan, "tangent_shading") col = split.column() @@ -135,7 +135,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel): col.itemR(tan, "width_fade") col.itemR(tan, "uv_layer") sub = col.column() - sub.active = mat.shadeless == False + sub.active = (not mat.shadeless) sub.itemR(tan, "surface_diffuse") sub = col.column() sub.active = tan.surface_diffuse @@ -197,7 +197,7 @@ class MATERIAL_PT_shadows(MaterialButtonsPanel): col.itemR(mat, "ray_shadow_bias", text="Auto Ray Bias") sub = col.column() subsub = sub.column() - subsub.active = not mat.ray_shadow_bias + subsub.active = (not mat.ray_shadow_bias) subsub.itemR(mat, "shadow_ray_bias", text="Ray Shadow Bias") sub.itemR(mat, "cast_buffer_shadows") sub.itemR(mat, "shadow_buffer_bias", text="Buffer Bias") @@ -219,16 +219,16 @@ class MATERIAL_PT_diffuse(MaterialButtonsPanel): col = split.column() col.itemR(mat, "diffuse_color", text="") sub = col.column() - sub.active = mat.shadeless== False + sub.active = (not mat.shadeless) sub.itemR(mat, "diffuse_reflection", text="Intensity", slider=True) col = split.column() - col.active = mat.shadeless== False + col.active = (not mat.shadeless) col.itemR(mat, "diffuse_shader", text="") col.itemR(mat, "use_diffuse_ramp", text="Ramp") col = layout.column() - col.active = mat.shadeless== False + col.active = (not mat.shadeless) if mat.diffuse_shader == 'OREN_NAYAR': col.itemR(mat, "roughness") elif mat.diffuse_shader == 'MINNAERT': @@ -267,7 +267,7 @@ class MATERIAL_PT_specular(MaterialButtonsPanel): mat = context.material - layout.active = mat.shadeless == False + layout.active = (not mat.shadeless) split = layout.split() @@ -328,7 +328,7 @@ class MATERIAL_PT_sss(MaterialButtonsPanel): layout.active = sss.enabled split = layout.split() - split.active = mat.shadeless== False + split.active = (not mat.shadeless) col = split.column(align=True) col.itemR(sss, "color", text="") @@ -418,7 +418,7 @@ class MATERIAL_PT_raytransp(MaterialButtonsPanel): mat = context.material rayt = context.material.raytrace_transparency - layout.active = rayt.enabled and mat.shadeless == False + layout.active = rayt.enabled and (not mat.shadeless) split = layout.split() diff --git a/release/ui/buttons_physics_cloth.py b/release/ui/buttons_physics_cloth.py index 372dc32d063..1bd1c507ccf 100644 --- a/release/ui/buttons_physics_cloth.py +++ b/release/ui/buttons_physics_cloth.py @@ -20,7 +20,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel): ob = context.object split = layout.split() - split.operator_context = "EXEC_DEFAULT" + split.operator_context = 'EXEC_DEFAULT' if md: # remove modifier + settings @@ -32,7 +32,7 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel): row.itemR(md, "realtime", text="") else: # add modifier - split.item_enumO("object.modifier_add", "type", "CLOTH", text="Add") + split.item_enumO("object.modifier_add", "type", 'CLOTH', text="Add") split.itemL() if md: diff --git a/release/ui/buttons_physics_fluid.py b/release/ui/buttons_physics_fluid.py index 17813beecaa..be695d66448 100644 --- a/release/ui/buttons_physics_fluid.py +++ b/release/ui/buttons_physics_fluid.py @@ -21,7 +21,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel): ob = context.object split = layout.split() - split.operator_context = "EXEC_DEFAULT" + split.operator_context = 'EXEC_DEFAULT' if md: # remove modifier + settings @@ -36,7 +36,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel): else: # add modifier - split.item_enumO("object.modifier_add", "type", "FLUID_SIMULATION", text="Add") + split.item_enumO("object.modifier_add", "type", 'FLUID_SIMULATION', text="Add") split.itemL() fluid = None diff --git a/release/ui/buttons_physics_softbody.py b/release/ui/buttons_physics_softbody.py index bff9b13f464..c17d6e3bcf9 100644 --- a/release/ui/buttons_physics_softbody.py +++ b/release/ui/buttons_physics_softbody.py @@ -33,7 +33,7 @@ class PHYSICS_PT_softbody(PhysicButtonsPanel): row.itemR(md, "realtime", text="") else: # add modifier - split.item_enumO("object.modifier_add", "type", "SOFTBODY", text="Add") + split.item_enumO("object.modifier_add", "type", 'SOFT_BODY', text="Add") split.itemL("") if md: diff --git a/release/ui/buttons_texture.py b/release/ui/buttons_texture.py index 5b1269c982c..98476530449 100644 --- a/release/ui/buttons_texture.py +++ b/release/ui/buttons_texture.py @@ -43,23 +43,14 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): layout = self.layout tex = context.texture - ma = context.material - la = context.lamp - wo = context.world - br = context.brush + + id = context.material + if not id: id = context.lamp + if not id: id = context.world + if not id: id = context.brush + space = context.space_data - if ma: - id = ma - elif la: - id = la - elif wo: - id = wo - elif br: - id = br - else: - id = None - if id: row = layout.row() row.template_list(id, "textures", id, "active_texture_index", rows=2) @@ -71,9 +62,11 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel): elif tex: split.template_ID(space, "pin_id") - if not space.pin_id and \ - (context.sculpt_object or context.vertex_paint_object or \ - context.weight_paint_object or context.texture_paint_object): + if (not space.pin_id) and ( context.sculpt_object or \ + context.vertex_paint_object or \ + context.weight_paint_object or \ + context.texture_paint_object \ + ): split.itemR(space, "brush_texture", text="Brush", toggle=True) layout.itemS() diff --git a/release/ui/space_image.py b/release/ui/space_image.py index eeac19c04e0..7154bb8ae1c 100644 --- a/release/ui/space_image.py +++ b/release/ui/space_image.py @@ -124,9 +124,9 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.item_enumO("tfm.transform", "mode", "TRANSLATION") - layout.item_enumO("tfm.transform", "mode", "ROTATION") - layout.item_enumO("tfm.transform", "mode", "RESIZE") + layout.item_enumO("tfm.transform", "mode", 'TRANSLATION') + layout.item_enumO("tfm.transform", "mode", 'ROTATION') + layout.item_enumO("tfm.transform", "mode", 'RESIZE') class IMAGE_MT_uvs_mirror(bpy.types.Menu): __space_type__ = "IMAGE_EDITOR" @@ -135,8 +135,8 @@ class IMAGE_MT_uvs_mirror(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.item_enumO("uv.mirror", "axis", "MIRROR_X") # "X Axis", M, - layout.item_enumO("uv.mirror", "axis", "MIRROR_Y") # "Y Axis", M, + layout.item_enumO("uv.mirror", "axis", 'MIRROR_X') # "X Axis", M, + layout.item_enumO("uv.mirror", "axis", 'MIRROR_Y') # "Y Axis", M, class IMAGE_MT_uvs_weldalign(bpy.types.Menu): __space_type__ = "IMAGE_EDITOR" diff --git a/release/ui/space_info.py b/release/ui/space_info.py index 855ce0b4f8f..686600ba4e7 100644 --- a/release/ui/space_info.py +++ b/release/ui/space_info.py @@ -110,22 +110,22 @@ class INFO_MT_add(bpy.types.Menu): layout.operator_context = "EXEC_SCREEN" - layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon="ICON_OUTLINER_OB_MESH") - layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon="ICON_OUTLINER_OB_CURVE") - layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon="ICON_OUTLINER_OB_SURFACE") - layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", "META", icon="ICON_OUTLINER_OB_META") - layout.itemO("OBJECT_OT_text_add", text="Text", icon="ICON_OUTLINER_OB_FONT") + layout.item_menu_enumO( "OBJECT_OT_mesh_add", "type", text="Mesh", icon='ICON_OUTLINER_OB_MESH') + layout.item_menu_enumO( "OBJECT_OT_curve_add", "type", text="Curve", icon='ICON_OUTLINER_OB_CURVE') + layout.item_menu_enumO( "OBJECT_OT_surface_add", "type", text="Surface", icon='ICON_OUTLINER_OB_SURFACE') + layout.item_menu_enumO( "OBJECT_OT_metaball_add", "type", 'META', icon='ICON_OUTLINER_OB_META') + layout.itemO("OBJECT_OT_text_add", text="Text", icon='ICON_OUTLINER_OB_FONT') layout.itemS() - layout.itemO("OBJECT_OT_armature_add", text="Armature", icon="ICON_OUTLINER_OB_ARMATURE") - layout.item_enumO("OBJECT_OT_object_add", "type", "LATTICE", icon="ICON_OUTLINER_OB_LATTICE") - layout.item_enumO("OBJECT_OT_object_add", "type", "EMPTY", icon="ICON_OUTLINER_OB_EMPTY") + layout.itemO("OBJECT_OT_armature_add", text="Armature", icon='ICON_OUTLINER_OB_ARMATURE') + layout.item_enumO("OBJECT_OT_object_add", "type", 'LATTICE', icon='ICON_OUTLINER_OB_LATTICE') + layout.item_enumO("OBJECT_OT_object_add", "type", 'EMPTY', icon='ICON_OUTLINER_OB_EMPTY') layout.itemS() - layout.item_enumO("OBJECT_OT_object_add", "type", "CAMERA", icon="ICON_OUTLINER_OB_CAMERA") - layout.item_enumO("OBJECT_OT_object_add", "type", "LAMP", icon="ICON_OUTLINER_OB_LAMP") + layout.item_enumO("OBJECT_OT_object_add", "type", 'CAMERA', icon='ICON_OUTLINER_OB_CAMERA') + layout.item_enumO("OBJECT_OT_object_add", "type", 'LAMP', icon='ICON_OUTLINER_OB_LAMP') class INFO_MT_game(bpy.types.Menu): __space_type__ = "USER_PREFERENCES" diff --git a/release/ui/space_text.py b/release/ui/space_text.py index 1b4fcea24b6..c54073c2938 100644 --- a/release/ui/space_text.py +++ b/release/ui/space_text.py @@ -34,9 +34,9 @@ class TEXT_HT_header(bpy.types.Header): row = layout.row() if text.filename != "": if text.dirty: - row.itemL(text="File: *" + text.filename + " (unsaved)") + row.itemL(text="File: *%s (unsaved)" % text.filename) else: - row.itemL(text="File: " + text.filename) + row.itemL(text="File: %s" % text.filename ) else: if text.library: row.itemL(text="Text: External") @@ -137,8 +137,8 @@ class TEXT_MT_edit_view(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.item_enumO("text.move", "type", "FILE_TOP", text="Top of File") - layout.item_enumO("text.move", "type", "FILE_BOTTOM", text="Bottom of File") + layout.item_enumO("text.move", "type", 'FILE_TOP', text="Top of File") + layout.item_enumO("text.move", "type", 'FILE_BOTTOM', text="Bottom of File") class TEXT_MT_edit_select(bpy.types.Menu): __space_type__ = "TEXT_EDITOR" diff --git a/release/ui/space_view3d.py b/release/ui/space_view3d.py index fc550982afa..5e0e2fa60b6 100644 --- a/release/ui/space_view3d.py +++ b/release/ui/space_view3d.py @@ -53,10 +53,10 @@ class VIEW3D_MT_view(bpy.types.Menu): layout.itemS() - layout.item_enumO("view3d.viewnumpad", "type", "CAMERA") - layout.item_enumO("view3d.viewnumpad", "type", "TOP") - layout.item_enumO("view3d.viewnumpad", "type", "FRONT") - layout.item_enumO("view3d.viewnumpad", "type", "RIGHT") + layout.item_enumO("view3d.viewnumpad", "type", 'CAMERA') + layout.item_enumO("view3d.viewnumpad", "type", 'TOP') + layout.item_enumO("view3d.viewnumpad", "type", 'FRONT') + layout.item_enumO("view3d.viewnumpad", "type", 'RIGHT') # layout.itemM("VIEW3D_MT_view_cameras", text="Cameras") diff --git a/release/ui/space_view3d_toolbar.py b/release/ui/space_view3d_toolbar.py index be57497a0b4..d41d3a37a21 100644 --- a/release/ui/space_view3d_toolbar.py +++ b/release/ui/space_view3d_toolbar.py @@ -353,12 +353,12 @@ class VIEW3D_PT_tools_brush(PaintPanel): elif context.texture_paint_object: col = layout.column(align=True) - col.item_enumR(settings, "tool", "DRAW") - col.item_enumR(settings, "tool", "SOFTEN") + col.item_enumR(settings, "tool", 'DRAW') + col.item_enumR(settings, "tool", 'SOFTEN') if settings.use_projection: - col.item_enumR(settings, "tool", "CLONE") + col.item_enumR(settings, "tool", 'CLONE') else: - col.item_enumR(settings, "tool", "SMEAR") + col.item_enumR(settings, "tool", 'SMEAR') col = layout.column() row = col.row(align=True) -- cgit v1.2.3