2.5 - Recode of Add Constraint Operator(s)
[blender.git] / source / blender / editors / object / editgroup.c
index b86ebef82cdda00f6587a15d48332d0c356cdaf2..9a184892e71d157c79237babc1967e33d102022e 100644 (file)
@@ -95,9 +95,8 @@ static int objects_add_active_exec(bContext *C, wmOperator *op)
        if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
        
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Add To Active Group");
 
-       WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
+       WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 
@@ -108,11 +107,15 @@ void GROUP_OT_objects_add_active(wmOperatorType *ot)
        
        /* identifiers */
        ot->name= "Add Selected To Active Group";
+       ot->description = "Add the object to an object group that contains the active object.";
        ot->idname= "GROUP_OT_objects_add_active";
        
        /* api callbacks */
        ot->exec= objects_add_active_exec;      
        ot->poll= ED_operator_scene_editable;
+
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int objects_remove_active_exec(bContext *C, wmOperator *op)
@@ -147,9 +150,8 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
        if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups");
        
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Remove From Active Group");
 
-       WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
+       WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 
@@ -159,12 +161,16 @@ void GROUP_OT_objects_remove_active(wmOperatorType *ot)
 {
        
        /* identifiers */
-       ot->name= "Remove Selected From active group";
+       ot->name= "Remove Selected From Active Group";
+       ot->description = "Remove the object from an object group that contains the active object.";
        ot->idname= "GROUP_OT_objects_remove_active";
        
        /* api callbacks */
        ot->exec= objects_remove_active_exec;   
        ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int group_remove_exec(bContext *C, wmOperator *op)
@@ -183,24 +189,27 @@ static int group_remove_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Remove From Group");
 
-       WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
+       WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 
 }
 
-void GROUP_OT_group_remove(wmOperatorType *ot)
+void GROUP_OT_objects_remove(wmOperatorType *ot)
 {
        
        /* identifiers */
-       ot->name= "remove Selected from group";
-       ot->idname= "GROUP_OT_group_remove";
+       ot->name= "Remove From Groups";
+       ot->description = "Remove selected objects from all groups.";
+       ot->idname= "GROUP_OT_objects_remove";
        
        /* api callbacks */
        ot->exec= group_remove_exec;    
        ot->poll= ED_operator_scene_editable;
+       
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 }
 
 static int group_create_exec(bContext *C, wmOperator *op)
@@ -221,9 +230,8 @@ static int group_create_exec(bContext *C, wmOperator *op)
        CTX_DATA_END;
 
        DAG_scene_sort(CTX_data_scene(C));
-       ED_undo_push(C,"Create Group");
 
-       WM_event_add_notifier(C, NC_SCENE, CTX_data_scene(C));
+       WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL);
        
        return OPERATOR_FINISHED;
 
@@ -234,12 +242,16 @@ void GROUP_OT_group_create(wmOperatorType *ot)
        
        /* identifiers */
        ot->name= "Create New Group";
+       ot->description = "Create an object group.";
        ot->idname= "GROUP_OT_group_create";
        
        /* api callbacks */
        ot->exec= group_create_exec;    
        ot->poll= ED_operator_scene_editable;
        
+       /* flags */
+       ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+       
        RNA_def_string(ot->srna, "GID", "Group", 32, "Name", "Name of the new group");
 }