[Bf-blender-cvs] [e0eafd27579] xr-actions-D9124: XR: Add selection outline offscreen draw flag

Peter Kim noreply at git.blender.org
Tue Oct 13 14:45:02 CEST 2020


Commit: e0eafd2757904db57e8dad982624bc76e67e45f9
Author: Peter Kim
Date:   Tue Oct 13 18:35:44 2020 +0900
Branches: xr-actions-D9124
https://developer.blender.org/rBe0eafd2757904db57e8dad982624bc76e67e45f9

XR: Add selection outline offscreen draw flag

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

M	source/blender/editors/space_view3d/view3d_draw.c
M	source/blender/makesdna/DNA_view3d_enums.h
M	source/blender/makesrna/intern/rna_xr.c

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

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index d7b0e3ea3bd..bc587e5a4b4 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1788,23 +1788,26 @@ void ED_view3d_draw_offscreen_simple(Depsgraph *depsgraph,
     v3d.shading.flag = V3D_SHADING_SCENE_WORLD | V3D_SHADING_SCENE_LIGHTS;
   }
 
-  if ((draw_flags & (V3D_OFSDRAW_SHOW_ANNOTATION | V3D_OFSDRAW_XR_SHOW_CONTROLLERS |
-                     V3D_OFSDRAW_SHOW_GRIDFLOOR)) == 0) {
+  if ((draw_flags & (V3D_OFSDRAW_SHOW_ANNOTATION | V3D_OFSDRAW_SHOW_GRIDFLOOR |
+                     V3D_OFSDRAW_SHOW_SELECTION | V3D_OFSDRAW_XR_SHOW_CONTROLLERS)) == 0) {
     v3d.flag2 = V3D_HIDE_OVERLAYS;
   }
   else {
     if (draw_flags & V3D_OFSDRAW_SHOW_ANNOTATION) {
       v3d.flag2 |= V3D_SHOW_ANNOTATION;
     }
-    if (draw_flags & V3D_OFSDRAW_XR_SHOW_CONTROLLERS) {
-      v3d.flag2 |= V3D_XR_SHOW_CONTROLLERS;
-    }
     if (draw_flags & V3D_OFSDRAW_SHOW_GRIDFLOOR) {
       v3d.gridflag |= V3D_SHOW_FLOOR | V3D_SHOW_X | V3D_SHOW_Y;
       v3d.grid = 1.0f;
       v3d.gridlines = 16;
       v3d.gridsubdiv = 10;
     }
+    if (draw_flags & V3D_OFSDRAW_SHOW_SELECTION) {
+      v3d.flag |= V3D_SELECT_OUTLINE;
+    }
+    if (draw_flags & V3D_OFSDRAW_XR_SHOW_CONTROLLERS) {
+      v3d.flag2 |= V3D_XR_SHOW_CONTROLLERS;
+    }
     /* Disable other overlays (set all available _HIDE_ flags). */
     v3d.overlay.flag |= V3D_OVERLAY_HIDE_CURSOR | V3D_OVERLAY_HIDE_TEXT |
                         V3D_OVERLAY_HIDE_MOTION_PATHS | V3D_OVERLAY_HIDE_BONES |
diff --git a/source/blender/makesdna/DNA_view3d_enums.h b/source/blender/makesdna/DNA_view3d_enums.h
index 5a066f05754..7f79be1df8e 100644
--- a/source/blender/makesdna/DNA_view3d_enums.h
+++ b/source/blender/makesdna/DNA_view3d_enums.h
@@ -26,7 +26,8 @@ typedef enum eV3DOffscreenDrawFlag {
   V3D_OFSDRAW_SHOW_ANNOTATION = (1 << 0),
   V3D_OFSDRAW_OVERRIDE_SCENE_SETTINGS = (1 << 1),
   V3D_OFSDRAW_SHOW_GRIDFLOOR = (1 << 2),
-  V3D_OFSDRAW_XR_SHOW_CONTROLLERS = (1 << 3),
+  V3D_OFSDRAW_SHOW_SELECTION = (1 << 3),
+  V3D_OFSDRAW_XR_SHOW_CONTROLLERS = (1 << 4),
 } eV3DOffscreenDrawFlag;
 
 /** #View3DShading.light */
diff --git a/source/blender/makesrna/intern/rna_xr.c b/source/blender/makesrna/intern/rna_xr.c
index 91024fa0087..6bff5104e7a 100644
--- a/source/blender/makesrna/intern/rna_xr.c
+++ b/source/blender/makesrna/intern/rna_xr.c
@@ -510,6 +510,11 @@ static void rna_def_xr_session_settings(BlenderRNA *brna)
   RNA_def_property_ui_text(prop, "Show Annotation", "Show annotations for this view");
   RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
 
+  prop = RNA_def_property(srna, "show_selection", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_sdna(prop, NULL, "draw_flags", V3D_OFSDRAW_SHOW_SELECTION);
+  RNA_def_property_ui_text(prop, "Show Selection", "Show selection outlines");
+  RNA_def_property_update(prop, NC_WM | ND_XR_DATA_CHANGED, NULL);
+
   prop = RNA_def_property(srna, "show_controllers", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "draw_flags", V3D_OFSDRAW_XR_SHOW_CONTROLLERS);
   RNA_def_property_ui_text(



More information about the Bf-blender-cvs mailing list