[Bf-blender-cvs] [d5f0807c63] HMD_viewport: Fix python UI for building without HMD

Julian Eisel noreply at git.blender.org
Sun Mar 5 23:39:59 CET 2017


Commit: d5f0807c6356417b79926d0baca9b310296f1c60
Author: Julian Eisel
Date:   Sun Mar 5 23:39:34 2017 +0100
Branches: HMD_viewport
https://developer.blender.org/rBd5f0807c6356417b79926d0baca9b310296f1c60

Fix python UI for building without HMD

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	release/scripts/startup/bl_ui/space_view3d.py
M	source/blender/python/intern/bpy_app_build_options.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 95486773d4..d0e1b2deeb 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -439,16 +439,18 @@ class USERPREF_PT_system(Panel):
             col.label(text="OpenSubdiv compute:")
             col.row().prop(system, "opensubdiv_compute_type", text="")
 
-        col.separator()
 
-        col.label(text="Head Mounted Displays:")
-        col.prop(system, "hmd_device", text="Device")
-        col.prop(system, "hmd_use_device_rotation")
-        col.prop(system, "hmd_use_device_ipd")
-        subcol = col.column()
-        subcol.active = not system.hmd_use_device_ipd or system.hmd_device == 'NONE'
-        subcol.prop(system, "hmd_custom_ipd")
-        col.prop(system, "hmd_lensdist_type", text="Lens Distortion")
+        if bpy.app.build_options.input_hmd:
+            col.separator()
+
+            col.label(text="Head Mounted Displays:")
+            col.prop(system, "hmd_device", text="Device")
+            col.prop(system, "hmd_use_device_rotation")
+            col.prop(system, "hmd_use_device_ipd")
+            subcol = col.column()
+            subcol.active = not system.hmd_use_device_ipd or system.hmd_device == 'NONE'
+            subcol.prop(system, "hmd_custom_ipd")
+            col.prop(system, "hmd_lensdist_type", text="Lens Distortion")
 
         # 2. Column
         column = split.column()
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index e8ebc5b1e3..21404f8c8d 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -3396,6 +3396,10 @@ class VIEW3D_PT_view3d_hmd_view(Panel):
     bl_label = "HMD View"
     bl_options = {'DEFAULT_CLOSED'}
 
+    @classmethod
+    def poll(cls, context):
+        return bpy.app.build_options.input_hmd
+
     def draw(self, context):
         layout = self.layout
 
diff --git a/source/blender/python/intern/bpy_app_build_options.c b/source/blender/python/intern/bpy_app_build_options.c
index a6b98567a9..8f77caa68e 100644
--- a/source/blender/python/intern/bpy_app_build_options.c
+++ b/source/blender/python/intern/bpy_app_build_options.c
@@ -51,6 +51,7 @@ static PyStructSequence_Field app_builtopts_info_fields[] = {
 	{(char *)"image_openexr", NULL},
 	{(char *)"image_openjpeg", NULL},
 	{(char *)"image_tiff", NULL},
+	{(char *)"input_hmd", NULL},
 	{(char *)"input_ndof", NULL},
 	{(char *)"audaspace", NULL},
 	{(char *)"international", NULL},




More information about the Bf-blender-cvs mailing list