[Bf-extensions-cvs] [bfa7b6be] soc-2019-openxr: Move "Toggle VR Session" button into sidebar

Julian Eisel noreply at git.blender.org
Wed Dec 11 19:13:47 CET 2019


Commit: bfa7b6bef4e3bc71cbae0bb86002ca8c13ebb6d1
Author: Julian Eisel
Date:   Wed Dec 11 19:12:33 2019 +0100
Branches: soc-2019-openxr
https://developer.blender.org/rBAbfa7b6bef4e3bc71cbae0bb86002ca8c13ebb6d1

Move "Toggle VR Session" button into sidebar

Now that we have a "VR" tab in there with all the relating settings, it
makes sense to move this button there as well. Also makes it less of a
hassle to access it.

===================================================================

M	viewport_vr_preview.py

===================================================================

diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py
index 560f6ee8..419c1a22 100644
--- a/viewport_vr_preview.py
+++ b/viewport_vr_preview.py
@@ -35,12 +35,6 @@ bl_info = {
 }
 
 
-def window_menu_append_func(self, context):
-    if bpy.app.build_options.openxr:
-        self.layout.separator()
-        self.layout.operator("wm.xr_session_toggle")
-
-
 class VIEW3D_PT_vr_session(bpy.types.Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
@@ -54,6 +48,10 @@ class VIEW3D_PT_vr_session(bpy.types.Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
+        self.layout.operator("wm.xr_session_toggle")
+
+        self.layout.separator()
+
         layout.prop(session_settings, "shading_type", text="Shading")
         layout.prop(session_settings, "show_floor", text="Floor")
         layout.prop(session_settings, "show_annotation", text="Annotations")
@@ -64,6 +62,10 @@ class VIEW3D_PT_vr_session(bpy.types.Panel):
         col.prop(session_settings, "clip_start", text="Clip Start")
         col.prop(session_settings, "clip_end", text="End")
 
+        layout.separator()
+
+        layout.prop(session_settings, "use_positional_tracking")
+
 
 classes = (
     VIEW3D_PT_vr_session,
@@ -74,12 +76,8 @@ def register():
     for cls in classes:
         bpy.utils.register_class(cls)
 
-    bpy.types.TOPBAR_MT_window.append(window_menu_append_func)
-
 
 def unregister():
-    bpy.types.TOPBAR_MT_window.remove(window_menu_append_func)
-
     for cls in classes:
         bpy.utils.unregister_class(cls)



More information about the Bf-extensions-cvs mailing list