[Bf-blender-cvs] [2ccdd0b] HMD_viewport: Fix non-HMD window not drawing viewport in camera view

Julian Eisel noreply at git.blender.org
Wed Aug 3 16:49:02 CEST 2016


Commit: 2ccdd0be5128e7cd04533c6f51dc7214a46dcfde
Author: Julian Eisel
Date:   Wed Aug 3 16:48:04 2016 +0200
Branches: HMD_viewport
https://developer.blender.org/rB2ccdd0be5128e7cd04533c6f51dc7214a46dcfde

Fix non-HMD window not drawing viewport in camera view

Also added WITH_INPUT_HMD checks

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

M	source/blender/editors/space_view3d/view3d_draw.c

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

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 189568f..7fd5e6f 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -3784,21 +3784,24 @@ static void view3d_stereo3d_setup(Scene *scene, View3D *v3d, ARegion *ar, const
 		data->shiftx = shiftx;
 		BLI_unlock_thread(LOCK_VIEW3D);
 	}
+#ifdef WITH_INPUT_HMD
 	else if (scene->r.views_format == SCE_VIEWS_FORMAT_HMD) {
-		if (is_hmd_view) {
-			float viewmat[4][4];
-			float projmat[4][4];
+		float viewmat[4][4];
+		float projmat[4][4];
 
-			BLI_lock_thread(LOCK_VIEW3D);
+		BLI_lock_thread(LOCK_VIEW3D);
 
-			BKE_camera_multiview_view_matrix(&scene->r, v3d->camera, is_left, viewmat);
-			BKE_camera_multiview_proj_matrix(is_left, projmat);
+		BKE_camera_multiview_view_matrix(&scene->r, v3d->camera, is_left, viewmat);
+		BKE_camera_multiview_proj_matrix(is_left, projmat);
 
-			view3d_main_region_setup_view(scene, v3d, ar, viewmat, projmat);
+		view3d_main_region_setup_view(scene, v3d, ar, viewmat, projmat);
 
-			BLI_unlock_thread(LOCK_VIEW3D);
-		}
+		BLI_unlock_thread(LOCK_VIEW3D);
+
+		BLI_assert(is_hmd_view == true);
+		UNUSED_VARS_NDEBUG(is_hmd_view);
 	}
+#endif
 	else { /* SCE_VIEWS_FORMAT_MULTIVIEW */
 		float viewmat[4][4];
 		Object *view_ob = v3d->camera;
@@ -3873,10 +3876,18 @@ static void view3d_main_region_draw_objects(
 	}
 
 	/* setup the view matrix */
-	if (view3d_stereo3d_active(C, scene, v3d, rv3d))
+	if (view3d_stereo3d_active(C, scene, v3d, rv3d) &&
+#ifdef WITH_INPUT_HMD
+	    (scene->r.views_format != SCE_VIEWS_FORMAT_HMD || is_hmd_view))
+#else
+	    true)
+#endif
+	{
 		view3d_stereo3d_setup(scene, v3d, ar, is_hmd_view);
-	else
+	}
+	else {
 		view3d_main_region_setup_view(scene, v3d, ar, NULL, NULL);
+	}
 
 	rv3d->rflag &= ~RV3D_IS_GAME_ENGINE;
 #ifdef WITH_GAMEENGINE




More information about the Bf-blender-cvs mailing list