[Bf-blender-cvs] [814931d27d0] vr_scene_inspection: Merge branch 'soc-2019-openxr' into vr_scene_inspection

Julian Eisel noreply at git.blender.org
Mon Mar 9 12:20:45 CET 2020


Commit: 814931d27d01e5883c94658e7c963268088af7bd
Author: Julian Eisel
Date:   Mon Mar 9 12:20:29 2020 +0100
Branches: vr_scene_inspection
https://developer.blender.org/rB814931d27d01e5883c94658e7c963268088af7bd

Merge branch 'soc-2019-openxr' into vr_scene_inspection

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



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

diff --cc source/blender/blenloader/intern/writefile.c
index f90f7c55a3c,0c9363043ee..40ff2f76d1b
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@@ -2723,19 -2756,12 +2756,19 @@@ static void write_gpencil(WriteData *wd
    }
  }
  
 +#ifdef WITH_XR_OPENXR
 +static void write_wm_xr_data(WriteData *wd, wmXrData *xr_data)
 +{
 +  write_view3dshading(wd, &xr_data->session_settings.shading);
 +}
 +#endif
 +
- static void write_region(WriteData *wd, ARegion *ar, int spacetype)
+ static void write_region(WriteData *wd, ARegion *region, int spacetype)
  {
-   writestruct(wd, DATA, ARegion, 1, ar);
+   writestruct(wd, DATA, ARegion, 1, region);
  
-   if (ar->regiondata) {
-     if (ar->flag & RGN_FLAG_TEMP_REGIONDATA) {
+   if (region->regiondata) {
+     if (region->flag & RGN_FLAG_TEMP_REGIONDATA) {
        return;
      }
  
diff --cc source/blender/editors/include/ED_view3d.h
index 647dfd463ec,7b9e4cfe7bf..60d19b41071
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@@ -564,43 -584,10 +584,11 @@@ void ED_draw_object_facemap(struct Deps
  struct RenderEngineType *ED_view3d_engine_type(struct Scene *scene, int drawtype);
  
  bool ED_view3d_context_activate(struct bContext *C);
- void ED_view3d_draw_offscreen(struct Depsgraph *depsgraph,
-                               struct Scene *scene,
-                               int drawtype,
-                               struct View3D *v3d,
-                               struct ARegion *ar,
-                               int winx,
-                               int winy,
-                               float viewmat[4][4],
-                               float winmat[4][4],
-                               bool do_sky,
-                               bool is_persp,
-                               const char *viewname,
-                               const bool do_color_management,
-                               struct GPUOffScreen *ofs,
-                               struct GPUViewport *viewport);
- void ED_view3d_draw_offscreen_simple(struct Depsgraph *depsgraph,
-                                      struct Scene *scene,
-                                      struct View3DShading *shading_override,
-                                      int drawtype,
-                                      int winx,
-                                      int winy,
-                                      unsigned int draw_flags,
-                                      float viewmat[4][4],
-                                      float winmat[4][4],
-                                      float clip_start,
-                                      float clip_end,
-                                      bool do_sky,
-                                      bool is_persp,
-                                      const char *viewname,
-                                      const bool do_color_management,
-                                      struct GPUOffScreen *ofs,
-                                      struct GPUViewport *viewport);
 -void ED_view3d_draw_setup_view(struct wmWindow *win,
 +void ED_view3d_draw_setup_view(const struct wmWindowManager *wm,
 +                               struct wmWindow *win,
                                 struct Depsgraph *depsgraph,
                                 struct Scene *scene,
-                                struct ARegion *ar,
+                                struct ARegion *region,
                                 struct View3D *v3d,
                                 float viewmat[4][4],
                                 float winmat[4][4],
diff --cc source/blender/editors/screen/screen_ops.c
index 073031f84f8,74c65765cbe..c01f1ed243c
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@@ -3905,15 -3912,15 +3912,15 @@@ static int region_quadview_exec(bContex
         *
         * We could avoid manipulating rv3d->localvd here if exiting
         * localview with a 4-split would assign these view locks */
-       RegionView3D *rv3d = ar->regiondata;
+       RegionView3D *rv3d = region->regiondata;
        const char viewlock = (rv3d->viewlock_quad & RV3D_VIEWLOCK_INIT) ?
                                  (rv3d->viewlock_quad & ~RV3D_VIEWLOCK_INIT) :
 -                                RV3D_LOCKED;
 +                                RV3D_LOCK_ROTATION;
  
        region_quadview_init_rv3d(
-           sa, ar, viewlock, ED_view3d_lock_view_from_index(index_qsplit++), RV3D_ORTHO);
+           sa, region, viewlock, ED_view3d_lock_view_from_index(index_qsplit++), RV3D_ORTHO);
        region_quadview_init_rv3d(sa,
-                                 (ar = ar->next),
+                                 (region = region->next),
                                  viewlock,
                                  ED_view3d_lock_view_from_index(index_qsplit++),
                                  RV3D_ORTHO);
diff --cc source/blender/editors/sculpt_paint/paint_cursor.c
index 541abcd0b3b,dd922834d9e..0ddce872545
--- a/source/blender/editors/sculpt_paint/paint_cursor.c
+++ b/source/blender/editors/sculpt_paint/paint_cursor.c
@@@ -1507,11 -1443,10 +1444,11 @@@ static void paint_draw_cursor(bContext 
  
            /* Draw 3D brush cursor. */
            GPU_matrix_push_projection();
 -          ED_view3d_draw_setup_view(CTX_wm_window(C),
 +          ED_view3d_draw_setup_view(wm,
 +                                    CTX_wm_window(C),
                                      CTX_data_depsgraph_pointer(C),
                                      CTX_data_scene(C),
-                                     ar,
+                                     region,
                                      CTX_wm_view3d(C),
                                      NULL,
                                      NULL,
@@@ -1602,11 -1537,10 +1539,11 @@@
                !is_multires) {
              if (BKE_pbvh_type(ss->pbvh) == PBVH_FACES && ss->deform_modifiers_active) {
                GPU_matrix_push_projection();
 -              ED_view3d_draw_setup_view(CTX_wm_window(C),
 +              ED_view3d_draw_setup_view(wm,
 +                                        CTX_wm_window(C),
                                          CTX_data_depsgraph_pointer(C),
                                          CTX_data_scene(C),
-                                         ar,
+                                         region,
                                          CTX_wm_view3d(C),
                                          NULL,
                                          NULL,
@@@ -1622,11 -1556,10 +1559,11 @@@
            if (brush->sculpt_tool == SCULPT_TOOL_MULTIPLANE_SCRAPE &&
                brush->flag2 & BRUSH_MULTIPLANE_SCRAPE_PLANES_PREVIEW && !ss->cache->first_time) {
              GPU_matrix_push_projection();
 -            ED_view3d_draw_setup_view(CTX_wm_window(C),
 +            ED_view3d_draw_setup_view(wm,
 +                                      CTX_wm_window(C),
                                        CTX_data_depsgraph_pointer(C),
                                        CTX_data_scene(C),
-                                       ar,
+                                       region,
                                        CTX_wm_view3d(C),
                                        NULL,
                                        NULL,
@@@ -1640,11 -1573,10 +1577,11 @@@
  
            if (brush->sculpt_tool == SCULPT_TOOL_CLOTH && !ss->cache->first_time) {
              GPU_matrix_push_projection();
 -            ED_view3d_draw_setup_view(CTX_wm_window(C),
 +            ED_view3d_draw_setup_view(CTX_wm_manager(C),
 +                                      CTX_wm_window(C),
                                        CTX_data_depsgraph_pointer(C),
                                        CTX_data_scene(C),
-                                       ar,
+                                       region,
                                        CTX_wm_view3d(C),
                                        NULL,
                                        NULL,
diff --cc source/blender/editors/space_view3d/space_view3d.c
index a02f66bec5a,a8514967748..5ec9932fd89
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@@ -108,28 -108,28 +108,28 @@@ bool ED_view3d_context_user_region(bCon
    *r_ar = NULL;
  
    if (sa && sa->spacetype == SPACE_VIEW3D) {
-     ARegion *ar = CTX_wm_region(C);
+     ARegion *region = CTX_wm_region(C);
      View3D *v3d = (View3D *)sa->spacedata.first;
  
-     if (ar) {
+     if (region) {
        RegionView3D *rv3d;
-       if ((ar->regiontype == RGN_TYPE_WINDOW) && (rv3d = ar->regiondata) &&
+       if ((region->regiontype == RGN_TYPE_WINDOW) && (rv3d = region->regiondata) &&
 -          (rv3d->viewlock & RV3D_LOCKED) == 0) {
 +          (rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) {
          *r_v3d = v3d;
-         *r_ar = ar;
+         *r_ar = region;
          return true;
        }
        else {
          ARegion *ar_unlock_user = NULL;
          ARegion *ar_unlock = NULL;
-         for (ar = sa->regionbase.first; ar; ar = ar->next) {
+         for (region = sa->regionbase.first; region; region = region->next) {
            /* find the first unlocked rv3d */
-           if (ar->regiondata && ar->regiontype == RGN_TYPE_WINDOW) {
-             rv3d = ar->regiondata;
+           if (region->regiondata && region->regiontype == RGN_TYPE_WINDOW) {
+             rv3d = region->regiondata;
 -            if ((rv3d->viewlock & RV3D_LOCKED) == 0) {
 +            if ((rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) {
-               ar_unlock = ar;
+               ar_unlock = region;
                if (rv3d->persp == RV3D_PERSP || rv3d->persp == RV3D_CAMOB) {
-                 ar_unlock_user = ar;
+                 ar_unlock_user = region;
                  break;
                }
              }
@@@ -700,15 -700,6 +700,15 @@@ static void view3d_main_region_listener
        if (ELEM(wmn->data, ND_UNDO)) {
          WM_gizmomap_tag_refresh(gzmap);
        }
 +#ifdef WITH_XR_OPENXR
 +      else if (ELEM(wmn->data, ND_XR_DATA_CHANGED)) {
 +        /* Only cau

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list