[Bf-extensions-cvs] [4612e79c] soc-2019-openxr: Add-on to wrap the Toggle VR Session operator

Julian Eisel noreply at git.blender.org
Mon Aug 19 23:51:28 CEST 2019


Commit: 4612e79c52b934d3695f0594a947c937983f9eec
Author: Julian Eisel
Date:   Mon Aug 19 23:48:46 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rBA4612e79c52b934d3695f0594a947c937983f9eec

Add-on to wrap the Toggle VR Session operator

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

A	viewport_vr_preview.py

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

diff --git a/viewport_vr_preview.py b/viewport_vr_preview.py
new file mode 100644
index 00000000..97820a0f
--- /dev/null
+++ b/viewport_vr_preview.py
@@ -0,0 +1,63 @@
+# ##### BEGIN GPL LICENSE BLOCK #####
+#
+#  This program is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU General Public License
+#  as published by the Free Software Foundation; either version 2
+#  of the License, or (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program; if not, write to the Free Software Foundation,
+#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+#
+# ##### END GPL LICENSE BLOCK #####
+
+# <pep8 compliant>
+
+import bpy
+
+bl_info = {
+    "name": "Basic VR Viewer",
+    "author": "Julian Eisel (Severin)",
+    "version": (0, 0, 1),
+    "blender": (2, 81, 0),
+    "location": "Window > Toggle VR Session",
+    "description": ("Enable viewing the Blender viewport within virtual "
+                    "reality glasses."),
+    "warning": "This is an early, limited preview of in development VR "
+               "support for Blender.",
+    "category": "3D View",
+}
+
+
+def window_menu_append_func(self, context):
+    self.layout.separator()
+
+    # TODO WITH_OPENXR
+    self.layout.operator("wm.xr_session_toggle")
+
+
+classes = (
+)
+
+
+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)
+
+
+if __name__ == "__main__":
+    register()



More information about the Bf-extensions-cvs mailing list