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:
Diffstat (limited to 'release/scripts/startup')
-rw-r--r--release/scripts/startup/bl_operators/rigidbody.py17
-rw-r--r--release/scripts/startup/bl_ui/properties_data_armature.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_data_modifier.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_material.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_paint_common.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_particle.py6
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py16
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_fluid.py4
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_rigidbody.py44
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py2
-rw-r--r--release/scripts/startup/bl_ui/properties_scene.py1
-rw-r--r--release/scripts/startup/bl_ui/space_clip.py11
-rw-r--r--release/scripts/startup/bl_ui/space_image.py9
-rw-r--r--release/scripts/startup/bl_ui/space_info.py2
-rw-r--r--release/scripts/startup/bl_ui/space_sequencer.py19
-rw-r--r--release/scripts/startup/bl_ui/space_text.py6
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py4
-rw-r--r--release/scripts/startup/bl_ui/space_userpref_keymap.py4
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py2
19 files changed, 87 insertions, 74 deletions
diff --git a/release/scripts/startup/bl_operators/rigidbody.py b/release/scripts/startup/bl_operators/rigidbody.py
index 161349152d5..bb3a9a6330f 100644
--- a/release/scripts/startup/bl_operators/rigidbody.py
+++ b/release/scripts/startup/bl_operators/rigidbody.py
@@ -54,7 +54,7 @@ class CopyRigidbodySettings(Operator):
for o in objects:
if o.rigid_body is None:
continue
-
+
o.rigid_body.type = obj.rigid_body.type
o.rigid_body.kinematic = obj.rigid_body.kinematic
o.rigid_body.mass = obj.rigid_body.mass
@@ -144,7 +144,7 @@ class BakeToKeyframes(Operator):
# this is a little roundabout but there's no better way right now
aa = mat.to_quaternion().to_axis_angle()
obj.rotation_axis_angle = (aa[1], ) + aa[0][:]
- else: # euler
+ else: # euler
# make sure euler rotation is compatible to previous frame
obj.rotation_euler = mat.to_euler(rot_mode, obj_prev.rotation_euler)
@@ -190,7 +190,8 @@ class BakeToKeyframes(Operator):
class ConnectRigidBodies(Operator):
- '''Create rigid body constraints between selected and active rigid bodies'''
+ """Create rigid body constraints between """ \
+ """selected and active rigid bodies"""
bl_idname = "rigidbody.connect"
bl_label = "Connect Rigid Bodies"
bl_options = {'REGISTER', 'UNDO'}
@@ -232,7 +233,11 @@ class ConnectRigidBodies(Operator):
loc = obj.location
else:
loc = (obj_act.location + obj.location) / 2.0
- bpy.ops.object.add(type='EMPTY', view_align=False, enter_editmode=False, location=loc)
+ # TODO: use bpy.data.objects.new(...)
+ bpy.ops.object.add(type='EMPTY',
+ view_align=False,
+ enter_editmode=False,
+ location=loc)
bpy.ops.rigidbody.constraint_add()
con_obj = context.active_object
con_obj.empty_draw_type = 'ARROWS'
@@ -241,12 +246,12 @@ class ConnectRigidBodies(Operator):
con.object1 = obj_act
con.object2 = obj
change = True
-
+
if change:
# restore selection
bpy.ops.object.select_all(action='DESELECT')
for obj in objects:
- obj.select = True;
+ obj.select = True
scene.objects.active = obj_act
return {'FINISHED'}
else:
diff --git a/release/scripts/startup/bl_ui/properties_data_armature.py b/release/scripts/startup/bl_ui/properties_data_armature.py
index 1643210704e..0f9d525f168 100644
--- a/release/scripts/startup/bl_ui/properties_data_armature.py
+++ b/release/scripts/startup/bl_ui/properties_data_armature.py
@@ -124,7 +124,7 @@ class DATA_PT_bone_groups(ArmatureButtonsPanel, Panel):
rows = 2
if group:
rows = 5
- row.template_list("UI_UL_list", "", pose, "bone_groups", pose.bone_groups, "active_index", rows=rows)
+ row.template_list("UI_UL_list", "bone_groups", pose, "bone_groups", pose.bone_groups, "active_index", rows=rows)
col = row.column(align=True)
col.active = (ob.proxy is None)
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 679b33292e5..7be00193fb4 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel
+from bpy.app.translations import pgettext_iface as iface_
class ModifierButtonsPanel():
@@ -265,8 +266,7 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.prop(md, "angle_limit")
layout.prop(md, "use_dissolve_boundaries")
- pgettext = bpy.app.translations.pgettext
- layout.label(text=pgettext("Face Count: %d") % md.face_count, translate=False)
+ layout.label(text=iface_("Face Count: %d") % md.face_count, translate=False)
def DISPLACE(self, layout, ob, md):
has_texture = (md.texture is not None)
diff --git a/release/scripts/startup/bl_ui/properties_material.py b/release/scripts/startup/bl_ui/properties_material.py
index 9b7cfe89a08..273b2450200 100644
--- a/release/scripts/startup/bl_ui/properties_material.py
+++ b/release/scripts/startup/bl_ui/properties_material.py
@@ -20,6 +20,7 @@
import bpy
from bpy.types import Menu, Panel, UIList
from rna_prop_ui import PropertyPanel
+from bpy.app.translations import pgettext_iface as iface_
def active_node_mat(mat):
@@ -80,8 +81,7 @@ class MATERIAL_UL_matslots(UIList):
if ma and not context.scene.render.use_shading_nodes:
manode = ma.active_node_material
if manode:
- pgettext = bpy.app.translations.pgettext
- layout.label(text=pgettext("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
+ layout.label(text=iface_("Node %s") % manode.name, translate=False, icon_value=layout.icon(manode))
elif ma.use_nodes:
layout.label(text="Node <none>")
else:
diff --git a/release/scripts/startup/bl_ui/properties_paint_common.py b/release/scripts/startup/bl_ui/properties_paint_common.py
index 022f2500940..7c06aefe575 100644
--- a/release/scripts/startup/bl_ui/properties_paint_common.py
+++ b/release/scripts/startup/bl_ui/properties_paint_common.py
@@ -82,7 +82,7 @@ def brush_texture_settings(layout, brush, sculpt):
else:
layout.row().prop(tex_slot, "tex_paint_map_mode", text="")
layout.separator()
-
+
# angle and texture_angle_source
col = layout.column()
if sculpt:
@@ -101,7 +101,7 @@ def brush_texture_settings(layout, brush, sculpt):
split = layout.split()
split.prop(tex_slot, "offset")
split.prop(tex_slot, "scale")
-
+
if sculpt:
# texture_sample_bias
col = layout.column(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_particle.py b/release/scripts/startup/bl_ui/properties_particle.py
index aef860e774b..0aa2c14a0c7 100644
--- a/release/scripts/startup/bl_ui/properties_particle.py
+++ b/release/scripts/startup/bl_ui/properties_particle.py
@@ -20,6 +20,7 @@
import bpy
from bpy.types import Panel
from rna_prop_ui import PropertyPanel
+from bpy.app.translations import pgettext_iface as iface_
from bl_ui.properties_physics_common import (point_cache_ui,
effector_weights_ui,
@@ -148,8 +149,7 @@ class PARTICLE_PT_context_particles(ParticleButtonsPanel, Panel):
#row.label(text="Render")
if part.is_fluid:
- pgettext = bpy.app.translations.pgettext
- layout.label(text=pgettext("%d fluid particles for this frame") % part.count, translate=False)
+ layout.label(text=iface_("%d fluid particles for this frame") % part.count, translate=False)
return
row = col.row()
@@ -543,7 +543,7 @@ class PARTICLE_PT_physics(ParticleButtonsPanel, Panel):
# spacing between particles when the fluid is at rest. This
# makes it easier to set stable initial conditions.
particle_volume = part.mass / fluid.rest_density
- spacing = pow(particle_volume, 1/3)
+ spacing = pow(particle_volume, 1.0 / 3.0)
sub = col.row()
sub.label(text="Spacing: %g" % spacing)
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index 17a44a523dc..90cf397f526 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -21,6 +21,8 @@
import bpy
from bpy.types import Panel
+i18n_default_ctxt = bpy.app.translations.contexts.default
+
class PhysicButtonsPanel():
bl_space_type = 'PROPERTIES'
@@ -37,19 +39,21 @@ def physics_add(self, layout, md, name, type, typeicon, toggles):
sub = layout.row(align=True)
if md:
sub.context_pointer_set("modifier", md)
- sub.operator("object.modifier_remove", text=name, icon='X')
+ sub.operator("object.modifier_remove", text=name, text_ctxt=i18n_default_ctxt, icon='X')
if(toggles):
sub.prop(md, "show_render", text="")
sub.prop(md, "show_viewport", text="")
else:
- sub.operator("object.modifier_add", text=name, icon=typeicon).type = type
+ sub.operator("object.modifier_add", text=name, text_ctxt=i18n_default_ctxt, icon=typeicon).type = type
+
def physics_add_special(self, layout, data, name, addop, removeop, typeicon):
sub = layout.row(align=True)
if data:
- sub.operator(removeop, text=name, icon='X')
+ sub.operator(removeop, text=name, text_ctxt=i18n_default_ctxt, icon='X')
else:
- sub.operator(addop, text=name, icon=typeicon)
+ sub.operator(addop, text=name, text_ctxt=i18n_default_ctxt, icon=typeicon)
+
class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
bl_label = ""
@@ -86,13 +90,13 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
physics_add_special(self, col, ob.rigid_body, "Rigid Body",
"rigidbody.object_add",
"rigidbody.object_remove",
- 'MESH_ICOSPHERE') # XXX: need dedicated icon
+ 'MESH_ICOSPHERE') # XXX: need dedicated icon
# all types of objects can have rigid body constraint
physics_add_special(self, col, ob.rigid_body_constraint, "Rigid Body Constraint",
"rigidbody.constraint_add",
"rigidbody.constraint_remove",
- 'CONSTRAINT') # RB_TODO needs better icon
+ 'CONSTRAINT') # RB_TODO needs better icon
# cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
diff --git a/release/scripts/startup/bl_ui/properties_physics_fluid.py b/release/scripts/startup/bl_ui/properties_physics_fluid.py
index c03b5323105..2164b86f486 100644
--- a/release/scripts/startup/bl_ui/properties_physics_fluid.py
+++ b/release/scripts/startup/bl_ui/properties_physics_fluid.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Panel, Menu
+from bpy.app.translations import pgettext_iface as iface_
class FLUID_MT_presets(Menu):
@@ -64,8 +65,7 @@ class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
if fluid.type == 'DOMAIN':
# odd formatting here so translation script can extract string
- pgettext = bpy.app.translations.pgettext
- layout.operator("fluid.bake", text=pgettext("Bake (Req. Memory: %s)") % fluid.memory_estimate,
+ layout.operator("fluid.bake", text=iface_("Bake (Req. Memory: %s)") % fluid.memory_estimate,
translate=False, icon='MOD_FLUIDSIM')
split = layout.split()
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
index f335c560f7b..922eee66ddc 100644
--- a/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody.py
@@ -32,22 +32,22 @@ class PHYSICS_PT_rigid_body(PHYSICS_PT_rigidbody_panel, Panel):
@classmethod
def poll(cls, context):
- ob = context.object
- rd = context.scene.render
- return (ob and ob.rigid_body and (not rd.use_game_engine))
+ obj = context.object
+ return (obj and obj.rigid_body and
+ (not context.scene.render.use_game_engine))
def draw_header(self, context):
obj = context.object
rbo = obj.rigid_body
if rbo is not None:
- self.layout.prop(rbo, "enabled", text="");
+ self.layout.prop(rbo, "enabled", text="")
def draw(self, context):
layout = self.layout
ob = context.object
rbo = ob.rigid_body
-
+
if rbo is not None:
layout.prop(rbo, "type", text="Type")
layout.prop(rbo, "kinematic", text="Animated")
@@ -61,34 +61,35 @@ class PHYSICS_PT_rigid_body_collisions(PHYSICS_PT_rigidbody_panel, Panel):
@classmethod
def poll(cls, context):
- return (context.object and context.object.rigid_body and
+ obj = context.object
+ return (obj and obj.rigid_body and
(not context.scene.render.use_game_engine))
-
+
def draw(self, context):
layout = self.layout
ob = context.object
rbo = ob.rigid_body
-
+
layout.prop(rbo, "collision_shape", text="Shape")
-
+
split = layout.split()
-
+
col = split.column()
col.label(text="Surface Response:")
col.prop(rbo, "friction")
col.prop(rbo, "restitution", text="Bounciness")
-
+
col = split.column()
col.label(text="Sensitivity:")
if rbo.collision_shape in {'MESH', 'CONE'}:
col.prop(rbo, "collision_margin", text="Margin")
else:
- col.prop(rbo, "use_margin");
+ col.prop(rbo, "use_margin")
sub = col.column()
sub.active = rbo.use_margin
sub.prop(rbo, "collision_margin", text="Margin")
-
+
layout.prop(rbo, "collision_groups")
@@ -98,22 +99,23 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
@classmethod
def poll(cls, context):
- return (context.object and context.object.rigid_body and
- context.object.rigid_body.type == 'ACTIVE' and
+ obj = context.object
+ return (obj and obj.rigid_body and
+ obj.rigid_body.type == 'ACTIVE' and
(not context.scene.render.use_game_engine))
-
+
def draw(self, context):
layout = self.layout
ob = context.object
rbo = ob.rigid_body
-
+
#col = layout.column(align=1)
#col.label(text="Activation:")
# XXX: settings such as activate on collison/etc.
-
- split = layout.split();
-
+
+ split = layout.split()
+
col = split.column()
col.label(text="Deactivation:")
col.prop(rbo, "use_deactivation")
@@ -123,7 +125,7 @@ class PHYSICS_PT_rigid_body_dynamics(PHYSICS_PT_rigidbody_panel, Panel):
sub.prop(rbo, "deactivate_linear_velocity", text="Linear Vel")
sub.prop(rbo, "deactivate_angular_velocity", text="Angular Vel")
# TODO: other params such as time?
-
+
col = split.column()
col.label(text="Damping:")
col.prop(rbo, "linear_damping", text="Translation")
diff --git a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
index 49b760ef546..e4e5b94407d 100644
--- a/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_physics_rigidbody_constraint.py
@@ -173,7 +173,7 @@ class PHYSICS_PT_rigid_body_constraint(PHYSICS_PT_rigidbody_constraint_panel, Pa
sub.prop(rbc, "limit_ang_z_lower", text="Lower")
sub.prop(rbc, "limit_ang_z_upper", text="Upper")
- if rbc.type == 'GENERIC_SPRING':
+ if rbc.type == 'GENERIC_SPRING':
col = layout.column(align=True)
col.label("Springs:")
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index b9b57923420..68a097e6188 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -26,6 +26,7 @@ from bl_ui.properties_physics_common import (
effector_weights_ui,
)
+
class SCENE_UL_keying_set_paths(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
# assert(isinstance(item, bpy.types.KeyingSetPath)
diff --git a/release/scripts/startup/bl_ui/space_clip.py b/release/scripts/startup/bl_ui/space_clip.py
index 84f26acb4cc..bc5d89fd45b 100644
--- a/release/scripts/startup/bl_ui/space_clip.py
+++ b/release/scripts/startup/bl_ui/space_clip.py
@@ -20,6 +20,7 @@
import bpy
from bpy.types import Panel, Header, Menu, UIList
+from bpy.app.translations import pgettext_iface as iface_
class CLIP_UL_tracking_objects(UIList):
@@ -28,10 +29,14 @@ class CLIP_UL_tracking_objects(UIList):
# assert(isinstance(item, bpy.types.MovieTrackingObject)
tobj = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
- layout.label(text=tobj.name, translate=False, 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(text="", 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):
@@ -907,7 +912,7 @@ 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")
+ text = iface_("Zoom %d:%d")
for a, b in ratios:
layout.operator("clip.view_zoom_ratio",
text=text % (a, b),
diff --git a/release/scripts/startup/bl_ui/space_image.py b/release/scripts/startup/bl_ui/space_image.py
index 6d08663006f..01b67667cfb 100644
--- a/release/scripts/startup/bl_ui/space_image.py
+++ b/release/scripts/startup/bl_ui/space_image.py
@@ -19,8 +19,9 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
-from bl_ui.properties_paint_common import UnifiedPaintPanel
-from bl_ui.properties_paint_common import brush_texture_settings
+from bl_ui.properties_paint_common import UnifiedPaintPanel, brush_texture_settings
+from bpy.app.translations import pgettext_iface as iface_
+
class ImagePaintPanel(UnifiedPaintPanel):
bl_space_type = 'IMAGE_EDITOR'
@@ -70,10 +71,8 @@ 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=pgettext("Zoom %d:%d") % (a, b),
- translate=False).ratio = a / b
+ layout.operator("image.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
layout.separator()
diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 47e8844742a..51c975c3e70 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -65,7 +65,7 @@ class INFO_HT_header(Header):
row = layout.row(align=True)
row.operator("wm.splash", text="", icon='BLENDER', emboss=False)
- row.label(text=scene.statistics())
+ row.label(text=scene.statistics(), translate=False)
# XXX: BEFORE RELEASE, MOVE FILE MENU OUT OF INFO!!!
"""
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index b8f44a621a9..7841acf01b3 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
+from bpy.app.translations import pgettext_iface as iface_
def act_strip(context):
@@ -420,19 +421,17 @@ 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=pgettext("Final Length: %s") % bpy.utils.smpte_from_frame(strip.frame_final_duration),
+ row.label(text=iface_("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=pgettext("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
+ row.label(text=iface_("Playhead: %d") % (frame_current - strip.frame_start), translate=False)
- 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),
+ col.label(text=iface_("Frame Offset %d:%d") % (strip.frame_offset_start, strip.frame_offset_end),
translate=False)
+ col.label(text=iface_("Frame Still %d:%d") % (strip.frame_still_start, strip.frame_still_end), translate=False)
elem = False
@@ -442,7 +441,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=pgettext("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
+ col.label(text=iface_("Original Dimension: %dx%d") % (elem.orig_width, elem.orig_height), translate=False)
else:
col.label(text="Original Dimension: None")
@@ -719,8 +718,7 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel, Panel):
if scene:
sta = scene.frame_start
end = scene.frame_end
- pgettext = bpy.app.translations.pgettext
- layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
+ layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
@@ -749,8 +747,7 @@ class SEQUENCER_PT_mask(SequencerButtonsPanel, Panel):
if mask:
sta = mask.frame_start
end = mask.frame_end
- pgettext = bpy.app.translations.pgettext
- layout.label(text=pgettext("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
+ layout.label(text=iface_("Original frame range: %d-%d (%d)") % (sta, end, end - sta + 1), translate=False)
class SEQUENCER_PT_filter(SequencerButtonsPanel, Panel):
diff --git a/release/scripts/startup/bl_ui/space_text.py b/release/scripts/startup/bl_ui/space_text.py
index b32172e25e0..4264fc95cea 100644
--- a/release/scripts/startup/bl_ui/space_text.py
+++ b/release/scripts/startup/bl_ui/space_text.py
@@ -19,6 +19,7 @@
# <pep8-80 compliant>
import bpy
from bpy.types import Header, Menu, Panel
+from bpy.app.translations import pgettext_iface as iface_
class TEXT_HT_header(Header):
@@ -71,12 +72,11 @@ class TEXT_HT_header(Header):
row = layout.row()
if text.filepath:
- pgettext = bpy.app.translations.pgettext
if text.is_dirty:
- row.label(text=pgettext("File: *%r (unsaved)") %
+ row.label(text=iface_("File: *%r (unsaved)") %
text.filepath, translate=False)
else:
- row.label(text=pgettext("File: %r") %
+ row.label(text=iface_("File: %r") %
text.filepath, translate=False)
else:
row.label(text="Text: External"
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 5bb83e7f429..017f75b7583 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Header, Menu, Panel
+from bpy.app.translations import pgettext_iface as iface_
def ui_style_items(col, context):
@@ -778,10 +779,9 @@ 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=pgettext("Color Set %d:") % (i + 1), translate=False) # i starts from 0
+ col.label(text=iface_("Color Set %d:") % (i + 1), translate=False) # i starts from 0
row = col.row()
diff --git a/release/scripts/startup/bl_ui/space_userpref_keymap.py b/release/scripts/startup/bl_ui/space_userpref_keymap.py
index db78adcb576..e9eb2aa8b8f 100644
--- a/release/scripts/startup/bl_ui/space_userpref_keymap.py
+++ b/release/scripts/startup/bl_ui/space_userpref_keymap.py
@@ -19,6 +19,7 @@
# <pep8 compliant>
import bpy
from bpy.types import Menu
+from bpy.app.translations import pgettext_iface as iface_
class USERPREF_MT_keyconfigs(Menu):
@@ -97,8 +98,7 @@ class InputKeyMapPanel:
subcol = self.indented_layout(col, level + 1)
subrow = subcol.row()
subrow.prop(km, "show_expanded_items", text="", emboss=False)
- pgettext = bpy.app.translations.pgettext
- subrow.label(text=pgettext("%s (Global)") % km.name, translate=False)
+ subrow.label(text=iface_("%s (Global)") % km.name, translate=False)
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 0e35a154f86..aafa4f1fe06 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -2710,7 +2710,7 @@ class VIEW3D_PT_etch_a_ton(Panel):
colsub = col.column(align=True)
colsub.prop(toolsettings, "use_etch_autoname")
- sub = colsub.column()
+ sub = colsub.column()
sub.enabled = not toolsettings.use_etch_autoname
sub.prop(toolsettings, "etch_number")
sub.prop(toolsettings, "etch_side")