diff options
author | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-07-29 21:42:53 +0400 |
---|---|---|
committer | Xiao Xiangquan <xiaoxiangquan@gmail.com> | 2011-07-29 21:42:53 +0400 |
commit | 287b24926fefe078e4baae45808a5453b5c731bc (patch) | |
tree | e2336456d73c8b4bb5b9dad80cb475d5ea9c38d5 /release/scripts/startup/bl_ui | |
parent | e382a373f5c26be3279ce91b119cce1b24bec388 (diff) | |
parent | b948459031dd6d0f1ccc81d607a589fd7d1e8ab2 (diff) |
merge with trunk r38787
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_modifier.py | 1 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_material.py | 5 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/properties_world.py | 49 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_image.py | 6 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_info.py | 6 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_sequencer.py | 12 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_text.py | 60 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref.py | 22 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_userpref_keymap.py | 2 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 31 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d_toolbar.py | 3 |
11 files changed, 116 insertions, 81 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py index ce6d0990f05..0a4d0b60514 100644 --- a/release/scripts/startup/bl_ui/properties_data_modifier.py +++ b/release/scripts/startup/bl_ui/properties_data_modifier.py @@ -394,6 +394,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, bpy.types.Panel): col.operator("object.multires_higher_levels_delete", text="Delete Higher") col.operator("object.multires_reshape", text="Reshape") col.operator("object.multires_base_apply", text="Apply Base") + col.prop(md, "use_subsurf_uv") col.prop(md, "show_only_control_edges") layout.separator() diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py index 45c15bd1ce6..2a52ae23782 100644 --- a/release/scripts/startup/bl_ui/properties_material.py +++ b/release/scripts/startup/bl_ui/properties_material.py @@ -174,6 +174,7 @@ class MATERIAL_PT_pipeline(MaterialButtonsPanel, bpy.types.Panel): row.prop(mat, "use_transparency") sub = row.column() sub.prop(mat, "offset_z") + sub.active = mat_type and mat.use_transparency and mat.transparency_method == 'Z_TRANSPARENCY' row = layout.row() @@ -199,6 +200,7 @@ class MATERIAL_PT_pipeline(MaterialButtonsPanel, bpy.types.Panel): col.prop(mat, "shadow_cast_alpha", text="Casting Alpha") col.prop(mat, "use_cast_buffer_shadows") col.prop(mat, "use_cast_approximate") + col.prop(mat, "pass_index") class MATERIAL_PT_diffuse(MaterialButtonsPanel, bpy.types.Panel): @@ -729,7 +731,8 @@ class MATERIAL_PT_options(MaterialButtonsPanel, bpy.types.Panel): col.prop(mat, "use_vertex_color_paint") col.prop(mat, "use_vertex_color_light") col.prop(mat, "use_object_color") - col.prop(mat, "pass_index") + if simple_material(base_mat): + col.prop(mat, "pass_index") class MATERIAL_PT_shadow(MaterialButtonsPanel, bpy.types.Panel): diff --git a/release/scripts/startup/bl_ui/properties_world.py b/release/scripts/startup/bl_ui/properties_world.py index 4f398c9fbd9..63f8e88147b 100644 --- a/release/scripts/startup/bl_ui/properties_world.py +++ b/release/scripts/startup/bl_ui/properties_world.py @@ -19,8 +19,7 @@ # <pep8 compliant> import bpy from rna_prop_ui import PropertyPanel - -# TODO, "color_range" not in the UI +from blf import gettext as _ class WorldButtonsPanel(): @@ -64,7 +63,7 @@ class WORLD_PT_context_world(WorldButtonsPanel, bpy.types.Panel): class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Preview" + bl_label = _("Preview") COMPAT_ENGINES = {'BLENDER_RENDER'} @classmethod @@ -77,7 +76,7 @@ class WORLD_PT_preview(WorldButtonsPanel, bpy.types.Panel): class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel): - bl_label = "World" + bl_label = _("World") COMPAT_ENGINES = {'BLENDER_RENDER'} def draw(self, context): @@ -95,10 +94,14 @@ class WORLD_PT_world(WorldButtonsPanel, bpy.types.Panel): col.prop(world, "zenith_color") col.active = world.use_sky_blend row.column().prop(world, "ambient_color") + + row = layout.row() + row.prop(world, "exposure") + row.prop(world, "color_range") class WORLD_PT_ambient_occlusion(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Ambient Occlusion" + bl_label = _("Ambient Occlusion") COMPAT_ENGINES = {'BLENDER_RENDER'} def draw_header(self, context): @@ -112,12 +115,12 @@ class WORLD_PT_ambient_occlusion(WorldButtonsPanel, bpy.types.Panel): layout.active = light.use_ambient_occlusion split = layout.split() - split.prop(light, "ao_factor", text="Factor") + split.prop(light, "ao_factor", text=_("Factor")) split.prop(light, "ao_blend_type", text="") class WORLD_PT_environment_lighting(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Environment Lighting" + bl_label = _("Environment Lighting") COMPAT_ENGINES = {'BLENDER_RENDER'} def draw_header(self, context): @@ -131,12 +134,12 @@ class WORLD_PT_environment_lighting(WorldButtonsPanel, bpy.types.Panel): layout.active = light.use_environment_light split = layout.split() - split.prop(light, "environment_energy", text="Energy") + split.prop(light, "environment_energy", text=_("Energy")) split.prop(light, "environment_color", text="") class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Indirect Lighting" + bl_label = _("Indirect Lighting") COMPAT_ENGINES = {'BLENDER_RENDER'} def draw_header(self, context): @@ -150,15 +153,15 @@ class WORLD_PT_indirect_lighting(WorldButtonsPanel, bpy.types.Panel): layout.active = light.use_indirect_light and light.gather_method == 'APPROXIMATE' split = layout.split() - split.prop(light, "indirect_factor", text="Factor") - split.prop(light, "indirect_bounces", text="Bounces") + split.prop(light, "indirect_factor", text=_("Factor")) + split.prop(light, "indirect_bounces", text=_("Bounces")) if light.gather_method == 'RAYTRACE': - layout.label(text="Only works with Approximate gather method") + layout.label(text=_("Only works with Approximate gather method")) class WORLD_PT_gather(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Gather" + bl_label = _("Gather") COMPAT_ENGINES = {'BLENDER_RENDER'} def draw(self, context): @@ -172,18 +175,18 @@ class WORLD_PT_gather(WorldButtonsPanel, bpy.types.Panel): split = layout.split() col = split.column() - col.label(text="Attenuation:") + col.label(text=_("Attenuation:")) if light.gather_method == 'RAYTRACE': col.prop(light, "distance") col.prop(light, "use_falloff") sub = col.row() sub.active = light.use_falloff - sub.prop(light, "falloff_strength", text="Strength") + sub.prop(light, "falloff_strength", text=_("Strength")) if light.gather_method == 'RAYTRACE': col = split.column() - col.label(text="Sampling:") + col.label(text=_("Sampling:")) col.prop(light, "sample_method", text="") sub = col.column() @@ -198,15 +201,15 @@ class WORLD_PT_gather(WorldButtonsPanel, bpy.types.Panel): if light.gather_method == 'APPROXIMATE': col = split.column() - col.label(text="Sampling:") + col.label(text=_("Sampling:")) col.prop(light, "passes") - col.prop(light, "error_threshold", text="Error") + col.prop(light, "error_threshold", text=_("Error")) col.prop(light, "use_cache") col.prop(light, "correction") class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Mist" + bl_label = _("Mist") bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -235,7 +238,7 @@ class WORLD_PT_mist(WorldButtonsPanel, bpy.types.Panel): class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel): - bl_label = "Stars" + bl_label = _("Stars") bl_options = {'DEFAULT_CLOSED'} COMPAT_ENGINES = {'BLENDER_RENDER'} @@ -254,11 +257,11 @@ class WORLD_PT_stars(WorldButtonsPanel, bpy.types.Panel): col = split.column() col.prop(world.star_settings, "size") - col.prop(world.star_settings, "color_random", text="Colors") + col.prop(world.star_settings, "color_random", text=_("Colors")) col = split.column() - col.prop(world.star_settings, "distance_min", text="Min. Dist") - col.prop(world.star_settings, "average_separation", text="Separation") + col.prop(world.star_settings, "distance_min", text=_("Min. Dist")) + col.prop(world.star_settings, "average_separation", text=_("Separation")) class WORLD_PT_custom_props(WorldButtonsPanel, PropertyPanel, bpy.types.Panel): diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py index 6e0eded1d4c..15ba638dffb 100644 --- a/release/scripts/startup/bl_ui/space_image.py +++ b/release/scripts/startup/bl_ui/space_image.py @@ -64,7 +64,7 @@ class IMAGE_MT_view(bpy.types.Menu): ratios = [[1, 8], [1, 4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]] for a, b in ratios: - text = _("Zoom %d:%d") % (a, b) + text = _("Zoom") + " %d:%d" % (a, b) layout.operator("image.view_zoom_ratio", text=text).ratio = a / b layout.separator() @@ -199,6 +199,10 @@ class IMAGE_MT_uvs_transform(bpy.types.Menu): layout.operator("transform.rotate") layout.operator("transform.resize") + layout.separator() + + layout.operator("transform.shear") + class IMAGE_MT_uvs_snap(bpy.types.Menu): bl_label = _("Snap") diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py index 4254ec3c9ab..fadd3ec73be 100644 --- a/release/scripts/startup/bl_ui/space_info.py +++ b/release/scripts/startup/bl_ui/space_info.py @@ -61,8 +61,10 @@ class INFO_HT_header(bpy.types.Header): layout.template_running_jobs() layout.template_reports_banner() - - layout.label(text=scene.statistics()) + + row = layout.row(align=True) + row.operator("wm.splash", text="", icon='BLENDER', emboss=False) + row.label(text=scene.statistics()) # XXX: this should be right-aligned to the RHS of the region layout.operator("wm.window_fullscreen_toggle", icon='FULLSCREEN_ENTER', text="") diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py index e7276b82aba..1f9d45e9bc4 100644 --- a/release/scripts/startup/bl_ui/space_sequencer.py +++ b/release/scripts/startup/bl_ui/space_sequencer.py @@ -358,13 +358,13 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): col = layout.column(align=True) row = col.row() - row.label(text=_("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration)) + row.label(text=_("Final Length")+": %s" % bpy.utils.smpte_from_frame(strip.frame_final_duration)) row = col.row() row.active = (frame_current >= strip.frame_start and frame_current <= strip.frame_start + strip.frame_duration) - row.label(text=_("Playhead: %d") % (frame_current - strip.frame_start)) + row.label(text=_("Playhead")+": %d" % (frame_current - strip.frame_start)) - col.label(text=_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end)) - col.label(text=_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end)) + col.label(text=_("Frame Offset")+" %d:%d" % (strip.frame_offset_start, strip.frame_offset_end)) + col.label(text=_("Frame Still")+" %d:%d" % (strip.frame_still_start, strip.frame_still_end)) elem = False @@ -374,7 +374,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, bpy.types.Panel): elem = strip.elements[0] if elem and elem.orig_width > 0 and elem.orig_height > 0: - col.label(text=_("Orig Dim: %dx%d") % (elem.orig_width, elem.orig_height)) + col.label(text=_("Orig Dim")+": %dx%d" % (elem.orig_width, elem.orig_height)) class SEQUENCER_PT_effect(SequencerButtonsPanel, bpy.types.Panel): @@ -668,7 +668,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, bpy.types.Panel): if scene: sta = scene.frame_start end = scene.frame_end - layout.label(text=_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1)) + layout.label(text=_("Original frame range")+": %d-%d (%d)" % (sta, end, end - sta + 1)) class SEQUENCER_PT_filter(SequencerButtonsPanel, bpy.types.Panel): diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py index 0c3da2f5e1b..93e513acf0a 100644 --- a/release/scripts/startup/bl_ui/space_text.py +++ b/release/scripts/startup/bl_ui/space_text.py @@ -16,7 +16,7 @@ # # ##### END GPL LICENSE BLOCK ##### -# <pep8 compliant> +# <pep8-80 compliant> import bpy from blf import gettext as _ @@ -34,19 +34,21 @@ class TEXT_HT_header(bpy.types.Header): row.template_header() if context.area.show_menus: - sub = row.row(align=True) - sub.menu("TEXT_MT_view") - sub.menu("TEXT_MT_text") + row.menu("TEXT_MT_view") + row.menu("TEXT_MT_text") + if text: - sub.menu("TEXT_MT_edit") - sub.menu("TEXT_MT_format") + row.menu("TEXT_MT_edit") + row.menu("TEXT_MT_format") + + row.menu("TEXT_MT_templates") if text and text.is_modified: - row = layout.row() - row.alert = True - row.operator("text.resolve_conflict", text="", icon='HELP') + sub = row.row() + sub.alert = True + sub.operator("text.resolve_conflict", text="", icon='HELP') - layout.template_ID(st, "text", new="text.new", unlink="text.unlink") + row.template_ID(st, "text", new="text.new", unlink="text.unlink") row = layout.row(align=True) row.prop(st, "show_line_numbers", text="") @@ -64,11 +66,13 @@ class TEXT_HT_header(bpy.types.Header): row = layout.row() if text.filepath: if text.is_dirty: - row.label(text="File: *%s (unsaved)" % text.filepath) + row.label(text=_("File")+": *%r " % text.filepath+_("(unsaved)")) else: - row.label(text="File: %s" % text.filepath) + row.label(text=_("File")+": %r" % text.filepath) else: - row.label(text="Text: External" if text.library else "Text: Internal") + row.label(text=_("Text: External") + if text.library + else _("Text: Internal")) class TEXT_PT_properties(bpy.types.Panel): @@ -151,8 +155,12 @@ class TEXT_MT_view(bpy.types.Menu): layout.separator() - layout.operator("text.move", text=_("Top of File")).type = 'FILE_TOP' - layout.operator("text.move", text=_("Bottom of File")).type = 'FILE_BOTTOM' + layout.operator("text.move", + text=_("Top of File"), + ).type = 'FILE_TOP' + layout.operator("text.move", + text=_("Bottom of File"), + ).type = 'FILE_BOTTOM' class TEXT_MT_text(bpy.types.Menu): @@ -186,19 +194,15 @@ class TEXT_MT_text(bpy.types.Menu): # XXX uiMenuItemO(head, 0, "text.refresh_pyconstraints"); #endif - layout.separator() - - layout.menu("TEXT_MT_templates") - class TEXT_MT_templates(bpy.types.Menu): - ''' - Creates the menu items by scanning scripts/templates - ''' - bl_label = _("Script Templates") + bl_label = _("Templates") def draw(self, context): - self.path_menu(bpy.utils.script_paths("templates"), "text.open", {"internal": True}) + self.path_menu(bpy.utils.script_paths("templates"), + "text.open", + {"internal": True}, + ) class TEXT_MT_edit_select(bpy.types.Menu): @@ -247,8 +251,12 @@ class TEXT_MT_edit_to3d(bpy.types.Menu): def draw(self, context): layout = self.layout - layout.operator("text.to_3d_object", text=_("One Object")).split_lines = False - layout.operator("text.to_3d_object", text=_("One Object Per Line")).split_lines = True + layout.operator("text.to_3d_object", + text=_("One Object"), + ).split_lines = False + layout.operator("text.to_3d_object", + text=_("One Object Per Line"), + ).split_lines = True class TEXT_MT_edit(bpy.types.Menu): diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py index 900d38d1693..fb5f2de7115 100644 --- a/release/scripts/startup/bl_ui/space_userpref.py +++ b/release/scripts/startup/bl_ui/space_userpref.py @@ -355,7 +355,7 @@ class USERPREF_PT_edit(bpy.types.Panel): col.prop(edit, "use_duplicate_lamp", text=_("Lamp")) col.prop(edit, "use_duplicate_material", text=_("Material")) col.prop(edit, "use_duplicate_texture", text=_("Texture")) - #col.prop(edit, "use_duplicate_fcurve", text="F-Curve") + #col.prop(edit, "use_duplicate_fcurve", text=_("F-Curve")) col.prop(edit, "use_duplicate_action", text=_("Action")) col.prop(edit, "use_duplicate_particle", text=_("Particle")) @@ -656,7 +656,7 @@ class USERPREF_PT_theme(bpy.types.Panel): col = split.column() for i, ui in enumerate(theme.bone_color_sets): - col.label(text=_("Color Set %d:") % (i + 1)) # i starts from 0 + col.label(text=_("Color Set")+" %d:" % (i + 1)) # i starts from 0 row = col.row() @@ -889,6 +889,16 @@ class USERPREF_PT_addons(bpy.types.Panel): return True return False + @staticmethod + def draw_error(layout, message): + lines = message.split("\n") + box = layout.box() + rowsub = box.row() + rowsub.label(lines[0]) + rowsub.label(icon='ERROR') + for l in lines[1:]: + box.label(l) + def draw(self, context): layout = self.layout @@ -909,6 +919,14 @@ class USERPREF_PT_addons(bpy.types.Panel): col = split.column() + # set in addon_utils.modules(...) + if addon_utils.error_duplicates: + self.draw_error(col, + "Multiple addons using the same name found!\n" + "likely a problem with the script search path.\n" + "(see console for details)", + ) + filter = context.window_manager.addon_filter search = context.window_manager.addon_search.lower() support = context.window_manager.addon_support diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py index feb90cadd68..fde11a0ac29 100644 --- a/release/scripts/startup/bl_ui/space_userpref_keymap.py +++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py @@ -202,7 +202,7 @@ class InputKeyMapPanel: subcol = self.indented_layout(col, level + 1) subrow = subcol.row() subrow.prop(km, "show_expanded_items", text="", emboss=False) - subrow.label(text=_("%s (Global)") % _(km.name) ) + subrow.label(text="%s " % _(km.name) + _("(Global)") ) else: km.show_expanded_items = True diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9ead8bb98df..b4adc3bf028 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -55,21 +55,13 @@ class VIEW3D_HT_header(bpy.types.Header): sub.menu("VIEW3D_MT_object") row = layout.row() - row.template_header_3D() - - # do in C for now since these buttons cant be both toggle AND exclusive. - ''' - if obj and obj.mode == 'EDIT' and obj.type == 'MESH': - row_sub = row.row(align=True) - row_sub.prop(toolsettings, "mesh_select_mode", text="", index=0, icon='VERTEXSEL') - row_sub.prop(toolsettings, "mesh_select_mode", text="", index=1, icon='EDGESEL') - row_sub.prop(toolsettings, "mesh_select_mode", text="", index=2, icon='FACESEL') - ''' + # Contains buttons like Mode, Pivot, Manipulator, Layer, Mesh Select Mode... + row.template_header_3D() if obj: # Particle edit if obj.mode == 'PARTICLE_EDIT': - row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True, toggle=True) + row.prop(toolsettings.particle_edit, "select_mode", text="", expand=True) # Occlude geometry if view.viewport_shade in {'SOLID', 'SHADED', 'TEXTURED'} and (obj.mode == 'PARTICLE_EDIT' or (obj.mode == 'EDIT' and obj.type == 'MESH')): @@ -88,19 +80,22 @@ class VIEW3D_HT_header(bpy.types.Header): row.prop(toolsettings, "proportional_edit_falloff", text="", icon_only=True) # Snap + snap_element = toolsettings.snap_element row = layout.row(align=True) row.prop(toolsettings, "use_snap", text="") row.prop(toolsettings, "snap_element", text="", icon_only=True) - if toolsettings.snap_element != 'INCREMENT': + if snap_element != 'INCREMENT': row.prop(toolsettings, "snap_target", text="") - if obj and obj.mode == 'OBJECT': - row.prop(toolsettings, "use_snap_align_rotation", text="") - if toolsettings.snap_element == 'VOLUME': + if obj: + if obj.mode == 'OBJECT': + row.prop(toolsettings, "use_snap_align_rotation", text="") + elif obj.mode == 'EDIT': + row.prop(toolsettings, "use_snap_self", text="") + + if snap_element == 'VOLUME': row.prop(toolsettings, "use_snap_peel_object", text="") - elif toolsettings.snap_element == 'FACE': + elif snap_element == 'FACE': row.prop(toolsettings, "use_snap_project", text="") - if toolsettings.use_snap_project and obj.mode == 'EDIT': - row.prop(toolsettings, "use_snap_project_self", text="") # OpenGL render row = layout.row(align=True) diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py index f2370ec39ac..d029de3786c 100644 --- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py +++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py @@ -117,7 +117,8 @@ class VIEW3D_PT_tools_meshedit(View3DPanel, bpy.types.Panel): col.operator("transform.translate") col.operator("transform.rotate") col.operator("transform.resize", text="Scale") - col.operator("transform.shrink_fatten", text="Along Normal") + col.operator("transform.shrink_fatten", text=_("Shrink/Fatten")) + col.operator("transform.push_pull", text=_("Push/Pull")) col = layout.column(align=True) col.label(text="Deform:") |