[Bf-blender-cvs] [622cad70734] master: Cleanup: minor tweak to recent fix for T10438

Campbell Barton noreply at git.blender.org
Tue Feb 7 06:19:32 CET 2023


Commit: 622cad7073482b100bee9e4cb725fad0b2fe13f3
Author: Campbell Barton
Date:   Tue Feb 7 16:11:02 2023 +1100
Branches: master
https://developer.blender.org/rB622cad7073482b100bee9e4cb725fad0b2fe13f3

Cleanup: minor tweak to recent fix for T10438

Minor change to [0], prefer calling em_setup_viewcontext,
even though there is no functional difference at the moment,
if this function ever performs additional operations than assigning
`ViewContext.em`, it would have to be manually in-lined in
`view3d_circle_select_recalc`.

[0]: 430cc9d7bf6ac7271cf91d9ce0b7e254ceeb8fc

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

M	source/blender/editors/space_view3d/view3d_select.cc

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

diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc
index fe7b5ffcfac..79c7bb496d5 100644
--- a/source/blender/editors/space_view3d/view3d_select.cc
+++ b/source/blender/editors/space_view3d/view3d_select.cc
@@ -4748,14 +4748,13 @@ static bool object_circle_select(ViewContext *vc,
 static void view3d_circle_select_recalc(void *user_data)
 {
   bContext *C = static_cast<bContext *>(user_data);
-  Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
-  ViewContext vc;
-  ED_view3d_viewcontext_init(C, &vc, depsgraph);
+  Object *obedit_active = CTX_data_edit_object(C);
 
-  if (vc.obedit) {
-    switch (vc.obedit->type) {
+  if (obedit_active) {
+    switch (obedit_active->type) {
       case OB_MESH: {
-        vc.em = BKE_editmesh_from_object(vc.obedit);
+        ViewContext vc;
+        em_setup_viewcontext(C, &vc);
         FOREACH_OBJECT_IN_MODE_BEGIN (
             vc.scene, vc.view_layer, vc.v3d, vc.obact->type, vc.obact->mode, ob_iter) {
           ED_view3d_viewcontext_init_object(&vc, ob_iter);
@@ -4766,8 +4765,11 @@ static void view3d_circle_select_recalc(void *user_data)
         break;
       }
 
-      default:
+      default: {
+        /* TODO: investigate if this is needed for other object types. */
+        CTX_data_ensure_evaluated_depsgraph(C);
         break;
+      }
     }
   }
 }



More information about the Bf-blender-cvs mailing list