diff options
-rw-r--r-- | source/blender/editors/object/editgroup.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/object/editgroup.c b/source/blender/editors/object/editgroup.c index 4117e74ab72..b86ebef82cd 100644 --- a/source/blender/editors/object/editgroup.c +++ b/source/blender/editors/object/editgroup.c @@ -44,6 +44,7 @@ #include "BKE_global.h" #include "BKE_context.h" #include "BKE_main.h" +#include "BKE_report.h" #include "ED_view3d.h" #include "ED_space_api.h" @@ -67,6 +68,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *ob= OBACT, *obt; Group *group; + int ok = 0; if (!ob) return OPERATOR_CANCELLED; @@ -83,12 +85,15 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) obt->flag |= OB_FROMGROUP; base->flag |= OB_FROMGROUP; base->object->recalc= OB_RECALC_OB; + ok = 1; } CTX_DATA_END; } group= group->id.next; } - + + 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"); @@ -115,6 +120,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *ob= OBACT, *obt; Group *group; + int ok = 0; if (!ob) return OPERATOR_CANCELLED; @@ -131,12 +137,15 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) obt->flag &= ~OB_FROMGROUP; base->flag &= ~OB_FROMGROUP; base->object->recalc= OB_RECALC_OB; + ok = 1; } CTX_DATA_END; } group= group->id.next; } - + + 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"); |