VR Scene Inspection: I18n: enable translation of UI messages #104432

Merged
Peter Kim merged 1 commits from pioverfour/blender-addons:dp_fix_vr_messages into blender-v3.5-release 2023-02-27 08:39:53 +01:00
3 changed files with 11 additions and 11 deletions

View File

@ -3,7 +3,7 @@
bl_info = { bl_info = {
"name": "VR Scene Inspection", "name": "VR Scene Inspection",
"author": "Julian Eisel (Severin), Sebastian Koenig, Peter Kim (muxed-reality)", "author": "Julian Eisel (Severin), Sebastian Koenig, Peter Kim (muxed-reality)",
"version": (0, 11, 1), "version": (0, 11, 2),
"blender": (3, 2, 0), "blender": (3, 2, 0),
"location": "3D View > Sidebar > VR", "location": "3D View > Sidebar > VR",
"description": ("View the viewport with virtual reality glasses " "description": ("View the viewport with virtual reality glasses "

View File

@ -7,6 +7,7 @@ else:
from . import properties from . import properties
import bpy import bpy
from bpy.app.translations import pgettext_iface as iface_
from bpy.types import ( from bpy.types import (
Menu, Menu,
Panel, Panel,
@ -37,12 +38,10 @@ class VIEW3D_PT_vr_session(Panel):
# Using SNAP_FACE because it looks like a stop icon -- I shouldn't # Using SNAP_FACE because it looks like a stop icon -- I shouldn't
# have commit rights... # have commit rights...
toggle_info = ( toggle_info = ((iface_("Start VR Session"), 'PLAY') if not is_session_running
("Start VR Session", 'PLAY') if not is_session_running else ( else (iface_("Stop VR Session"), 'SNAP_FACE'))
"Stop VR Session", 'SNAP_FACE') layout.operator("wm.xr_session_toggle", text=toggle_info[0],
) translate=False, icon=toggle_info[1])
layout.operator("wm.xr_session_toggle",
text=toggle_info[0], icon=toggle_info[1])
layout.separator() layout.separator()

View File

@ -8,6 +8,7 @@ else:
import bpy import bpy
import gpu import gpu
from bpy.app.translations import pgettext_data as data_
from bpy.types import ( from bpy.types import (
Gizmo, Gizmo,
GizmoGroup, GizmoGroup,
@ -117,8 +118,8 @@ class VIEW3D_OT_vr_camera_landmark_from_session(Operator):
loc = wm.xr_session_state.viewer_pose_location loc = wm.xr_session_state.viewer_pose_location
rot = wm.xr_session_state.viewer_pose_rotation.to_euler() rot = wm.xr_session_state.viewer_pose_rotation.to_euler()
cam = bpy.data.cameras.new("Camera_" + lm.name) cam = bpy.data.cameras.new(data_("Camera") + "_" + lm.name)
new_cam = bpy.data.objects.new("Camera_" + lm.name, cam) new_cam = bpy.data.objects.new(data_("Camera") + "_" + lm.name, cam)
scene.collection.objects.link(new_cam) scene.collection.objects.link(new_cam)
new_cam.location = loc new_cam.location = loc
new_cam.rotation_euler = rot new_cam.rotation_euler = rot
@ -215,8 +216,8 @@ class VIEW3D_OT_add_camera_from_vr_landmark(Operator):
scene = context.scene scene = context.scene
lm = properties.VRLandmark.get_selected_landmark(context) lm = properties.VRLandmark.get_selected_landmark(context)
cam = bpy.data.cameras.new("Camera_" + lm.name) cam = bpy.data.cameras.new(data_("Camera") + "_" + lm.name)
new_cam = bpy.data.objects.new("Camera_" + lm.name, cam) new_cam = bpy.data.objects.new(data_("Camera") + "_" + lm.name, cam)
scene.collection.objects.link(new_cam) scene.collection.objects.link(new_cam)
angle = lm.base_pose_angle angle = lm.base_pose_angle
new_cam.location = lm.base_pose_location new_cam.location = lm.base_pose_location