Merged changes in the trunk up to revision 54421.

Conflicts resolved:
release/datafiles/startup.blend
release/scripts/startup/bl_ui/properties_render.py
source/blender/SConscript
source/blender/blenloader/intern/readfile.c
This commit is contained in:
2013-02-10 10:17:59 +00:00
560 changed files with 11623 additions and 8107 deletions

View File

@@ -234,7 +234,9 @@ class ConnectRigidBodies(Operator):
loc = (obj_act.location + obj.location) / 2.0
bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=loc)
bpy.ops.rigidbody.constraint_add()
con = context.active_object.rigid_body_constraint
con_obj = context.active_object
con_obj.empty_draw_type = 'ARROWS'
con = con_obj.rigid_body_constraint
con.type = self.con_type
con.object1 = obj_act
con.object2 = obj

View File

@@ -1740,8 +1740,7 @@ class WM_OT_addon_install(Operator):
return {'CANCELLED'}
# create dir is if missing.
if not os.path.exists(path_addons):
os.makedirs(path_addons)
os.makedirs(path_addons, exist_ok=True)
# Check if we are installing from a target path,
# doing so causes 2+ addons of same name or when the same from/to

View File

@@ -60,12 +60,12 @@ class MESH_UL_vgroups(UIList):
# assert(isinstance(item, bpy.types.VertexGroup)
vgroup = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(vgroup.name, icon_value=icon)
layout.label(text=vgroup.name, translate=False, icon_value=icon)
icon = 'LOCKED' if vgroup.lock_weight else 'UNLOCKED'
layout.prop(vgroup, "lock_weight", text="", icon=icon, emboss=False)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
class MESH_UL_shape_keys(UIList):
@@ -76,30 +76,30 @@ class MESH_UL_shape_keys(UIList):
key_block = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
split = layout.split(0.66, False)
split.label(item.name, icon_value=icon)
split.label(text=item.name, translate=False, icon_value=icon)
row = split.row(True)
if key_block.mute or (obj.mode == 'EDIT' and not (obj.use_shape_key_edit_mode and obj.type == 'MESH')):
row.active = False
if not item.relative_key or index > 0:
row.prop(key_block, "value", text="", emboss=False)
else:
row.label("")
row.label(text="")
row.prop(key_block, "mute", text="", emboss=False)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
class MESH_UL_uvmaps_vcols(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
# assert(isinstance(item, (bpy.types.MeshTexturePolyLayer, bpy.types.MeshLoopColorLayer))
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(item.name, icon_value=icon)
layout.label(text=item.name, translate=False, icon_value=icon)
icon = 'RESTRICT_RENDER_OFF' if item.active_render else 'RESTRICT_RENDER_ON'
layout.prop(item, "active_render", text="", icon=icon, emboss=False)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
class MeshButtonsPanel():

View File

@@ -265,7 +265,8 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.prop(md, "angle_limit")
layout.prop(md, "use_dissolve_boundaries")
layout.label(text="Face Count" + ": %d" % md.face_count)
pgettext = bpy.app.translations.pgettext
layout.label(text=pgettext("Face Count: %d") % md.face_count, translate=False)
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)

View File

@@ -32,7 +32,7 @@ class MASK_UL_layers(UIList):
mask = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
split = layout.split()
split.label(mask.name, icon_value=icon)
split.label(text=mask.name, translate=False, icon_value=icon)
row = split.row(align=True)
row.prop(mask, "alpha", text="", emboss=False)
row.prop(mask, "hide", text="", emboss=False)
@@ -40,7 +40,7 @@ class MASK_UL_layers(UIList):
row.prop(mask, "hide_render", text="", emboss=False)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
class MASK_PT_mask:

View File

@@ -76,16 +76,19 @@ class MATERIAL_UL_matslots(UIList):
slot = item
ma = slot.material
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(ma.name if ma else "", icon_value=icon)
layout.label(text=ma.name if ma else "", translate=False, icon_value=icon)
if ma and not context.scene.render.use_shading_nodes:
manode = ma.active_node_material
if manode:
layout.label("Node %s" % manode.name, icon_value=layout.icon(manode))
pgettext = bpy.app.translations.pgettext
layout.label(text=pgettext("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
elif ma.use_nodes:
layout.label("Node <none>")
layout.label(text="Node <none>")
else:
layout.label(text="")
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
class MaterialButtonsPanel():

View File

@@ -148,7 +148,8 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
#row.label(text="Render")
if part.is_fluid:
layout.label(text="%d fluid particles for this frame" % part.count)
pgettext = bpy.app.translations.pgettext
layout.label(text=pgettext("%d fluid particles for this frame") % part.count, translate=False)
return
row = col.row()

View File

@@ -33,7 +33,7 @@ class PHYSICS_UL_dynapaint_surfaces(UIList):
if self.layout_type in {'DEFAULT', 'COMPACT'}:
row = layout.row(align=True)
row.label(text="", icon_value=icon)
row.label(text=surf.name, icon_value=sticon)
row.label(text=surf.name, translate=False, icon_value=sticon)
row = layout.row(align=True)
if surf.use_color_preview:
row.prop(surf, "show_preview", text="", emboss=False,

View File

@@ -64,7 +64,9 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
if fluid.type == 'DOMAIN':
# odd formatting here so translation script can extract string
layout.operator("fluid.bake", text="Bake (Req. Memory:" + " %s)" % fluid.memory_estimate, icon='MOD_FLUIDSIM')
pgettext = bpy.app.translations.pgettext
layout.operator("fluid.bake", text=pgettext("Bake (Req. Memory: %s)") % fluid.memory_estimate,
translate=False, icon='MOD_FLUIDSIM')
split = layout.split()
col = split.column()

View File

@@ -43,7 +43,6 @@ class RENDER_MT_framerate_presets(Menu):
draw = Menu.draw_preset
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'

View File

@@ -32,10 +32,10 @@ class SCENE_UL_keying_set_paths(UIList):
kspath = item
icon = layout.enum_item_icon(kspath, "id_type", kspath.id_type)
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(kspath.data_path, icon_value=icon)
layout.label(text=kspath.data_path, translate=False, icon_value=icon)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
class SceneButtonsPanel():

View File

@@ -63,12 +63,12 @@ class TEXTURE_UL_texslots(UIList):
slot = item
tex = slot.texture if slot else None
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(tex.name if tex else "", icon_value=icon)
layout.label(text=tex.name if tex else "", translate=False, icon_value=icon)
if tex and isinstance(item, bpy.types.MaterialTextureSlot):
layout.prop(ma, "use_textures", text="", index=index)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon_value=icon)
layout.label(text="", icon_value=icon)
from bl_ui.properties_material import active_node_mat

View File

@@ -28,12 +28,10 @@ class CLIP_UL_tracking_objects(UIList):
# assert(isinstance(item, bpy.types.MovieTrackingObject)
tobj = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(tobj.name, icon='CAMERA_DATA'
if tobj.is_camera else 'OBJECT_DATA')
layout.label(text=tobj.name, translate=False, icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon='CAMERA_DATA'
if tobj.is_camera else 'OBJECT_DATA')
layout.label(text="", icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
class CLIP_HT_header(Header):
@@ -909,10 +907,11 @@ class CLIP_MT_view(Menu):
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
text = bpy.app.translations.pgettext("Zoom %d:%d")
for a, b in ratios:
text = "Zoom %d:%d" % (a, b)
layout.operator("clip.view_zoom_ratio",
text=text).ratio = a / b
text=text % (a, b),
translate=False).ratio = a / b
else:
if sc.view == 'GRAPH':
layout.operator_context = 'INVOKE_REGION_PREVIEW'

View File

@@ -80,7 +80,9 @@ class CONSOLE_MT_language(Menu):
languages.sort()
for language in languages:
layout.operator("console.language", text=language[0].upper() + language[1:]).language = language
layout.operator("console.language",
text=language.title(),
translate=False).language = language
def add_scrollback(text, text_type):

View File

@@ -70,8 +70,10 @@ class IMAGE_MT_view(Menu):
ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
pgettext = bpy.app.translations.pgettext
for a, b in ratios:
layout.operator("image.view_zoom_ratio", text="Zoom" + " %d:%d" % (a, b)).ratio = a / b
layout.operator("image.view_zoom_ratio", text=pgettext("Zoom %d:%d") % (a, b),
translate=False).ratio = a / b
layout.separator()

View File

@@ -420,15 +420,19 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
sub.prop(strip, "frame_start")
sub.prop(strip, "frame_final_duration")
pgettext = bpy.app.translations.pgettext
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=pgettext("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
translate=False)
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=pgettext("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
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=pgettext("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
translate=False)
col.label(text=pgettext("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end),
translate=False)
elem = False
@@ -438,7 +442,7 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel, Panel):
elem = strip.elements[0]
if elem and elem.orig_width > 0 and elem.orig_height > 0:
col.label(text="Original Dimension" + ": %dx%d" % (elem.orig_width, elem.orig_height))
col.label(text=pgettext("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
else:
col.label(text="Original Dimension: None")
@@ -715,7 +719,8 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, 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))
pgettext = bpy.app.translations.pgettext
layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
@@ -744,7 +749,8 @@ class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
if mask:
sta = mask.frame_start
end = mask.frame_end
layout.label(text="Original frame range" + ": %d-%d (%d)" % (sta, end, end - sta + 1))
pgettext = bpy.app.translations.pgettext
layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):

View File

@@ -71,12 +71,13 @@ class TEXT_HT_header(Header):
row = layout.row()
if text.filepath:
pgettext = bpy.app.translations.pgettext
if text.is_dirty:
row.label(text="File" + ": *%r " %
text.filepath + "(unsaved)")
row.label(text=pgettext("File: *%r (unsaved)") %
text.filepath, translate=False)
else:
row.label(text="File" + ": %r" %
text.filepath)
row.label(text=pgettext("File: %r") %
text.filepath, translate=False)
else:
row.label(text="Text: External"
if text.library

View File

@@ -19,7 +19,6 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
import os
def ui_style_items(col, context):
@@ -183,6 +182,7 @@ class USERPREF_PT_interface(Panel):
return (userpref.active_section == 'INTERFACE')
def draw(self, context):
import sys
layout = self.layout
userpref = context.user_preferences
@@ -268,7 +268,7 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "show_splash")
if os.name == "nt":
if sys.platform[:3] == "win":
col.prop(view, "use_quit_dialog")
@@ -403,6 +403,7 @@ class USERPREF_PT_system(Panel):
return (userpref.active_section == 'SYSTEM')
def draw(self, context):
import sys
layout = self.layout
userpref = context.user_preferences
@@ -466,6 +467,9 @@ class USERPREF_PT_system(Panel):
col.label(text="Window Draw Method:")
col.prop(system, "window_draw_method", text="")
col.prop(system, "multi_sample", text="")
if sys.platform == "linux" and system.multi_sample != 'NONE':
col.label(text="Might fail for Mesh editing selection!")
col.separator()
col.prop(system, "use_region_overlap")
col.label(text="Text Draw Options:")
col.prop(system, "use_text_antialiasing")
@@ -774,9 +778,10 @@ class USERPREF_PT_theme(Panel):
layout.separator()
elif theme.theme_area == 'BONE_COLOR_SETS':
col = split.column()
pgettext = bpy.app.translations.pgettext
for i, ui in enumerate(theme.bone_color_sets):
col.label(text="Color Set" + " %d:" % (i + 1)) # i starts from 0
col.label(text=pgettext("Color Set %d:") % (i + 1), translate=False) # i starts from 0
row = col.row()
@@ -963,6 +968,8 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
return (userpref.active_section == 'INPUT')
def draw_input_prefs(self, inputs, layout):
import sys
# General settings
row = layout.row()
col = row.column()
@@ -1015,6 +1022,11 @@ class USERPREF_PT_input(Panel, InputKeyMapPanel):
sub.prop(inputs, "invert_zoom_wheel", text="Invert Wheel Zoom Direction")
#sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
if sys.platform == "darwin":
sub = col.column()
sub.label(text="Trackpad:")
sub.prop(inputs, "use_trackpad_natural")
col.separator()
sub = col.column()
sub.label(text="NDOF Device:")
@@ -1077,6 +1089,8 @@ class USERPREF_PT_addons(Panel):
@staticmethod
def is_user_addon(mod, user_addon_paths):
import os
if not user_addon_paths:
for path in (bpy.utils.script_path_user(),
bpy.utils.script_path_pref()):
@@ -1099,6 +1113,7 @@ class USERPREF_PT_addons(Panel):
box.label(l)
def draw(self, context):
import os
import addon_utils
layout = self.layout
@@ -1203,15 +1218,15 @@ class USERPREF_PT_addons(Panel):
if mod:
split = colsub.row().split(percentage=0.15)
split.label(text="File:")
split.label(text=mod.__file__)
split.label(text=mod.__file__, translate=False)
if info["author"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Author:")
split.label(text=info["author"])
split.label(text=info["author"], translate=False)
if info["version"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Version:")
split.label(text='.'.join(str(x) for x in info["version"]))
split.label(text='.'.join(str(x) for x in info["version"]), translate=False)
if info["warning"]:
split = colsub.row().split(percentage=0.15)
split.label(text="Warning:")
@@ -1268,7 +1283,7 @@ class USERPREF_PT_addons(Panel):
colsub = box.column()
row = colsub.row()
row.label(text=module_name, icon='ERROR')
row.label(text=module_name, translate=False, icon='ERROR')
if is_enabled:
row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name

View File

@@ -97,7 +97,8 @@ 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 " % km.name + "(Global)")
pgettext = bpy.app.translations.pgettext
subrow.label(text=pgettext("%s (Global)") % km.name, translate=False)
else:
km.show_expanded_items = True
@@ -172,17 +173,17 @@ class InputKeyMapPanel:
if kmi.show_expanded:
box = col.box()
split = box.split(percentage=0.4)
sub = split.row()
if km.is_modal:
sub.prop(kmi, "propvalue", text="")
else:
# One day...
#~ sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="")
sub.prop(kmi, "idname", text="")
if map_type not in {'TEXTINPUT', 'TIMER'}:
split = box.split(percentage=0.4)
sub = split.row()
if km.is_modal:
sub.prop(kmi, "propvalue", text="")
else:
# One day...
#~ sub.prop_search(kmi, "idname", bpy.context.window_manager, "operators_all", text="")
sub.prop(kmi, "idname", text="")
sub = split.column()
subrow = sub.row(align=True)

View File

@@ -1682,7 +1682,6 @@ class VIEW3D_MT_edit_mesh(Menu):
layout.operator("view3d.edit_mesh_extrude_individual_move", text="Extrude Individual")
layout.operator("mesh.duplicate_move")
layout.menu("VIEW3D_MT_edit_mesh_delete")
layout.menu("VIEW3D_MT_edit_mesh_dissolve")
layout.separator()
@@ -1957,21 +1956,12 @@ class VIEW3D_MT_edit_mesh_delete(Menu):
layout.separator()
layout.operator("mesh.dissolve")
layout.operator("mesh.edge_collapse")
layout.operator("mesh.delete_edgeloop", text="Edge Loop")
class VIEW3D_MT_edit_mesh_dissolve(Menu):
bl_label = "Dissolve"
def draw(self, context):
layout = self.layout
layout.operator("mesh.dissolve")
layout.operator("mesh.dissolve_limited")
layout.separator()
layout.operator("mesh.dissolve_limited")
layout.operator("mesh.edge_collapse")
layout.operator("mesh.delete_edgeloop", text="Edge Loop")
class VIEW3D_MT_edit_mesh_showhide(ShowHideMenu, Menu):

View File

@@ -1142,14 +1142,14 @@ class VIEW3D_PT_tools_projectpaint(View3DPanel, Panel):
row = split.row()
row.active = (ipaint.use_stencil_layer)
stencil_text = mesh.uv_texture_stencil.name if mesh.uv_texture_stencil else ""
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text)
row.menu("VIEW3D_MT_tools_projectpaint_stencil", text=stencil_text, translate=False)
row.prop(ipaint, "invert_stencil", text="", icon='IMAGE_ALPHA')
col = layout.column()
col.active = (settings.brush.image_tool == 'CLONE')
col.prop(ipaint, "use_clone_layer", text="Clone from UV map")
clone_text = mesh.uv_texture_clone.name if mesh.uv_texture_clone else ""
col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text)
col.menu("VIEW3D_MT_tools_projectpaint_clone", text=clone_text, translate=False)
layout.prop(ipaint, "seam_bleed")
@@ -1188,7 +1188,7 @@ class VIEW3D_MT_tools_projectpaint_clone(Menu):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
props = layout.operator("wm.context_set_int", text=tex.name)
props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
props.data_path = "active_object.data.uv_texture_clone_index"
props.value = i
@@ -1199,7 +1199,7 @@ class VIEW3D_MT_tools_projectpaint_stencil(Menu):
def draw(self, context):
layout = self.layout
for i, tex in enumerate(context.active_object.data.uv_textures):
props = layout.operator("wm.context_set_int", text=tex.name)
props = layout.operator("wm.context_set_int", text=tex.name, translate=False)
props.data_path = "active_object.data.uv_texture_stencil_index"
props.value = i