[Bf-extensions-cvs] [ac248239] soc-2019-openxr: Some adjustments to panel layouts, + PEP8 cleanup

Julian Eisel noreply at git.blender.org
Thu Mar 12 15:22:01 CET 2020


Commit: ac24823931e338f9f943ce440146aebfb87ef8c6
Author: Julian Eisel
Date:   Thu Mar 12 15:10:02 2020 +0100
Branches: soc-2019-openxr
https://developer.blender.org/rBAac24823931e338f9f943ce440146aebfb87ef8c6

Some adjustments to panel layouts, + PEP8 cleanup

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

M	viewport_vr_preview.py

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

diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py
index efeafd9f..ebce0c9b 100644
--- a/viewport_vr_preview.py
+++ b/viewport_vr_preview.py
@@ -201,7 +201,7 @@ class VIEW3D_UL_vr_landmarks(bpy.types.UIList):
         layout.emboss = 'NONE'
         layout.prop(landmark, "name", text="")
         props = layout.operator("view3d.vr_landmark_activate", text="", icon=('SOLO_ON' if index ==
-                                                                                   landmark_active_idx else 'SOLO_OFF'))
+                                                                              landmark_active_idx else 'SOLO_OFF'))
         props.index = index
 
 
@@ -223,7 +223,7 @@ class VIEW3D_PT_vr_landmarks(bpy.types.Panel):
         row = layout.row()
 
         row.template_list("VIEW3D_UL_vr_landmarks", "", scene, "vr_landmarks",
-                         scene, "vr_landmarks_selected", rows=3)
+                          scene, "vr_landmarks_selected", rows=3)
 
         col = row.column(align=True)
         col.operator("view3d.vr_landmark_add", icon='ADD', text="")
@@ -241,11 +241,11 @@ class VIEW3D_PT_vr_landmarks(bpy.types.Panel):
                             "base_pose_angle", text="Angle")
 
 
-class VIEW3D_PT_vr_session(bpy.types.Panel):
+class VIEW3D_PT_vr_session_view(bpy.types.Panel):
     bl_space_type = 'VIEW_3D'
     bl_region_type = 'UI'
     bl_category = "VR"
-    bl_label = "VR Session"
+    bl_label = "View"
 
     def draw(self, context):
         layout = self.layout
@@ -254,16 +254,6 @@ class VIEW3D_PT_vr_session(bpy.types.Panel):
         layout.use_property_split = True
         layout.use_property_decorate = False  # No animation.
 
-        is_session_running = bpy.types.XrRuntimeSessionState.is_running(context)
-
-        # Using SNAP_FACE because it looks like a stop icon -- I shouldn't have commit rights...
-        toggle_info = ("Start VR Session", 'PLAY') if not is_session_running else (
-            "Stop VR Session", 'SNAP_FACE')
-        layout.operator("wm.xr_session_toggle",
-                        text=toggle_info[0], icon=toggle_info[1])
-
-        layout.separator()
-
         layout.prop(session_settings, "show_floor", text="Floor")
         layout.prop(session_settings, "show_annotation", text="Annotations")
 
@@ -273,6 +263,29 @@ 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")
 
+
+class VIEW3D_PT_vr_session(bpy.types.Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'UI'
+    bl_category = "VR"
+    bl_label = "VR Session"
+
+    def draw(self, context):
+        layout = self.layout
+        session_settings = context.window_manager.xr_session_settings
+
+        layout.use_property_split = True
+        layout.use_property_decorate = False  # No animation.
+
+        is_session_running = bpy.types.XrRuntimeSessionState.is_running(
+            context)
+
+        # Using SNAP_FACE because it looks like a stop icon -- I shouldn't have commit rights...
+        toggle_info = ("Start VR Session", 'PLAY') if not is_session_running else (
+            "Stop VR Session", 'SNAP_FACE')
+        layout.operator("wm.xr_session_toggle",
+                        text=toggle_info[0], icon=toggle_info[1])
+
         layout.separator()
 
         layout.prop(session_settings, "use_positional_tracking")
@@ -498,6 +511,7 @@ class VIEW3D_GGT_vr_viewer(GizmoGroup):
 
 classes = (
     VIEW3D_PT_vr_session,
+    VIEW3D_PT_vr_session_view,
     VIEW3D_PT_vr_session_shading,
     VIEW3D_PT_vr_session_shading_lighting,
     VIEW3D_PT_vr_session_shading_color,
@@ -537,11 +551,12 @@ def register():
     # View3DShading is the only per 3D-View struct with custom property
     # support, so "abusing" that to get a per 3D-View option.
     bpy.types.View3DShading.vr_show_virtual_camera = BoolProperty(
-        name="Show Virtual Camera"
+        name="Show VR Camera"
     )
 
     bpy.app.handlers.load_post.append(ensure_default_vr_landmark)
 
+
 def unregister():
     if not bpy.app.build_options.xr_openxr:
         return
@@ -556,5 +571,6 @@ def unregister():
 
     bpy.app.handlers.load_post.remove(ensure_default_vr_landmark)
 
+
 if __name__ == "__main__":
     register()



More information about the Bf-extensions-cvs mailing list