[Bf-extensions-cvs] [a2272780] soc-2019-openxr: Rename "VR Pose Bookmarks" -> "VR Landmark"
Julian Eisel
noreply at git.blender.org
Thu Feb 27 19:25:24 CET 2020
Commit: a227278065ed4a74a54e129622a5b48120ea15b8
Author: Julian Eisel
Date: Thu Feb 27 19:24:28 2020 +0100
Branches: soc-2019-openxr
https://developer.blender.org/rBAa227278065ed4a74a54e129622a5b48120ea15b8
Rename "VR Pose Bookmarks" -> "VR Landmark"
The term pose is already used for something entirely different in
Blender.
===================================================================
M viewport_vr_preview.py
===================================================================
diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py
index b73ba443..186f517e 100644
--- a/viewport_vr_preview.py
+++ b/viewport_vr_preview.py
@@ -51,101 +51,101 @@ bl_info = {
@persistent
-def ensure_default_vr_pose_bookmark(context: bpy.context):
- # Ensure there's a default bookmark (scene camera by default).
- bookmarks = bpy.context.scene.vr_pose_bookmarks
- if len(bookmarks) == 0:
- bookmarks.add()
- bookmarks[0].type = 'SCENE_CAMERA'
+def ensure_default_vr_landmark(context: bpy.context):
+ # Ensure there's a default landmark (scene camera by default).
+ landmarks = bpy.context.scene.vr_landmarks
+ if len(landmarks) == 0:
+ landmarks.add()
+ landmarks[0].type = 'SCENE_CAMERA'
-def xr_pose_bookmark_active_type_update(self, context):
+def xr_landmark_active_type_update(self, context):
wm = context.window_manager
session_settings = wm.xr_session_settings
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
# Update session's base pose type to the matching type.
- if bookmark_active.type == 'SCENE_CAMERA':
+ if landmark_active.type == 'SCENE_CAMERA':
session_settings.base_pose_type = 'SCENE_CAMERA'
- elif bookmark_active.type == 'USER_CAMERA':
+ elif landmark_active.type == 'USER_CAMERA':
session_settings.base_pose_type = 'OBJECT'
- elif bookmark_active.type == 'CUSTOM':
+ elif landmark_active.type == 'CUSTOM':
session_settings.base_pose_type = 'CUSTOM'
-def xr_pose_bookmark_active_camera_update(self, context):
+def xr_landmark_active_camera_update(self, context):
session_settings = context.window_manager.xr_session_settings
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- # Update the anchor object to the (new) camera of this bookmark.
- session_settings.base_pose_object = bookmark_active.base_pose_camera
+ # Update the anchor object to the (new) camera of this landmark.
+ session_settings.base_pose_object = landmark_active.base_pose_camera
-def xr_pose_bookmark_active_base_pose_location_update(self, context):
+def xr_landmark_active_base_pose_location_update(self, context):
session_settings = context.window_manager.xr_session_settings
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- session_settings.base_pose_location = bookmark_active.base_pose_location
+ session_settings.base_pose_location = landmark_active.base_pose_location
-def xr_pose_bookmark_active_base_pose_angle_update(self, context):
+def xr_landmark_active_base_pose_angle_update(self, context):
session_settings = context.window_manager.xr_session_settings
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- session_settings.base_pose_angle = bookmark_active.base_pose_angle
+ session_settings.base_pose_angle = landmark_active.base_pose_angle
-def xr_pose_bookmark_type_update(self, context):
- bookmark_selected = VRPoseBookmark.get_selected_bookmark(context)
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+def xr_landmark_type_update(self, context):
+ landmark_selected = VRLandmark.get_selected_landmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- # Only update session settings data if the changed bookmark is actually the active one.
- if bookmark_active == bookmark_selected:
- xr_pose_bookmark_active_type_update(self, context)
+ # Only update session settings data if the changed landmark is actually the active one.
+ if landmark_active == landmark_selected:
+ xr_landmark_active_type_update(self, context)
-def xr_pose_bookmark_camera_update(self, context):
- bookmark_selected = VRPoseBookmark.get_selected_bookmark(context)
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+def xr_landmark_camera_update(self, context):
+ landmark_selected = VRLandmark.get_selected_landmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- # Only update session settings data if the changed bookmark is actually the active one.
- if bookmark_active == bookmark_selected:
- xr_pose_bookmark_active_camera_update(self, context)
+ # Only update session settings data if the changed landmark is actually the active one.
+ if landmark_active == landmark_selected:
+ xr_landmark_active_camera_update(self, context)
-def xr_pose_bookmark_base_pose_location_update(self, context):
- bookmark_selected = VRPoseBookmark.get_selected_bookmark(context)
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+def xr_landmark_base_pose_location_update(self, context):
+ landmark_selected = VRLandmark.get_selected_landmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- # Only update session settings data if the changed bookmark is actually the active one.
- if bookmark_active == bookmark_selected:
- xr_pose_bookmark_active_base_pose_location_update(self, context)
+ # Only update session settings data if the changed landmark is actually the active one.
+ if landmark_active == landmark_selected:
+ xr_landmark_active_base_pose_location_update(self, context)
-def xr_pose_bookmark_base_pose_angle_update(self, context):
- bookmark_selected = VRPoseBookmark.get_selected_bookmark(context)
- bookmark_active = VRPoseBookmark.get_active_bookmark(context)
+def xr_landmark_base_pose_angle_update(self, context):
+ landmark_selected = VRLandmark.get_selected_landmark(context)
+ landmark_active = VRLandmark.get_active_landmark(context)
- # Only update session settings data if the changed bookmark is actually the active one.
- if bookmark_active == bookmark_selected:
- xr_pose_bookmark_active_base_pose_angle_update(self, context)
+ # Only update session settings data if the changed landmark is actually the active one.
+ if landmark_active == landmark_selected:
+ xr_landmark_active_base_pose_angle_update(self, context)
-def xr_pose_bookmark_camera_object_poll(self, object):
+def xr_landmark_camera_object_poll(self, object):
return object.type == 'CAMERA'
-def xr_pose_bookmark_active_update(self, context):
- xr_pose_bookmark_active_type_update(self, context)
- xr_pose_bookmark_active_camera_update(self, context)
- xr_pose_bookmark_active_base_pose_location_update(self, context)
- xr_pose_bookmark_active_base_pose_angle_update(self, context)
+def xr_landmark_active_update(self, context):
+ xr_landmark_active_type_update(self, context)
+ xr_landmark_active_camera_update(self, context)
+ xr_landmark_active_base_pose_location_update(self, context)
+ xr_landmark_active_base_pose_angle_update(self, context)
-class VRPoseBookmark(bpy.types.PropertyGroup):
+class VRLandmark(bpy.types.PropertyGroup):
name: bpy.props.StringProperty(
- name="VR Pose Bookmark",
- default="VR Pose"
+ name="VR Landmark",
+ default="Landmark"
)
type: bpy.props.EnumProperty(
name="Type",
@@ -158,86 +158,86 @@ class VRPoseBookmark(bpy.types.PropertyGroup):
"Allow a manually definied position and rotation to be used as the VR view base pose"),
],
default='SCENE_CAMERA',
- update=xr_pose_bookmark_type_update,
+ update=xr_landmark_type_update,
)
base_pose_camera: bpy.props.PointerProperty(
name="Camera",
type=bpy.types.Object,
- poll=xr_pose_bookmark_camera_object_poll,
- update=xr_pose_bookmark_camera_update,
+ poll=xr_landmark_camera_object_poll,
+ update=xr_landmark_camera_update,
)
base_pose_location: bpy.props.FloatVectorProperty(
name="Base Pose Location",
subtype='TRANSLATION',
- update=xr_pose_bookmark_base_pose_location_update,
+ update=xr_landmark_base_pose_location_update,
)
base_pose_angle: bpy.props.FloatProperty(
name="Base Pose Angle",
subtype='ANGLE',
- update=xr_pose_bookmark_base_pose_angle_update,
+ update=xr_landmark_base_pose_angle_update,
)
@staticmethod
- def get_selected_bookmark(context):
+ def get_selected_landmark(context):
scene = context.scene
- bookmarks = scene.vr_pose_bookmarks
+ landmarks = scene.vr_landmarks
- return None if len(bookmarks) < 1 else bookmarks[scene.vr_pose_bookmarks_selected]
+ return None if len(landmarks) < 1 else landmarks[scene.vr_landmarks_selected]
@staticmethod
- def get_active_bookmark(context):
+ def get_active_landmark(context):
scene = context.scene
- bookmarks = scene.vr_pose_bookmarks
+ landmarks = scene.vr_landmarks
- return None if len(bookmarks) < 1 else bookmarks[scene.vr_pose_bookmarks_active]
+ return None if len(landmarks) < 1 else landmarks[scene.vr_landmarks_active]
-class VIEW3D_UL_vr_pose_bookmarks(bpy.types.UIList):
+class VIEW3D_UL_vr_landmarks(bpy.types.UIList):
def draw_item(self, context, layout, _data, item, icon, _active_data, _active_propname, index):
- bookmark = item
- bookmark_active_idx = context.scene.vr_pose_bookmarks_active
+ landmark = item
+ landmark_active_idx = context.scene.vr_landmarks_active
layout.emboss = 'NONE'
- layout.prop(bookmark, "name", text="")
- props = layout.operator("view3d.vr_pose_bookmark_activate", text="", icon=('SOLO_ON' if index ==
- bookmark_active_idx else 'SOLO_OFF'))
+ layout.prop(landmark, "name", text="")
+ props = layout.operator("view3d.vr_landmark_activate", text="", icon=('SOLO_ON' if index ==
+ landmark_active_idx else 'SOLO_OFF'))
props.index = index
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list