[Bf-blender-cvs] [20763919a1] HMD_viewport: Fix issues changing HMD device

Julian Eisel noreply at git.blender.org
Sun Mar 5 23:49:02 CET 2017


Commit: 20763919a1f695d0cfd11df1a7c7d0572dc024bc
Author: Julian Eisel
Date:   Sun Mar 5 23:48:43 2017 +0100
Branches: HMD_viewport
https://developer.blender.org/rB20763919a1f695d0cfd11df1a7c7d0572dc024bc

Fix issues changing HMD device

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

M	release/scripts/startup/bl_ui/space_userpref.py
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index d0e1b2deeb..adfd1a9e4f 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -439,7 +439,6 @@ class USERPREF_PT_system(Panel):
             col.label(text="OpenSubdiv compute:")
             col.row().prop(system, "opensubdiv_compute_type", text="")
 
-
         if bpy.app.build_options.input_hmd:
             col.separator()
 
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 29ca227a14..b2262aa88d 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -616,13 +616,9 @@ static void rna_userdef_hmd_device_update(Main *UNUSED(bmain), Scene *UNUSED(sce
 {
 	const int act_device = WM_device_HMD_current_get();
 
-	/* Change the active device. */
-	if (act_device < 0) {
-		/* pass, no device active */
-	}
-	else if (U.hmd_settings.device < 0) {
+	if (U.hmd_settings.device < 0) {
 		/* disabled device ('None' entry) */
-		WM_device_HMD_state_set(U.hmd_settings.device, false);
+		WM_device_HMD_state_set(act_device, false);
 	}
 	else if (act_device != U.hmd_settings.device) {
 		/* change device */




More information about the Bf-blender-cvs mailing list