I18n: fix printf-style format translation in release/scripts/startup
Many reports and a few labels used string formatting without explicitly calling tip_() or iface_(), so the untranslated message was used instead of the translated one, even when it was extracted. Differential Revision: https://developer.blender.org/D16405
This commit is contained in:
@@ -16,6 +16,7 @@ from bpy.props import (
|
|||||||
EnumProperty,
|
EnumProperty,
|
||||||
StringProperty,
|
StringProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
class ANIM_OT_keying_set_export(Operator):
|
class ANIM_OT_keying_set_export(Operator):
|
||||||
@@ -111,7 +112,7 @@ class ANIM_OT_keying_set_export(Operator):
|
|||||||
break
|
break
|
||||||
|
|
||||||
if not found:
|
if not found:
|
||||||
self.report({'WARN'}, "Could not find material or light using Shader Node Tree - %s" % (ksp.id))
|
self.report({'WARN'}, tip_("Could not find material or light using Shader Node Tree - %s") % (ksp.id))
|
||||||
elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"):
|
elif ksp.id.bl_rna.identifier.startswith("CompositorNodeTree"):
|
||||||
# Find compositor nodetree using this node tree...
|
# Find compositor nodetree using this node tree...
|
||||||
for scene in bpy.data.scenes:
|
for scene in bpy.data.scenes:
|
||||||
@@ -119,7 +120,7 @@ class ANIM_OT_keying_set_export(Operator):
|
|||||||
id_bpy_path = "bpy.data.scenes[\"%s\"].node_tree" % (scene.name)
|
id_bpy_path = "bpy.data.scenes[\"%s\"].node_tree" % (scene.name)
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
self.report({'WARN'}, "Could not find scene using Compositor Node Tree - %s" % (ksp.id))
|
self.report({'WARN'}, tip_("Could not find scene using Compositor Node Tree - %s") % (ksp.id))
|
||||||
elif ksp.id.bl_rna.name == "Key":
|
elif ksp.id.bl_rna.name == "Key":
|
||||||
# "keys" conflicts with a Python keyword, hence the simple solution won't work
|
# "keys" conflicts with a Python keyword, hence the simple solution won't work
|
||||||
id_bpy_path = "bpy.data.shape_keys[\"%s\"]" % (ksp.id.name)
|
id_bpy_path = "bpy.data.shape_keys[\"%s\"]" % (ksp.id.name)
|
||||||
@@ -324,7 +325,7 @@ class ClearUselessActions(Operator):
|
|||||||
action.user_clear()
|
action.user_clear()
|
||||||
removed += 1
|
removed += 1
|
||||||
|
|
||||||
self.report({'INFO'}, "Removed %d empty and/or fake-user only Actions"
|
self.report({'INFO'}, tip_("Removed %d empty and/or fake-user only Actions")
|
||||||
% removed)
|
% removed)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
@@ -409,7 +410,7 @@ class UpdateAnimatedTransformConstraint(Operator):
|
|||||||
print(log)
|
print(log)
|
||||||
text = bpy.data.texts.new("UpdateAnimatedTransformConstraint Report")
|
text = bpy.data.texts.new("UpdateAnimatedTransformConstraint Report")
|
||||||
text.from_string(log)
|
text.from_string(log)
|
||||||
self.report({'INFO'}, "Complete report available on '%s' text datablock" % text.name)
|
self.report({'INFO'}, tip_("Complete report available on '%s' text datablock") % text.name)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ from __future__ import annotations
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
|
from bpy.app.translations import (
|
||||||
from bpy.app.translations import pgettext_data as data_
|
pgettext_data as data_,
|
||||||
|
pgettext_tip as tip_,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
from bpy_extras.asset_utils import (
|
from bpy_extras.asset_utils import (
|
||||||
@@ -125,7 +127,7 @@ class ASSET_OT_open_containing_blend_file(Operator):
|
|||||||
return {'RUNNING_MODAL'}
|
return {'RUNNING_MODAL'}
|
||||||
|
|
||||||
if returncode:
|
if returncode:
|
||||||
self.report({'WARNING'}, "Blender sub-process exited with error code %d" % returncode)
|
self.report({'WARNING'}, tip_("Blender sub-process exited with error code %d") % returncode)
|
||||||
|
|
||||||
if bpy.ops.asset.library_refresh.poll():
|
if bpy.ops.asset.library_refresh.poll():
|
||||||
bpy.ops.asset.library_refresh()
|
bpy.ops.asset.library_refresh()
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from mathutils import (
|
|||||||
Vector,
|
Vector,
|
||||||
Matrix,
|
Matrix,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, *args):
|
def CLIP_spaces_walk(context, all_screens, tarea, tspace, callback, *args):
|
||||||
@@ -193,7 +194,7 @@ class CLIP_OT_filter_tracks(Operator):
|
|||||||
|
|
||||||
def execute(self, context):
|
def execute(self, context):
|
||||||
num_tracks = self._filter_values(context, self.track_threshold)
|
num_tracks = self._filter_values(context, self.track_threshold)
|
||||||
self.report({'INFO'}, "Identified %d problematic tracks" % num_tracks)
|
self.report({'INFO'}, tip_("Identified %d problematic tracks") % num_tracks)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ from bpy.props import (
|
|||||||
CollectionProperty,
|
CollectionProperty,
|
||||||
StringProperty,
|
StringProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
# ########## Datablock previews... ##########
|
# ########## Datablock previews... ##########
|
||||||
|
|
||||||
@@ -123,7 +124,7 @@ class WM_OT_previews_batch_generate(Operator):
|
|||||||
if not self.use_backups:
|
if not self.use_backups:
|
||||||
cmd.append("--no_backups")
|
cmd.append("--no_backups")
|
||||||
if subprocess.call(cmd):
|
if subprocess.call(cmd):
|
||||||
self.report({'ERROR'}, "Previews generation process failed for file '%s'!" % blen_path)
|
self.report({'ERROR'}, tip_("Previews generation process failed for file '%s'!") % blen_path)
|
||||||
context.window_manager.progress_end()
|
context.window_manager.progress_end()
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
context.window_manager.progress_update(i + 1)
|
context.window_manager.progress_update(i + 1)
|
||||||
@@ -234,7 +235,7 @@ class WM_OT_previews_batch_clear(Operator):
|
|||||||
if not self.use_backups:
|
if not self.use_backups:
|
||||||
cmd.append("--no_backups")
|
cmd.append("--no_backups")
|
||||||
if subprocess.call(cmd):
|
if subprocess.call(cmd):
|
||||||
self.report({'ERROR'}, "Previews clear process failed for file '%s'!" % blen_path)
|
self.report({'ERROR'}, tip_("Previews clear process failed for file '%s'!") % blen_path)
|
||||||
context.window_manager.progress_end()
|
context.window_manager.progress_end()
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
context.window_manager.progress_update(i + 1)
|
context.window_manager.progress_update(i + 1)
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
from bpy.props import StringProperty
|
from bpy.props import StringProperty
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
class EditExternally(Operator):
|
class EditExternally(Operator):
|
||||||
@@ -52,8 +53,8 @@ class EditExternally(Operator):
|
|||||||
|
|
||||||
if not os.path.exists(filepath) or not os.path.isfile(filepath):
|
if not os.path.exists(filepath) or not os.path.isfile(filepath):
|
||||||
self.report({'ERROR'},
|
self.report({'ERROR'},
|
||||||
"Image path %r not found, image may be packed or "
|
tip_("Image path %r not found, image may be packed or "
|
||||||
"unsaved" % filepath)
|
"unsaved") % filepath)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
cmd = self._editor_guess(context) + [filepath]
|
cmd = self._editor_guess(context) + [filepath]
|
||||||
@@ -183,7 +184,7 @@ class ProjectApply(Operator):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
self.report({'ERROR'}, "Could not find image '%s'" % image_name)
|
self.report({'ERROR'}, tip_("Could not find image '%s'") % image_name)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
image.reload()
|
image.reload()
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ from bpy.props import (
|
|||||||
EnumProperty,
|
EnumProperty,
|
||||||
IntProperty,
|
IntProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
class MeshMirrorUV(Operator):
|
class MeshMirrorUV(Operator):
|
||||||
@@ -164,18 +165,18 @@ class MeshMirrorUV(Operator):
|
|||||||
|
|
||||||
if total_duplicates and total_no_active_UV:
|
if total_duplicates and total_no_active_UV:
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
"%d mesh(es) with no active UV layer, "
|
tip_("%d mesh(es) with no active UV layer, "
|
||||||
"%d duplicates found in %d mesh(es), mirror may be incomplete"
|
"%d duplicates found in %d mesh(es), mirror may be incomplete")
|
||||||
% (total_no_active_UV,
|
% (total_no_active_UV,
|
||||||
total_duplicates,
|
total_duplicates,
|
||||||
meshes_with_duplicates))
|
meshes_with_duplicates))
|
||||||
elif total_no_active_UV:
|
elif total_no_active_UV:
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
"%d mesh(es) with no active UV layer"
|
tip_("%d mesh(es) with no active UV layer")
|
||||||
% (total_no_active_UV,))
|
% (total_no_active_UV,))
|
||||||
elif total_duplicates:
|
elif total_duplicates:
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
"%d duplicates found in %d mesh(es), mirror may be incomplete"
|
tip_("%d duplicates found in %d mesh(es), mirror may be incomplete")
|
||||||
% (total_duplicates, meshes_with_duplicates))
|
% (total_duplicates, meshes_with_duplicates))
|
||||||
|
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from bpy.props import (
|
|||||||
IntProperty,
|
IntProperty,
|
||||||
StringProperty,
|
StringProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
class SelectPattern(Operator):
|
class SelectPattern(Operator):
|
||||||
@@ -363,14 +364,12 @@ class ShapeTransfer(Operator):
|
|||||||
for ob_other in objects:
|
for ob_other in objects:
|
||||||
if ob_other.type != 'MESH':
|
if ob_other.type != 'MESH':
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
("Skipping '%s', "
|
tip_("Skipping '%s', not a mesh") % ob_other.name)
|
||||||
"not a mesh") % ob_other.name)
|
|
||||||
continue
|
continue
|
||||||
me_other = ob_other.data
|
me_other = ob_other.data
|
||||||
if len(me_other.vertices) != len(me.vertices):
|
if len(me_other.vertices) != len(me.vertices):
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
("Skipping '%s', "
|
tip_("Skipping '%s', vertex count differs") % ob_other.name)
|
||||||
"vertex count differs") % ob_other.name)
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
target_normals = me_nos(me_other.vertices)
|
target_normals = me_nos(me_other.vertices)
|
||||||
@@ -508,7 +507,7 @@ class JoinUVs(Operator):
|
|||||||
|
|
||||||
if not mesh.uv_layers:
|
if not mesh.uv_layers:
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
"Object: %s, Mesh: '%s' has no UVs"
|
tip_("Object: %s, Mesh: '%s' has no UVs")
|
||||||
% (obj.name, mesh.name))
|
% (obj.name, mesh.name))
|
||||||
else:
|
else:
|
||||||
nbr_loops = len(mesh.loops)
|
nbr_loops = len(mesh.loops)
|
||||||
@@ -531,9 +530,10 @@ class JoinUVs(Operator):
|
|||||||
mesh_other.tag = True
|
mesh_other.tag = True
|
||||||
|
|
||||||
if len(mesh_other.loops) != nbr_loops:
|
if len(mesh_other.loops) != nbr_loops:
|
||||||
self.report({'WARNING'}, "Object: %s, Mesh: "
|
self.report({'WARNING'},
|
||||||
"'%s' has %d loops (for %d faces),"
|
tip_("Object: %s, Mesh: "
|
||||||
" expected %d\n"
|
"'%s' has %d loops (for %d faces),"
|
||||||
|
" expected %d\n")
|
||||||
% (obj_other.name,
|
% (obj_other.name,
|
||||||
mesh_other.name,
|
mesh_other.name,
|
||||||
len(mesh_other.loops),
|
len(mesh_other.loops),
|
||||||
@@ -547,9 +547,10 @@ class JoinUVs(Operator):
|
|||||||
mesh_other.uv_layers.new()
|
mesh_other.uv_layers.new()
|
||||||
uv_other = mesh_other.uv_layers.active
|
uv_other = mesh_other.uv_layers.active
|
||||||
if not uv_other:
|
if not uv_other:
|
||||||
self.report({'ERROR'}, "Could not add "
|
self.report({'ERROR'},
|
||||||
"a new UV map to object "
|
tip_("Could not add "
|
||||||
"'%s' (Mesh '%s')\n"
|
"a new UV map to object "
|
||||||
|
"'%s' (Mesh '%s')\n")
|
||||||
% (obj_other.name,
|
% (obj_other.name,
|
||||||
mesh_other.name,
|
mesh_other.name,
|
||||||
),
|
),
|
||||||
@@ -784,8 +785,8 @@ class TransformsToDeltasAnim(Operator):
|
|||||||
adt = obj.animation_data
|
adt = obj.animation_data
|
||||||
if (adt is None) or (adt.action is None):
|
if (adt is None) or (adt.action is None):
|
||||||
self.report({'WARNING'},
|
self.report({'WARNING'},
|
||||||
"No animation data to convert on object: %r" %
|
tip_("No animation data to convert on object: %r")
|
||||||
obj.name)
|
% obj.name)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# first pass over F-Curves: ensure that we don't have conflicting
|
# first pass over F-Curves: ensure that we don't have conflicting
|
||||||
@@ -811,8 +812,8 @@ class TransformsToDeltasAnim(Operator):
|
|||||||
if fcu.array_index in existingFCurves[dpath]:
|
if fcu.array_index in existingFCurves[dpath]:
|
||||||
# conflict
|
# conflict
|
||||||
self.report({'ERROR'},
|
self.report({'ERROR'},
|
||||||
"Object '%r' already has '%r' F-Curve(s). "
|
tip_("Object '%r' already has '%r' F-Curve(s). "
|
||||||
"Remove these before trying again" %
|
"Remove these before trying again") %
|
||||||
(obj.name, dpath))
|
(obj.name, dpath))
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ from bpy.props import (
|
|||||||
FloatProperty,
|
FloatProperty,
|
||||||
IntProperty,
|
IntProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
def object_ensure_material(obj, mat_name):
|
def object_ensure_material(obj, mat_name):
|
||||||
@@ -176,8 +177,8 @@ class QuickExplode(ObjectModeOperator, Operator):
|
|||||||
for obj in mesh_objects:
|
for obj in mesh_objects:
|
||||||
if obj.particle_systems:
|
if obj.particle_systems:
|
||||||
self.report({'ERROR'},
|
self.report({'ERROR'},
|
||||||
"Object %r already has a "
|
tip_("Object %r already has a "
|
||||||
"particle system" % obj.name)
|
"particle system") % obj.name)
|
||||||
|
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,11 @@ from bpy.props import (
|
|||||||
BoolProperty,
|
BoolProperty,
|
||||||
StringProperty,
|
StringProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import (
|
||||||
|
pgettext_tip as tip_,
|
||||||
|
pgettext_data as data_,
|
||||||
|
)
|
||||||
|
|
||||||
from bpy.app.translations import pgettext_data as data_
|
|
||||||
|
|
||||||
# For preset popover menu
|
# For preset popover menu
|
||||||
WindowManager.preset_name = StringProperty(
|
WindowManager.preset_name = StringProperty(
|
||||||
@@ -186,7 +189,7 @@ class AddPresetBase:
|
|||||||
else:
|
else:
|
||||||
os.remove(filepath)
|
os.remove(filepath)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.report({'ERROR'}, "Unable to remove preset: %r" % e)
|
self.report({'ERROR'}, tip_("Unable to remove preset: %r") % e)
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
@@ -236,7 +239,7 @@ class ExecutePreset(Operator):
|
|||||||
ext = splitext(filepath)[1].lower()
|
ext = splitext(filepath)[1].lower()
|
||||||
|
|
||||||
if ext not in {".py", ".xml"}:
|
if ext not in {".py", ".xml"}:
|
||||||
self.report({'ERROR'}, "Unknown file type: %r" % ext)
|
self.report({'ERROR'}, tip_("Unknown file type: %r") % ext)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
if hasattr(preset_class, "reset_cb"):
|
if hasattr(preset_class, "reset_cb"):
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
from bpy.types import Operator
|
from bpy.types import Operator
|
||||||
|
|
||||||
from bpy.app.translations import pgettext_tip as tip_
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ from bpy.props import (
|
|||||||
FloatProperty,
|
FloatProperty,
|
||||||
IntProperty,
|
IntProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_tip as tip_
|
||||||
|
|
||||||
|
|
||||||
class SequencerCrossfadeSounds(Operator):
|
class SequencerCrossfadeSounds(Operator):
|
||||||
@@ -231,7 +232,7 @@ class SequencerFadesAdd(Operator):
|
|||||||
sequence.invalidate_cache('COMPOSITE')
|
sequence.invalidate_cache('COMPOSITE')
|
||||||
|
|
||||||
sequence_string = "sequence" if len(faded_sequences) == 1 else "sequences"
|
sequence_string = "sequence" if len(faded_sequences) == 1 else "sequences"
|
||||||
self.report({'INFO'}, "Added fade animation to %d %s" % (len(faded_sequences), sequence_string))
|
self.report({'INFO'}, tip_("Added fade animation to %d %s") % (len(faded_sequences), sequence_string))
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
|
|
||||||
def calculate_fade_duration(self, context, sequence):
|
def calculate_fade_duration(self, context, sequence):
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ from bpy.props import (
|
|||||||
StringProperty,
|
StringProperty,
|
||||||
CollectionProperty,
|
CollectionProperty,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import (
|
||||||
from bpy.app.translations import pgettext_tip as tip_
|
pgettext_iface as iface_,
|
||||||
|
pgettext_tip as tip_,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _zipfile_root_namelist(file_to_extract):
|
def _zipfile_root_namelist(file_to_extract):
|
||||||
@@ -224,7 +226,7 @@ class PREFERENCES_OT_keyconfig_import(Operator):
|
|||||||
else:
|
else:
|
||||||
shutil.move(self.filepath, path)
|
shutil.move(self.filepath, path)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
self.report({'ERROR'}, "Installing keymap failed: %s" % ex)
|
self.report({'ERROR'}, tip_("Installing keymap failed: %s") % ex)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
# sneaky way to check we're actually running the code.
|
# sneaky way to check we're actually running the code.
|
||||||
@@ -450,11 +452,11 @@ class PREFERENCES_OT_addon_enable(Operator):
|
|||||||
if info_ver > bpy.app.version:
|
if info_ver > bpy.app.version:
|
||||||
self.report(
|
self.report(
|
||||||
{'WARNING'},
|
{'WARNING'},
|
||||||
"This script was written Blender "
|
tip_("This script was written Blender "
|
||||||
"version %d.%d.%d and might not "
|
"version %d.%d.%d and might not "
|
||||||
"function (correctly), "
|
"function (correctly), "
|
||||||
"though it is enabled" %
|
"though it is enabled")
|
||||||
info_ver
|
% info_ver
|
||||||
)
|
)
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
else:
|
else:
|
||||||
@@ -538,7 +540,7 @@ class PREFERENCES_OT_theme_install(Operator):
|
|||||||
|
|
||||||
if not self.overwrite:
|
if not self.overwrite:
|
||||||
if os.path.exists(path_dest):
|
if os.path.exists(path_dest):
|
||||||
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
self.report({'WARNING'}, tip_("File already installed to %r\n") % path_dest)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@@ -645,7 +647,7 @@ class PREFERENCES_OT_addon_install(Operator):
|
|||||||
pyfile_dir = os.path.dirname(pyfile)
|
pyfile_dir = os.path.dirname(pyfile)
|
||||||
for addon_path in addon_utils.paths():
|
for addon_path in addon_utils.paths():
|
||||||
if os.path.samefile(pyfile_dir, addon_path):
|
if os.path.samefile(pyfile_dir, addon_path):
|
||||||
self.report({'ERROR'}, "Source file is in the add-on search path: %r" % addon_path)
|
self.report({'ERROR'}, tip_("Source file is in the add-on search path: %r") % addon_path)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
del addon_path
|
del addon_path
|
||||||
del pyfile_dir
|
del pyfile_dir
|
||||||
@@ -669,7 +671,7 @@ class PREFERENCES_OT_addon_install(Operator):
|
|||||||
for f in file_to_extract_root:
|
for f in file_to_extract_root:
|
||||||
path_dest = os.path.join(path_addons, os.path.basename(f))
|
path_dest = os.path.join(path_addons, os.path.basename(f))
|
||||||
if os.path.exists(path_dest):
|
if os.path.exists(path_dest):
|
||||||
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
self.report({'WARNING'}, tip_("File already installed to %r\n") % path_dest)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
try: # extract the file to "addons"
|
try: # extract the file to "addons"
|
||||||
@@ -684,7 +686,7 @@ class PREFERENCES_OT_addon_install(Operator):
|
|||||||
if self.overwrite:
|
if self.overwrite:
|
||||||
_module_filesystem_remove(path_addons, os.path.basename(pyfile))
|
_module_filesystem_remove(path_addons, os.path.basename(pyfile))
|
||||||
elif os.path.exists(path_dest):
|
elif os.path.exists(path_dest):
|
||||||
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
self.report({'WARNING'}, tip_("File already installed to %r\n") % path_dest)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
# if not compressed file just copy into the addon path
|
# if not compressed file just copy into the addon path
|
||||||
@@ -764,7 +766,7 @@ class PREFERENCES_OT_addon_remove(Operator):
|
|||||||
|
|
||||||
path, isdir = PREFERENCES_OT_addon_remove.path_from_addon(self.module)
|
path, isdir = PREFERENCES_OT_addon_remove.path_from_addon(self.module)
|
||||||
if path is None:
|
if path is None:
|
||||||
self.report({'WARNING'}, "Add-on path %r could not be found" % path)
|
self.report({'WARNING'}, tip_("Add-on path %r could not be found") % path)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
# in case its enabled
|
# in case its enabled
|
||||||
@@ -783,9 +785,9 @@ class PREFERENCES_OT_addon_remove(Operator):
|
|||||||
|
|
||||||
# lame confirmation check
|
# lame confirmation check
|
||||||
def draw(self, _context):
|
def draw(self, _context):
|
||||||
self.layout.label(text="Remove Add-on: %r?" % self.module)
|
self.layout.label(text=iface_("Remove Add-on: %r?") % self.module, translate=False)
|
||||||
path, _isdir = PREFERENCES_OT_addon_remove.path_from_addon(self.module)
|
path, _isdir = PREFERENCES_OT_addon_remove.path_from_addon(self.module)
|
||||||
self.layout.label(text="Path: %r" % path)
|
self.layout.label(text=iface_("Path: %r") % path, translate=False)
|
||||||
|
|
||||||
def invoke(self, context, _event):
|
def invoke(self, context, _event):
|
||||||
wm = context.window_manager
|
wm = context.window_manager
|
||||||
@@ -914,7 +916,7 @@ class PREFERENCES_OT_app_template_install(Operator):
|
|||||||
for f in file_to_extract_root:
|
for f in file_to_extract_root:
|
||||||
path_dest = os.path.join(path_app_templates, os.path.basename(f))
|
path_dest = os.path.join(path_app_templates, os.path.basename(f))
|
||||||
if os.path.exists(path_dest):
|
if os.path.exists(path_dest):
|
||||||
self.report({'WARNING'}, "File already installed to %r\n" % path_dest)
|
self.report({'WARNING'}, tip_("File already installed to %r\n") % path_dest)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
try: # extract the file to "bl_app_templates_user"
|
try: # extract the file to "bl_app_templates_user"
|
||||||
@@ -925,7 +927,7 @@ class PREFERENCES_OT_app_template_install(Operator):
|
|||||||
|
|
||||||
else:
|
else:
|
||||||
# Only support installing zipfiles
|
# Only support installing zipfiles
|
||||||
self.report({'WARNING'}, "Expected a zip-file %r\n" % filepath)
|
self.report({'WARNING'}, tip_("Expected a zip-file %r\n") % filepath)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
app_templates_new = set(os.listdir(path_app_templates)) - app_templates_old
|
app_templates_new = set(os.listdir(path_app_templates)) - app_templates_old
|
||||||
|
|||||||
@@ -772,7 +772,7 @@ class WM_OT_operator_pie_enum(Operator):
|
|||||||
try:
|
try:
|
||||||
op_rna = op.get_rna_type()
|
op_rna = op.get_rna_type()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.report({'ERROR'}, "Operator not found: bpy.ops.%s" % data_path)
|
self.report({'ERROR'}, tip_("Operator not found: bpy.ops.%s") % data_path)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
def draw_cb(self, context):
|
def draw_cb(self, context):
|
||||||
@@ -872,7 +872,7 @@ class WM_OT_context_collection_boolean_set(Operator):
|
|||||||
elif value_orig is False:
|
elif value_orig is False:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
self.report({'WARNING'}, "Non boolean value found: %s[ ].%s" %
|
self.report({'WARNING'}, tip_("Non boolean value found: %s[ ].%s") %
|
||||||
(data_path_iter, data_path_item))
|
(data_path_iter, data_path_item))
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
@@ -975,7 +975,7 @@ class WM_OT_context_modal_mouse(Operator):
|
|||||||
(item, ) = self._values.keys()
|
(item, ) = self._values.keys()
|
||||||
header_text = header_text % eval("item.%s" % self.data_path_item)
|
header_text = header_text % eval("item.%s" % self.data_path_item)
|
||||||
else:
|
else:
|
||||||
header_text = (self.header_text % delta) + " (delta)"
|
header_text = (self.header_text % delta) + tip_(" (delta)")
|
||||||
context.area.header_text_set(header_text)
|
context.area.header_text_set(header_text)
|
||||||
|
|
||||||
elif 'LEFTMOUSE' == event_type:
|
elif 'LEFTMOUSE' == event_type:
|
||||||
@@ -995,7 +995,7 @@ class WM_OT_context_modal_mouse(Operator):
|
|||||||
self._values_store(context)
|
self._values_store(context)
|
||||||
|
|
||||||
if not self._values:
|
if not self._values:
|
||||||
self.report({'WARNING'}, "Nothing to operate on: %s[ ].%s" %
|
self.report({'WARNING'}, tip_("Nothing to operate on: %s[ ].%s") %
|
||||||
(self.data_path_iter, self.data_path_item))
|
(self.data_path_iter, self.data_path_item))
|
||||||
|
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
@@ -1133,7 +1133,7 @@ class WM_OT_path_open(Operator):
|
|||||||
filepath = os.path.normpath(filepath)
|
filepath = os.path.normpath(filepath)
|
||||||
|
|
||||||
if not os.path.exists(filepath):
|
if not os.path.exists(filepath):
|
||||||
self.report({'ERROR'}, "File '%s' not found" % filepath)
|
self.report({'ERROR'}, tip_("File '%s' not found") % filepath)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
if sys.platform[:3] == "win":
|
if sys.platform[:3] == "win":
|
||||||
@@ -1204,7 +1204,7 @@ def _wm_doc_get_id(doc_id, *, do_url=True, url_prefix="", report=None):
|
|||||||
|
|
||||||
if rna_class is None:
|
if rna_class is None:
|
||||||
if report is not None:
|
if report is not None:
|
||||||
report({'ERROR'}, iface_("Type \"%s\" can not be found") % class_name)
|
report({'ERROR'}, tip_("Type \"%s\" can not be found") % class_name)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
# Detect if this is a inherited member and use that name instead.
|
# Detect if this is a inherited member and use that name instead.
|
||||||
@@ -1275,9 +1275,9 @@ class WM_OT_doc_view_manual(Operator):
|
|||||||
if url is None:
|
if url is None:
|
||||||
self.report(
|
self.report(
|
||||||
{'WARNING'},
|
{'WARNING'},
|
||||||
"No reference available %r, "
|
tip_("No reference available %r, "
|
||||||
"Update info in 'rna_manual_reference.py' "
|
"Update info in 'rna_manual_reference.py' "
|
||||||
"or callback to bpy.utils.manual_map()" %
|
"or callback to bpy.utils.manual_map()") %
|
||||||
self.doc_id
|
self.doc_id
|
||||||
)
|
)
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
@@ -2156,7 +2156,7 @@ class WM_OT_tool_set_by_id(Operator):
|
|||||||
tool_settings.workspace_tool_type = 'FALLBACK'
|
tool_settings.workspace_tool_type = 'FALLBACK'
|
||||||
return {'FINISHED'}
|
return {'FINISHED'}
|
||||||
else:
|
else:
|
||||||
self.report({'WARNING'}, "Tool %r not found for space %r" % (self.name, space_type))
|
self.report({'WARNING'}, tip_("Tool %r not found for space %r") % (self.name, space_type))
|
||||||
return {'CANCELLED'}
|
return {'CANCELLED'}
|
||||||
|
|
||||||
|
|
||||||
@@ -2943,7 +2943,7 @@ class WM_OT_batch_rename(Operator):
|
|||||||
row.prop(action, "op_remove", text="", icon='REMOVE')
|
row.prop(action, "op_remove", text="", icon='REMOVE')
|
||||||
row.prop(action, "op_add", text="", icon='ADD')
|
row.prop(action, "op_add", text="", icon='ADD')
|
||||||
|
|
||||||
layout.label(text=iface_("Rename %d %s") % (len(self._data[0]), self._data[2]))
|
layout.label(text=iface_("Rename %d %s") % (len(self._data[0]), self._data[2]), translate=False)
|
||||||
|
|
||||||
def check(self, context):
|
def check(self, context):
|
||||||
changed = False
|
changed = False
|
||||||
@@ -3083,7 +3083,7 @@ class WM_MT_splash_quick_setup(Menu):
|
|||||||
|
|
||||||
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
|
old_version = bpy.types.PREFERENCES_OT_copy_prev.previous_version()
|
||||||
if bpy.types.PREFERENCES_OT_copy_prev.poll(context) and old_version:
|
if bpy.types.PREFERENCES_OT_copy_prev.poll(context) and old_version:
|
||||||
sub.operator("preferences.copy_prev", text=iface_("Load %d.%d Settings", "Operator") % old_version)
|
sub.operator("preferences.copy_prev", text=iface_("Load %d.%d Settings", "Operator") % old_version, translate=False)
|
||||||
sub.operator("wm.save_userpref", text="Save New Settings")
|
sub.operator("wm.save_userpref", text="Save New Settings")
|
||||||
else:
|
else:
|
||||||
sub.label()
|
sub.label()
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import bpy
|
|||||||
from bpy.types import Menu, Panel, UIList
|
from bpy.types import Menu, Panel, UIList
|
||||||
from rna_prop_ui import PropertyPanel
|
from rna_prop_ui import PropertyPanel
|
||||||
|
|
||||||
from bpy.app.translations import pgettext_tip as tip_
|
from bpy.app.translations import (
|
||||||
|
pgettext_tip as iface_,
|
||||||
|
pgettext_tip as tip_,
|
||||||
|
)
|
||||||
|
|
||||||
class MESH_MT_vertex_group_context_menu(Menu):
|
class MESH_MT_vertex_group_context_menu(Menu):
|
||||||
bl_label = "Vertex Group Specials"
|
bl_label = "Vertex Group Specials"
|
||||||
@@ -549,7 +551,8 @@ class MESH_UL_attributes(UIList):
|
|||||||
sub = split.row()
|
sub = split.row()
|
||||||
sub.alignment = 'RIGHT'
|
sub.alignment = 'RIGHT'
|
||||||
sub.active = False
|
sub.active = False
|
||||||
sub.label(text="%s ▶ %s" % (domain_name, data_type.name))
|
sub.label(text="%s ▶ %s" % (iface_(domain_name), iface_(data_type.name)),
|
||||||
|
translate=False)
|
||||||
|
|
||||||
|
|
||||||
class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel):
|
class DATA_PT_mesh_attributes(MeshButtonsPanel, Panel):
|
||||||
@@ -650,7 +653,8 @@ class MESH_UL_color_attributes(UIList, ColorAttributesListBase):
|
|||||||
sub = split.row()
|
sub = split.row()
|
||||||
sub.alignment = 'RIGHT'
|
sub.alignment = 'RIGHT'
|
||||||
sub.active = False
|
sub.active = False
|
||||||
sub.label(text="%s ▶ %s" % (domain_name, data_type.name))
|
sub.label(text="%s ▶ %s" % (iface_(domain_name), iface_(data_type.name)),
|
||||||
|
translate=False)
|
||||||
|
|
||||||
active_render = _index == data.color_attributes.render_color_index
|
active_render = _index == data.color_attributes.render_color_index
|
||||||
|
|
||||||
|
|||||||
@@ -400,9 +400,12 @@ class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel, Panel):
|
|||||||
label = "ERROR"
|
label = "ERROR"
|
||||||
icon = 'ERROR'
|
icon = 'ERROR'
|
||||||
box.label(text=label, icon=icon)
|
box.label(text=label, icon=icon)
|
||||||
box.label(text="Iterations: %d .. %d (avg. %d)" %
|
box.label(text=iface_("Iterations: %d .. %d (avg. %d)") %
|
||||||
(result.min_iterations, result.max_iterations, result.avg_iterations))
|
(result.min_iterations, result.max_iterations, result.avg_iterations),
|
||||||
box.label(text="Error: %.5f .. %.5f (avg. %.5f)" % (result.min_error, result.max_error, result.avg_error))
|
translate=False)
|
||||||
|
box.label(text=iface_("Error: %.5f .. %.5f (avg. %.5f)")
|
||||||
|
% (result.min_error, result.max_error, result.avg_error),
|
||||||
|
translate=False)
|
||||||
|
|
||||||
|
|
||||||
class PARTICLE_PT_hair_dynamics_collision(ParticleButtonsPanel, Panel):
|
class PARTICLE_PT_hair_dynamics_collision(ParticleButtonsPanel, Panel):
|
||||||
@@ -756,7 +759,7 @@ class PARTICLE_PT_physics_fluid_advanced(ParticleButtonsPanel, Panel):
|
|||||||
particle_volume = part.mass / fluid.rest_density
|
particle_volume = part.mass / fluid.rest_density
|
||||||
spacing = pow(particle_volume, 1.0 / 3.0)
|
spacing = pow(particle_volume, 1.0 / 3.0)
|
||||||
|
|
||||||
sub.label(text="Spacing: %g" % spacing)
|
sub.label(text=iface_("Spacing: %g") % spacing, translate=False)
|
||||||
|
|
||||||
|
|
||||||
class PARTICLE_PT_physics_fluid_springs(ParticleButtonsPanel, Panel):
|
class PARTICLE_PT_physics_fluid_springs(ParticleButtonsPanel, Panel):
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import bpy
|
|||||||
from bpy.types import (
|
from bpy.types import (
|
||||||
Panel,
|
Panel,
|
||||||
)
|
)
|
||||||
|
from bpy.app.translations import pgettext_iface as iface_
|
||||||
|
|
||||||
from rna_prop_ui import PropertyPanel
|
from rna_prop_ui import PropertyPanel
|
||||||
|
|
||||||
@@ -67,7 +68,8 @@ class WORKSPACE_PT_addons(WorkSpaceButtonsPanel, Panel):
|
|||||||
row.operator(
|
row.operator(
|
||||||
"wm.owner_disable" if is_enabled else "wm.owner_enable",
|
"wm.owner_disable" if is_enabled else "wm.owner_enable",
|
||||||
icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT',
|
icon='CHECKBOX_HLT' if is_enabled else 'CHECKBOX_DEHLT',
|
||||||
text="%s: %s" % (info["category"], info["name"]),
|
text=iface_("%s: %s" ) % (iface_(info["category"]), iface_(info["name"])),
|
||||||
|
translate=False,
|
||||||
emboss=False,
|
emboss=False,
|
||||||
).owner_id = module_name
|
).owner_id = module_name
|
||||||
if is_enabled:
|
if is_enabled:
|
||||||
|
|||||||
@@ -168,8 +168,9 @@ class CLIP_HT_header(Header):
|
|||||||
r = active_object.reconstruction
|
r = active_object.reconstruction
|
||||||
|
|
||||||
if r.is_valid and sc.view == 'CLIP':
|
if r.is_valid and sc.view == 'CLIP':
|
||||||
layout.label(text="Solve error: %.2f px" %
|
layout.label(text=iface_("Solve error: %.2f px") %
|
||||||
(r.average_error))
|
(r.average_error),
|
||||||
|
translate=False)
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.prop(sc, "pivot_point", text="", icon_only=True)
|
row.prop(sc, "pivot_point", text="", icon_only=True)
|
||||||
@@ -737,8 +738,8 @@ class CLIP_PT_track(CLIP_PT_tracking_panel, Panel):
|
|||||||
layout.prop(act_track, "weight_stab")
|
layout.prop(act_track, "weight_stab")
|
||||||
|
|
||||||
if act_track.has_bundle:
|
if act_track.has_bundle:
|
||||||
label_text = "Average Error: %.2f px" % (act_track.average_error)
|
label_text = iface_("Average Error: %.2f px") % (act_track.average_error)
|
||||||
layout.label(text=label_text)
|
layout.label(text=label_text, translate=False)
|
||||||
|
|
||||||
layout.use_property_split = False
|
layout.use_property_split = False
|
||||||
|
|
||||||
|
|||||||
@@ -407,15 +407,20 @@ class TOPBAR_MT_file_defaults(Menu):
|
|||||||
app_template = None
|
app_template = None
|
||||||
|
|
||||||
if app_template:
|
if app_template:
|
||||||
layout.label(text=bpy.path.display_name(
|
layout.label(
|
||||||
app_template, has_ext=False))
|
text=iface_(bpy.path.display_name(app_template, has_ext=False),
|
||||||
|
i18n_contexts.id_workspace), translate=False)
|
||||||
|
|
||||||
layout.operator("wm.save_homefile")
|
layout.operator("wm.save_homefile")
|
||||||
if app_template:
|
if app_template:
|
||||||
display_name = bpy.path.display_name(iface_(app_template))
|
display_name = bpy.path.display_name(iface_(app_template))
|
||||||
props = layout.operator("wm.read_factory_settings", text="Load Factory Blender Settings")
|
props = layout.operator("wm.read_factory_settings",
|
||||||
|
text="Load Factory Blender Settings")
|
||||||
props.app_template = app_template
|
props.app_template = app_template
|
||||||
props = layout.operator("wm.read_factory_settings", text="Load Factory %s Settings" % display_name)
|
props = layout.operator("wm.read_factory_settings",
|
||||||
|
text=iface_("Load Factory %s Settings",
|
||||||
|
i18n_contexts.operator_default) % display_name,
|
||||||
|
translate=False)
|
||||||
props.app_template = app_template
|
props.app_template = app_template
|
||||||
props.use_factory_startup_app_template_only = True
|
props.use_factory_startup_app_template_only = True
|
||||||
del display_name
|
del display_name
|
||||||
|
|||||||
@@ -114,7 +114,9 @@ class USERPREF_MT_save_load(Menu):
|
|||||||
if app_template:
|
if app_template:
|
||||||
display_name = bpy.path.display_name(iface_(app_template))
|
display_name = bpy.path.display_name(iface_(app_template))
|
||||||
layout.operator("wm.read_factory_userpref", text="Load Factory Blender Preferences")
|
layout.operator("wm.read_factory_userpref", text="Load Factory Blender Preferences")
|
||||||
props = layout.operator("wm.read_factory_userpref", text="Load Factory %s Preferences" % display_name)
|
props = layout.operator("wm.read_factory_userpref",
|
||||||
|
text=iface_("Load Factory %s Preferences") % display_name,
|
||||||
|
translate=False)
|
||||||
props.use_factory_startup_app_template_only = True
|
props.use_factory_startup_app_template_only = True
|
||||||
del display_name
|
del display_name
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -18,7 +18,10 @@ from bl_ui.properties_grease_pencil_common import (
|
|||||||
from bl_ui.space_toolsystem_common import (
|
from bl_ui.space_toolsystem_common import (
|
||||||
ToolActivePanelHelper,
|
ToolActivePanelHelper,
|
||||||
)
|
)
|
||||||
from bpy.app.translations import contexts as i18n_contexts
|
from bpy.app.translations import (
|
||||||
|
pgettext_tip as tip_,
|
||||||
|
contexts as i18n_contexts,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class VIEW3D_HT_tool_header(Header):
|
class VIEW3D_HT_tool_header(Header):
|
||||||
@@ -1133,7 +1136,9 @@ class VIEW3D_MT_mirror(Menu):
|
|||||||
|
|
||||||
for (space_name, space_id) in (("Global", 'GLOBAL'), ("Local", 'LOCAL')):
|
for (space_name, space_id) in (("Global", 'GLOBAL'), ("Local", 'LOCAL')):
|
||||||
for axis_index, axis_name in enumerate("XYZ"):
|
for axis_index, axis_name in enumerate("XYZ"):
|
||||||
props = layout.operator("transform.mirror", text="%s %s" % (axis_name, space_name))
|
props = layout.operator("transform.mirror",
|
||||||
|
text="%s %s" % (axis_name, iface_(space_name)),
|
||||||
|
translate=False)
|
||||||
props.constraint_axis[axis_index] = True
|
props.constraint_axis[axis_index] = True
|
||||||
props.orient_type = space_id
|
props.orient_type = space_id
|
||||||
|
|
||||||
@@ -2549,16 +2554,16 @@ class VIEW3D_MT_object_context_menu(Menu):
|
|||||||
props.data_path_item = "data.lens"
|
props.data_path_item = "data.lens"
|
||||||
props.input_scale = 0.1
|
props.input_scale = 0.1
|
||||||
if obj.data.lens_unit == 'MILLIMETERS':
|
if obj.data.lens_unit == 'MILLIMETERS':
|
||||||
props.header_text = "Camera Focal Length: %.1fmm"
|
props.header_text = tip_("Camera Focal Length: %.1fmm")
|
||||||
else:
|
else:
|
||||||
props.header_text = "Camera Focal Length: %.1f\u00B0"
|
props.header_text = tip_("Camera Focal Length: %.1f\u00B0")
|
||||||
|
|
||||||
else:
|
else:
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
|
props = layout.operator("wm.context_modal_mouse", text="Camera Lens Scale")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.ortho_scale"
|
props.data_path_item = "data.ortho_scale"
|
||||||
props.input_scale = 0.01
|
props.input_scale = 0.01
|
||||||
props.header_text = "Camera Lens Scale: %.3f"
|
props.header_text = tip_("Camera Lens Scale: %.3f")
|
||||||
|
|
||||||
if not obj.data.dof.focus_object:
|
if not obj.data.dof.focus_object:
|
||||||
if view and view.camera == obj and view.region_3d.view_perspective == 'CAMERA':
|
if view and view.camera == obj and view.region_3d.view_perspective == 'CAMERA':
|
||||||
@@ -2568,7 +2573,7 @@ class VIEW3D_MT_object_context_menu(Menu):
|
|||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.dof.focus_distance"
|
props.data_path_item = "data.dof.focus_distance"
|
||||||
props.input_scale = 0.02
|
props.input_scale = 0.02
|
||||||
props.header_text = "Focus Distance: %.3f"
|
props.header_text = tip_("Focus Distance: %.3f")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
@@ -2579,13 +2584,13 @@ class VIEW3D_MT_object_context_menu(Menu):
|
|||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.extrude"
|
props.data_path_item = "data.extrude"
|
||||||
props.input_scale = 0.01
|
props.input_scale = 0.01
|
||||||
props.header_text = "Extrude: %.3f"
|
props.header_text = tip_("Extrude: %.3f")
|
||||||
|
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Offset")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Offset")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.offset"
|
props.data_path_item = "data.offset"
|
||||||
props.input_scale = 0.01
|
props.input_scale = 0.01
|
||||||
props.header_text = "Offset: %.3f"
|
props.header_text = tip_("Offset: %.3f")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
@@ -2596,7 +2601,7 @@ class VIEW3D_MT_object_context_menu(Menu):
|
|||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "empty_display_size"
|
props.data_path_item = "empty_display_size"
|
||||||
props.input_scale = 0.01
|
props.input_scale = 0.01
|
||||||
props.header_text = "Empty Display Size: %.3f"
|
props.header_text = tip_("Empty Display Size: %.3f")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
@@ -2614,36 +2619,36 @@ class VIEW3D_MT_object_context_menu(Menu):
|
|||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.energy"
|
props.data_path_item = "data.energy"
|
||||||
props.input_scale = 1.0
|
props.input_scale = 1.0
|
||||||
props.header_text = "Light Power: %.3f"
|
props.header_text = tip_("Light Power: %.3f")
|
||||||
|
|
||||||
if light.type == 'AREA':
|
if light.type == 'AREA':
|
||||||
if light.shape in {'RECTANGLE', 'ELLIPSE'}:
|
if light.shape in {'RECTANGLE', 'ELLIPSE'}:
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Area Light X Size")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Area Light X Size")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.size"
|
props.data_path_item = "data.size"
|
||||||
props.header_text = "Light Size X: %.3f"
|
props.header_text = tip_("Light Size X: %.3f")
|
||||||
|
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Area Light Y Size")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Area Light Y Size")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.size_y"
|
props.data_path_item = "data.size_y"
|
||||||
props.header_text = "Light Size Y: %.3f"
|
props.header_text = tip_("Light Size Y: %.3f")
|
||||||
else:
|
else:
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Area Light Size")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Area Light Size")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.size"
|
props.data_path_item = "data.size"
|
||||||
props.header_text = "Light Size: %.3f"
|
props.header_text = tip_("Light Size: %.3f")
|
||||||
|
|
||||||
elif light.type in {'SPOT', 'POINT'}:
|
elif light.type in {'SPOT', 'POINT'}:
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Light Radius")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Light Radius")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.shadow_soft_size"
|
props.data_path_item = "data.shadow_soft_size"
|
||||||
props.header_text = "Light Radius: %.3f"
|
props.header_text = tip_("Light Radius: %.3f")
|
||||||
|
|
||||||
elif light.type == 'SUN':
|
elif light.type == 'SUN':
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Sun Light Angle")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Sun Light Angle")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.angle"
|
props.data_path_item = "data.angle"
|
||||||
props.header_text = "Light Angle: %.3f"
|
props.header_text = tip_("Light Angle: %.3f")
|
||||||
|
|
||||||
if light.type == 'SPOT':
|
if light.type == 'SPOT':
|
||||||
layout.separator()
|
layout.separator()
|
||||||
@@ -2652,13 +2657,13 @@ class VIEW3D_MT_object_context_menu(Menu):
|
|||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.spot_size"
|
props.data_path_item = "data.spot_size"
|
||||||
props.input_scale = 0.01
|
props.input_scale = 0.01
|
||||||
props.header_text = "Spot Size: %.2f"
|
props.header_text = tip_("Spot Size: %.2f")
|
||||||
|
|
||||||
props = layout.operator("wm.context_modal_mouse", text="Adjust Spot Light Blend")
|
props = layout.operator("wm.context_modal_mouse", text="Adjust Spot Light Blend")
|
||||||
props.data_path_iter = "selected_editable_objects"
|
props.data_path_iter = "selected_editable_objects"
|
||||||
props.data_path_item = "data.spot_blend"
|
props.data_path_item = "data.spot_blend"
|
||||||
props.input_scale = -0.01
|
props.input_scale = -0.01
|
||||||
props.header_text = "Spot Blend: %.2f"
|
props.header_text = tip_("Spot Blend: %.2f")
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user