Blender Git Loki

Git Commits -> Revision 9dda654

Revision 9dda654 by Peter Kim (master)
October 12, 2021, 07:18 (GMT)
XR Controller Support Step 4: Controller Drawing

Addresses T77127 (Controller Drawing).

Adds VR controller visualization and custom drawing via draw
handlers. Add-ons can draw to the XR surface (headset display) and
mirror window by adding a View3D draw handler of region type 'XR' and
draw type 'POST_VIEW'. Controller drawing and custom overlays can be
toggled individually as XR session options, which will be added in a
future update to the VR Scene Inspection add-on.

For the actual drawing, the OpenXR XR_MSFT_controller_model extension
is used to load a glTF model provided by the XR runtime. The model's
vertex data is then used to create a GPUBatch in the XR session
state. Finally, this batch is drawn via the XR surface draw handler
mentioned above.

For runtimes that do not support the controller model extension, a
a simple fallback shape (sphere) is drawn instead.

Reviewed By: Severin, fclem

Differential Revision: https://developer.blender.org/D10948

Commit Details:

Full Hash: 9dda65455b54336fe3efef91eba9e41866dac1c1
Parent Commit: cfa59b3
Lines Changed: +1319, -24

2 Added Paths:

/intern/ghost/intern/GHOST_XrControllerModel.cpp (+629, -0) (View)
/intern/ghost/intern/GHOST_XrControllerModel.h (+59, -0) (View)

23 Modified Paths:

/intern/ghost/CMakeLists.txt (+7, -0) (Diff)
/intern/ghost/GHOST_C-api.h (+24, -0) (Diff)
/intern/ghost/GHOST_Types.h (+24, -1) (Diff)
/intern/ghost/intern/GHOST_C-api.cpp (+35, -0) (Diff)
/intern/ghost/intern/GHOST_XrContext.cpp (+4, -1) (Diff)
/intern/ghost/intern/GHOST_XRSession.cpp (+71, -0) (Diff)
/intern/ghost/intern/GHOST_XrSession.h (+6, -0) (Diff)
/source/blender/draw/intern/draw_manager.c (+62, -0) (Diff)
/source/blender/editors/include/ED_space_api.h (+3, -2) (Diff)
/source/blender/editors/include/ED_view3d_offscreen.h (+2, -1) (Diff)
/source/blender/editors/space_api/spacetypes.c (+12, -2) (Diff)
/source/blender/editors/space_view3d/space_view3d.c (+5, -0) (Diff)
/source/blender/editors/space_view3d/view3d_draw.c (+36, -12) (Diff)
/source/blender/makesdna/DNA_screen_types.h (+4, -1) (Diff)
/source/blender/makesdna/DNA_view3d_enums.h (+3, -0) (Diff)
/source/blender/makesdna/DNA_view3d_types.h (+3, -0) (Diff)
/source/blender/makesdna/DNA_xr_types.h (+10, -1) (Diff)
/source/blender/makesrna/intern/rna_screen.c (+1, -0) (Diff)
/source/blender/makesrna/intern/rna_xr.c (+39, -0) (Diff)
/source/blender/windowmanager/WM_api.h (+2, -0) (Diff)
/source/blender/windowmanager/xr/intern/wm_xr_draw.c (+203, -0) (Diff)
/source/blender/windowmanager/xr/intern/wm_xr_intern.h (+12, -2) (Diff)
/source/blender/windowmanager/xr/intern/wm_xr_session.c (+63, -1) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021