EditMesh: pass object data to notifiers
authorCampbell Barton <ideasman42@gmail.com>
Wed, 7 Mar 2018 14:47:35 +0000 (01:47 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 7 Mar 2018 14:49:30 +0000 (01:49 +1100)
Both were being passed in different parts of the code,
use object data for consistency.

source/blender/editors/mesh/editmesh_select.c

index 1c620ad46810bbc0cb2d3109a8283e6f53c9175a..1e2c93389ed21b4778190e133830bb53ac6daf10 100644 (file)
@@ -1289,7 +1289,7 @@ static int edbm_select_similar_region_exec(bContext *C, wmOperator *op)
        MEM_freeN(group_index);
 
        if (changed) {
        MEM_freeN(group_index);
 
        if (changed) {
-               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
        }
        else {
                BKE_report(op->reports, RPT_WARNING, "No matching face regions found");
        }
        else {
                BKE_report(op->reports, RPT_WARNING, "No matching face regions found");
@@ -1482,7 +1482,7 @@ static int edbm_loop_multiselect_exec(bContext *C, wmOperator *op)
        MEM_freeN(edarray);
 //     if (EM_texFaceCheck())
        
        MEM_freeN(edarray);
 //     if (EM_texFaceCheck())
        
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
@@ -1689,7 +1689,7 @@ static bool mouse_mesh_loop(bContext *C, const int mval[2], bool extend, bool de
                }
        }
 
                }
        }
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
 
        return true;
 }
 
        return true;
 }
@@ -1776,7 +1776,7 @@ static int edbm_select_all_exec(bContext *C, wmOperator *op)
                        break;
        }
 
                        break;
        }
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
@@ -1804,7 +1804,7 @@ static int edbm_faces_select_interior_exec(bContext *C, wmOperator *UNUSED(op))
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
 
        if (EDBM_select_interior_faces(em)) {
        BMEditMesh *em = BKE_editmesh_from_object(obedit);
 
        if (EDBM_select_interior_faces(em)) {
-               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
                return OPERATOR_FINISHED;
        }
 
                return OPERATOR_FINISHED;
        }
@@ -1941,7 +1941,7 @@ bool EDBM_select_pick(bContext *C, const int mval[2], bool extend, bool deselect
 
                }
 
 
                }
 
-               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit);
+               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, vc.obedit->data);
                return true;
        }
 
                return true;
        }
 
@@ -2653,7 +2653,7 @@ static int edbm_select_linked_exec(bContext *C, wmOperator *op)
                select_linked_delimit_end(em);
        }
 
                select_linked_delimit_end(em);
        }
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
@@ -2821,7 +2821,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
 
        /* return warning! */
        if (unified_findnearest(&vc, &eve, &eed, &efa) == 0) {
 
        /* return warning! */
        if (unified_findnearest(&vc, &eve, &eed, &efa) == 0) {
-               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+               WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
                return OPERATOR_CANCELLED;
        }
 
                return OPERATOR_CANCELLED;
        }
@@ -2842,7 +2842,7 @@ static int edbm_select_linked_pick_invoke(bContext *C, wmOperator *op, const wmE
 
        RNA_int_set(op->ptr, "index", index);
 
 
        RNA_int_set(op->ptr, "index", index);
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
@@ -2871,7 +2871,7 @@ static int edbm_select_linked_pick_exec(bContext *C, wmOperator *op)
 
        edbm_select_linked_pick_ex(em, ele, sel, delimit);
 
 
        edbm_select_linked_pick_ex(em, ele, sel, delimit);
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
 
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
@@ -3109,7 +3109,7 @@ static int edbm_select_more_exec(bContext *C, wmOperator *op)
 
        EDBM_select_more(em, use_face_step);
 
 
        EDBM_select_more(em, use_face_step);
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }
 
@@ -3138,7 +3138,7 @@ static int edbm_select_less_exec(bContext *C, wmOperator *op)
 
        EDBM_select_less(em, use_face_step);
 
 
        EDBM_select_less(em, use_face_step);
 
-       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit);
+       WM_event_add_notifier(C, NC_GEOM | ND_SELECT, obedit->data);
        return OPERATOR_FINISHED;
 }
 
        return OPERATOR_FINISHED;
 }