Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / blender / editors / metaball / editmball.c
similarity index 94%
rename from source/blender/editors/metaball/mball_edit.c
rename to source/blender/editors/metaball/editmball.c
index 9ab985f..b9bb219 100644 (file)
@@ -212,8 +212,8 @@ static int select_deselect_all_metaelems_exec(bContext *C, wmOperator *op)
                        else ml->flag |= SELECT;
                        ml= ml->next;
                }
-               WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
-               //DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
+               //DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        }
 
        return OPERATOR_FINISHED;
@@ -251,7 +251,7 @@ static int select_inverse_metaelems_exec(bContext *C, wmOperator *op)
                                ml->flag |= SELECT;
                        ml= ml->next;
                }
-               WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        }
        
        return OPERATOR_FINISHED;
@@ -296,7 +296,7 @@ static int select_random_metaelems_exec(bContext *C, wmOperator *op)
                ml= ml->next;
        }
        
-       WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
+       WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
        
        return OPERATOR_FINISHED;
 }
@@ -325,6 +325,7 @@ void MBALL_OT_select_random_metaelems(struct wmOperatorType *ot)
 /* Duplicate selected MetaElements */
 static int duplicate_metaelems_exec(bContext *C, wmOperator *op)
 {
+       Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
        MetaBall *mb = (MetaBall*)obedit->data;
        MetaElem *ml, *newml;
@@ -340,8 +341,8 @@ static int duplicate_metaelems_exec(bContext *C, wmOperator *op)
                        }
                        ml= ml->prev;
                }
-               WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
-               DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
+               DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        }
 
        return OPERATOR_FINISHED;
@@ -383,6 +384,7 @@ void MBALL_OT_duplicate_metaelems(wmOperatorType *ot)
 /* Delete all selected MetaElems (not MetaBall) */
 static int delete_metaelems_exec(bContext *C, wmOperator *op)
 {
+       Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
        MetaBall *mb= (MetaBall*)obedit->data;
        MetaElem *ml, *next;
@@ -398,8 +400,8 @@ static int delete_metaelems_exec(bContext *C, wmOperator *op)
                        }
                        ml= next;
                }
-               WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
-               DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
+               DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        }
 
        return OPERATOR_FINISHED;
@@ -424,6 +426,7 @@ void MBALL_OT_delete_metaelems(wmOperatorType *ot)
 /* Hide selected MetaElems */
 static int hide_metaelems_exec(bContext *C, wmOperator *op)
 {
+       Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
        MetaBall *mb= (MetaBall*)obedit->data;
        MetaElem *ml;
@@ -447,8 +450,8 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op)
                                ml= ml->next;
                        }
                }
-               WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
-               DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
+               DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        }
 
        return OPERATOR_FINISHED;
@@ -476,6 +479,7 @@ void MBALL_OT_hide_metaelems(wmOperatorType *ot)
 /* Unhide all edited MetaElems */
 static int reveal_metaelems_exec(bContext *C, wmOperator *op)
 {
+       Scene *scene= CTX_data_scene(C);
        Object *obedit= CTX_data_edit_object(C);
        MetaBall *mb= (MetaBall*)obedit->data;
        MetaElem *ml;
@@ -487,8 +491,8 @@ static int reveal_metaelems_exec(bContext *C, wmOperator *op)
                        ml->flag &= ~MB_HIDE;
                        ml= ml->next;
                }
-               WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb);
-               DAG_id_flush_update(obedit->data, OB_RECALC_DATA);
+               WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_DATA, obedit);
+               DAG_object_flush_update(scene, obedit, OB_RECALC_DATA);
        }
        
        return OPERATOR_FINISHED;
@@ -580,7 +584,7 @@ void mouse_mball(bContext *C, short mval[2], int extend)
                        }
                        mb->lastelem= act;
                        
-                       WM_event_add_notifier(C, NC_GEOM|ND_SELECT, mb);
+                       WM_event_add_notifier(C, NC_OBJECT|ND_GEOM_SELECT, obedit);
                }
        }
 }