Commit: 9d0c6d2fd27445bc20c138d75873f4f4171ce232
Author: Jeroen Bakker
Date:   Tue Aug 25 13:00:10 2020 +0200
Branches: uvimage-editor-drawing
https://developer.blender.org/rB9d0c6d2fd27445bc20c138d75873f4f4171ce232

Don't draw shadows of all objects

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

M       source/blender/draw/engines/overlay/overlay_edit_uv.c

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

diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.c 
b/source/blender/draw/engines/overlay/overlay_edit_uv.c
index f39791aee82..b77f70fe77a 100644
--- a/source/blender/draw/engines/overlay/overlay_edit_uv.c
+++ b/source/blender/draw/engines/overlay/overlay_edit_uv.c
@@ -282,6 +282,9 @@ void OVERLAY_edit_uv_cache_populate(OVERLAY_Data *vedata, 
Object *ob)
   GPUBatch *geom;
   const bool is_edit_object = DRW_object_is_in_edit_mode(ob);
 
+  const DRWContextState *draw_ctx = DRW_context_state_get();
+  const bool draw_shadows = (draw_ctx->object_mode != OB_MODE_OBJECT) &&
+                            (ob->mode == draw_ctx->object_mode);
   if (is_edit_object) {
     if (pd->edit_uv.do_uv_overlay) {
       geom = DRW_mesh_batch_cache_get_edituv_edges(ob->data);
@@ -326,10 +329,12 @@ void OVERLAY_edit_uv_cache_populate(OVERLAY_Data *vedata, 
Object *ob)
     }
   }
 
-  if (pd->edit_uv.do_uv_shadow_overlay) {
-    geom = DRW_mesh_batch_cache_get_uv_edges(ob->data);
-    if (geom) {
-      DRW_shgroup_call_obmat(pd->edit_uv_shadow_edges_grp, geom, NULL);
+  if (draw_shadows) {
+    if (pd->edit_uv.do_uv_shadow_overlay) {
+      geom = DRW_mesh_batch_cache_get_uv_edges(ob->data);
+      if (geom) {
+        DRW_shgroup_call_obmat(pd->edit_uv_shadow_edges_grp, geom, NULL);
+      }
     }
   }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to