diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-04-24 20:35:20 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-04-24 20:35:20 +0400 |
commit | 166b3523f02c869b5855b3df69a97d7265e39974 (patch) | |
tree | 0dc24e395f16f43e1ea97694e0dd7adf0df9c93d /source/blender | |
parent | 791933b9a758537ce3f5baa68aa1399f8bcb76ab (diff) |
Prevent adding objects to be added to a group which is used as dupli-group for this object
when using "Add Selected to Active Group" operator,
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_group.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index 34410b87e79..3867b1e34cb 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -65,7 +65,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) Scene *scene= CTX_data_scene(C); Object *ob= OBACT; Group *group; - int ok = 0; + int ok = 0, cycle = 0; if (!ob) return OPERATOR_CANCELLED; @@ -76,7 +76,10 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) if (object_in_group(ob, group)) { /* Assign groups to selected objects */ CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { - add_to_group(group, base->object, scene, base); + if (base->object->dup_group != group) + add_to_group(group, base->object, scene, base); + else + cycle = 1; ok = 1; } CTX_DATA_END; @@ -84,6 +87,8 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) } if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups"); + if (cycle) + BKE_report(op->reports, RPT_WARNING, "Skipped some groups because of cycle detected"); DAG_scene_sort(bmain, scene); WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL); |