From 42f7767dab56ce6cf26e490c3cb2c689b2b0d507 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 29 Aug 2018 15:32:50 +0200 Subject: Cleanup: rename files from group to collection to match contents. --- source/blender/editors/gpencil/gpencil_convert.c | 2 +- source/blender/editors/object/CMakeLists.txt | 2 +- source/blender/editors/object/object_add.c | 2 +- source/blender/editors/object/object_collection.c | 600 +++++++++++++++++++++ source/blender/editors/object/object_edit.c | 2 +- source/blender/editors/object/object_group.c | 600 --------------------- source/blender/editors/object/object_relations.c | 2 +- source/blender/editors/object/object_select.c | 2 +- source/blender/editors/object/object_transform.c | 2 +- source/blender/editors/render/render_preview.c | 2 +- source/blender/editors/space_action/space_action.c | 2 +- .../editors/space_buttons/buttons_context.c | 2 +- source/blender/editors/space_graph/space_graph.c | 2 +- source/blender/editors/space_info/info_stats.c | 2 +- source/blender/editors/space_nla/space_nla.c | 2 +- .../editors/space_outliner/outliner_collections.c | 2 +- .../editors/space_outliner/outliner_dragdrop.c | 2 +- .../blender/editors/space_outliner/outliner_draw.c | 2 +- .../blender/editors/space_outliner/outliner_edit.c | 2 +- .../blender/editors/space_outliner/outliner_ops.c | 2 +- .../editors/space_outliner/outliner_select.c | 2 +- .../editors/space_outliner/outliner_tools.c | 2 +- .../blender/editors/space_outliner/outliner_tree.c | 2 +- .../editors/space_view3d/view3d_draw_legacy.c | 2 +- source/blender/editors/space_view3d/view3d_ops.c | 2 +- 25 files changed, 623 insertions(+), 623 deletions(-) create mode 100644 source/blender/editors/object/object_collection.c delete mode 100644 source/blender/editors/object/object_group.c (limited to 'source/blender/editors') diff --git a/source/blender/editors/gpencil/gpencil_convert.c b/source/blender/editors/gpencil/gpencil_convert.c index f662e9b42be..afce0fb7a43 100644 --- a/source/blender/editors/gpencil/gpencil_convert.c +++ b/source/blender/editors/gpencil/gpencil_convert.c @@ -47,8 +47,8 @@ #include "BLT_translation.h" #include "DNA_anim_types.h" +#include "DNA_collection_types.h" #include "DNA_curve_types.h" -#include "DNA_group_types.h" #include "DNA_object_types.h" #include "DNA_node_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index 739975a6278..17359934c6e 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -48,10 +48,10 @@ set(SRC object_add.c object_bake.c object_bake_api.c + object_collection.c object_constraint.c object_edit.c object_facemap_ops.c - object_group.c object_hook.c object_modes.c object_modifier.c diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 7e9390e893a..80ce7f26905 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -35,8 +35,8 @@ #include "DNA_anim_types.h" #include "DNA_camera_types.h" +#include "DNA_collection_types.h" #include "DNA_curve_types.h" -#include "DNA_group_types.h" #include "DNA_lamp_types.h" #include "DNA_key_types.h" #include "DNA_material_types.h" diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c new file mode 100644 index 00000000000..8386b1fc520 --- /dev/null +++ b/source/blender/editors/object/object_collection.c @@ -0,0 +1,600 @@ +/* + * ***** BEGIN GPL LICENSE BLOCK ***** + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * The Original Code is Copyright (C) Blender Foundation + * All rights reserved. + * + * The Original Code is: all of this file. + * + * Contributor(s): none yet. + * + * ***** END GPL LICENSE BLOCK ***** + */ + +/** \file blender/editors/object/object_collection.c + * \ingroup edobj + */ + + +#include + +#include "BLI_blenlib.h" +#include "BLI_utildefines.h" + +#include "DNA_collection_types.h" +#include "DNA_object_types.h" +#include "DNA_scene_types.h" + +#include "BKE_collection.h" +#include "BKE_context.h" +#include "BKE_library.h" +#include "BKE_library_remap.h" +#include "BKE_main.h" +#include "BKE_report.h" +#include "BKE_object.h" + +#include "DEG_depsgraph.h" +#include "DEG_depsgraph_build.h" + +#include "ED_screen.h" +#include "ED_object.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" +#include "RNA_enum_types.h" + +#include "object_intern.h" + +/********************* 3d view operators ***********************/ + +/* can be called with C == NULL */ +static const EnumPropertyItem *collection_object_active_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) +{ + Main *bmain = CTX_data_main(C); + Object *ob; + EnumPropertyItem *item = NULL, item_tmp = {0}; + int totitem = 0; + + if (C == NULL) { + return DummyRNA_NULL_items; + } + + ob = ED_object_context(C); + + /* check that the object exists */ + if (ob) { + Collection *collection; + int i = 0, count = 0; + + /* if 2 or more collections, add option to add to all collections */ + collection = NULL; + while ((collection = BKE_collection_object_find(bmain, collection, ob))) + count++; + + if (count >= 2) { + item_tmp.identifier = item_tmp.name = "All Collections"; + item_tmp.value = INT_MAX; /* this will give NULL on lookup */ + RNA_enum_item_add(&item, &totitem, &item_tmp); + RNA_enum_item_add_separator(&item, &totitem); + } + + /* add collections */ + collection = NULL; + while ((collection = BKE_collection_object_find(bmain, collection, ob))) { + item_tmp.identifier = item_tmp.name = collection->id.name + 2; + /* item_tmp.icon = ICON_ARMATURE_DATA; */ + item_tmp.value = i; + RNA_enum_item_add(&item, &totitem, &item_tmp); + i++; + } + } + + RNA_enum_item_end(&item, &totitem); + *r_free = true; + + return item; +} + +/* get the collection back from the enum index, quite awkward and UI specific */ +static Collection *collection_object_active_find_index(Main *bmain, Object *ob, const int collection_object_index) +{ + Collection *collection = NULL; + int i = 0; + while ((collection = BKE_collection_object_find(bmain, collection, ob))) { + if (i == collection_object_index) { + break; + } + i++; + } + + return collection; +} + +static int objects_add_active_exec(bContext *C, wmOperator *op) +{ + Object *ob = ED_object_context(C); + Main *bmain = CTX_data_main(C); + int single_collection_index = RNA_enum_get(op->ptr, "collection"); + Collection *single_collection = collection_object_active_find_index(bmain, ob, single_collection_index); + Collection *collection; + bool is_cycle = false; + bool updated = false; + + if (ob == NULL) + return OPERATOR_CANCELLED; + + /* now add all selected objects to the collection(s) */ + for (collection = bmain->collection.first; collection; collection = collection->id.next) { + if (single_collection && collection != single_collection) + continue; + if (!BKE_collection_has_object(collection, ob)) + continue; + + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { + if (BKE_collection_has_object(collection, base->object)) + continue; + + if (!BKE_collection_object_cyclic_check(bmain, base->object, collection)) { + BKE_collection_object_add(bmain, collection, base->object); + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + updated = true; + } + else { + is_cycle = true; + } + } + CTX_DATA_END; + } + + if (is_cycle) + BKE_report(op->reports, RPT_WARNING, "Skipped some collections because of cycle detected"); + + if (!updated) + return OPERATOR_CANCELLED; + + DEG_relations_tag_update(bmain); + WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); + + return OPERATOR_FINISHED; +} + +void COLLECTION_OT_objects_add_active(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name = "Add Selected To Active Collection"; + ot->description = "Add the object to an object collection that contains the active object"; + ot->idname = "COLLECTION_OT_objects_add_active"; + + /* api callbacks */ + ot->exec = objects_add_active_exec; + ot->invoke = WM_menu_invoke; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* properties */ + prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", "The collection to add other selected objects to"); + RNA_def_enum_funcs(prop, collection_object_active_itemf); + RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); + ot->prop = prop; +} + +static int objects_remove_active_exec(bContext *C, wmOperator *op) +{ + Main *bmain = CTX_data_main(C); + ViewLayer *view_layer = CTX_data_view_layer(C); + Object *ob = OBACT(view_layer); + int single_collection_index = RNA_enum_get(op->ptr, "collection"); + Collection *single_collection = collection_object_active_find_index(bmain, ob, single_collection_index); + Collection *collection; + bool ok = false; + + if (ob == NULL) + return OPERATOR_CANCELLED; + + /* linking to same collection requires its own loop so we can avoid + * looking up the active objects collections each time */ + + for (collection = bmain->collection.first; collection; collection = collection->id.next) { + if (single_collection && collection != single_collection) + continue; + + if (BKE_collection_has_object(collection, ob)) { + /* Remove collections from selected objects */ + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { + BKE_collection_object_remove(bmain, collection, base->object, false); + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + ok = 1; + } + CTX_DATA_END; + } + } + + if (!ok) + BKE_report(op->reports, RPT_ERROR, "Active object contains no collections"); + + DEG_relations_tag_update(bmain); + WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); + + return OPERATOR_FINISHED; +} + +void COLLECTION_OT_objects_remove_active(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name = "Remove Selected From Active Collection"; + ot->description = "Remove the object from an object collection that contains the active object"; + ot->idname = "COLLECTION_OT_objects_remove_active"; + + /* api callbacks */ + ot->exec = objects_remove_active_exec; + ot->invoke = WM_menu_invoke; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* properties */ + prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", "The collection to remove other selected objects from"); + RNA_def_enum_funcs(prop, collection_object_active_itemf); + RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); + ot->prop = prop; +} + +static int collection_objects_remove_all_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Main *bmain = CTX_data_main(C); + + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { + BKE_object_groups_clear(bmain, base->object); + } + CTX_DATA_END; + + DEG_relations_tag_update(bmain); + WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); + + return OPERATOR_FINISHED; +} + +void COLLECTION_OT_objects_remove_all(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Remove From All Unlinked Collections"; + ot->description = "Remove selected objects from all collections not used in a scene"; + ot->idname = "COLLECTION_OT_objects_remove_all"; + + /* api callbacks */ + ot->exec = collection_objects_remove_all_exec; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + +static int collection_objects_remove_exec(bContext *C, wmOperator *op) +{ + Object *ob = ED_object_context(C); + Main *bmain = CTX_data_main(C); + int single_collection_index = RNA_enum_get(op->ptr, "collection"); + Collection *single_collection = collection_object_active_find_index(bmain, ob, single_collection_index); + Collection *collection; + bool updated = false; + + if (ob == NULL) + return OPERATOR_CANCELLED; + + for (collection = bmain->collection.first; collection; collection = collection->id.next) { + if (single_collection && collection != single_collection) + continue; + if (!BKE_collection_has_object(collection, ob)) + continue; + + /* now remove all selected objects from the collection */ + CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) + { + BKE_collection_object_remove(bmain, collection, base->object, false); + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + updated = true; + } + CTX_DATA_END; + } + + if (!updated) + return OPERATOR_CANCELLED; + + DEG_relations_tag_update(bmain); + WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); + + return OPERATOR_FINISHED; +} + +void COLLECTION_OT_objects_remove(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name = "Remove From Collection"; + ot->description = "Remove selected objects from a collection"; + ot->idname = "COLLECTION_OT_objects_remove"; + + /* api callbacks */ + ot->exec = collection_objects_remove_exec; + ot->invoke = WM_menu_invoke; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* properties */ + prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", "The collection to remove this object from"); + RNA_def_enum_funcs(prop, collection_object_active_itemf); + RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); + ot->prop = prop; +} + +static int collection_create_exec(bContext *C, wmOperator *op) +{ + Main *bmain = CTX_data_main(C); + char name[MAX_ID_NAME - 2]; /* id name */ + + RNA_string_get(op->ptr, "name", name); + + Collection *collection = BKE_collection_add(bmain, NULL, name); + id_fake_user_set(&collection->id); + + CTX_DATA_BEGIN (C, Base *, base, selected_bases) + { + BKE_collection_object_add(bmain, collection, base->object); + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + } + CTX_DATA_END; + + DEG_relations_tag_update(bmain); + WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); + + return OPERATOR_FINISHED; +} + +void COLLECTION_OT_create(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Create New Collection"; + ot->description = "Create an object collection from selected objects"; + ot->idname = "COLLECTION_OT_create"; + + /* api callbacks */ + ot->exec = collection_create_exec; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + RNA_def_string(ot->srna, "name", "Collection", MAX_ID_NAME - 2, "Name", "Name of the new collection"); +} + +/****************** properties window operators *********************/ + +static int collection_add_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *ob = ED_object_context(C); + Main *bmain = CTX_data_main(C); + + if (ob == NULL) + return OPERATOR_CANCELLED; + + Collection *collection = BKE_collection_add(bmain, NULL, "Collection"); + id_fake_user_set(&collection->id); + BKE_collection_object_add(bmain, collection, ob); + + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + DEG_relations_tag_update(bmain); + + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_collection_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Add to Collection"; + ot->idname = "OBJECT_OT_collection_add"; + ot->description = "Add an object to a new collection"; + + /* api callbacks */ + ot->exec = collection_add_exec; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + +static int collection_link_exec(bContext *C, wmOperator *op) +{ + Main *bmain = CTX_data_main(C); + Object *ob = ED_object_context(C); + Collection *collection = BLI_findlink(&bmain->collection, RNA_enum_get(op->ptr, "collection")); + + if (ELEM(NULL, ob, collection)) + return OPERATOR_CANCELLED; + + /* Early return check, if the object is already in collection + * we could skip all the dependency check and just consider + * operator is finished. + */ + if (BKE_collection_has_object(collection, ob)) { + return OPERATOR_FINISHED; + } + + /* Adding object to collection which is used as duplicollection for self is bad idea. + * + * It is also bad idea to add object to collection which is in collection which + * contains our current object. + */ + if (BKE_collection_object_cyclic_check(bmain, ob, collection)) { + BKE_report(op->reports, RPT_ERROR, "Could not add the collection because of dependency cycle detected"); + return OPERATOR_CANCELLED; + } + + BKE_collection_object_add(bmain, collection, ob); + + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + DEG_relations_tag_update(bmain); + + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_collection_link(wmOperatorType *ot) +{ + PropertyRNA *prop; + + /* identifiers */ + ot->name = "Link to Collection"; + ot->idname = "OBJECT_OT_collection_link"; + ot->description = "Add an object to an existing collection"; + + /* api callbacks */ + ot->exec = collection_link_exec; + ot->invoke = WM_enum_search_invoke; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; + + /* properties */ + prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", ""); + RNA_def_enum_funcs(prop, RNA_collection_local_itemf); + RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); + ot->prop = prop; +} + +static int collection_remove_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Main *bmain = CTX_data_main(C); + Object *ob = ED_object_context(C); + Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; + + if (!ob || !collection) + return OPERATOR_CANCELLED; + + BKE_collection_object_remove(bmain, collection, ob, false); + + DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); + DEG_relations_tag_update(bmain); + + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_collection_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Remove Collection"; + ot->idname = "OBJECT_OT_collection_remove"; + ot->description = "Remove the active object from this collection"; + + /* api callbacks */ + ot->exec = collection_remove_exec; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + + +static int collection_unlink_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Main *bmain = CTX_data_main(C); + Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; + + if (!collection) + return OPERATOR_CANCELLED; + + BKE_libblock_delete(bmain, collection); + + DEG_relations_tag_update(bmain); + + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_collection_unlink(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Unlink Collection"; + ot->idname = "OBJECT_OT_collection_unlink"; + ot->description = "Unlink the collection from all objects"; + + /* api callbacks */ + ot->exec = collection_unlink_exec; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} + +static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */ +{ + Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; + + if (!collection) + return OPERATOR_CANCELLED; + + CTX_DATA_BEGIN (C, Base *, base, visible_bases) + { + if (((base->flag & BASE_SELECTED) == 0) && ((base->flag & BASE_SELECTABLE) != 0)) { + if (BKE_collection_has_object_recursive(collection, base->object)) { + ED_object_base_select(base, BA_SELECT); + } + } + } + CTX_DATA_END; + + WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); + + return OPERATOR_FINISHED; +} + +void OBJECT_OT_collection_objects_select(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Select Objects in Collection"; + ot->idname = "OBJECT_OT_collection_objects_select"; + ot->description = "Select all objects in collection"; + + /* api callbacks */ + ot->exec = select_grouped_exec; + ot->poll = ED_operator_objectmode; + + /* flags */ + ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; +} diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 5d0d715ea15..58ecd7fb472 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -46,9 +46,9 @@ #include "BLT_translation.h" #include "DNA_armature_types.h" +#include "DNA_collection_types.h" #include "DNA_curve_types.h" #include "DNA_gpencil_types.h" -#include "DNA_group_types.h" #include "DNA_material_types.h" #include "DNA_meta_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c deleted file mode 100644 index 72c5fde2955..00000000000 --- a/source/blender/editors/object/object_group.c +++ /dev/null @@ -1,600 +0,0 @@ -/* - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * The Original Code is Copyright (C) Blender Foundation - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/** \file blender/editors/object/object_group.c - * \ingroup edobj - */ - - -#include - -#include "BLI_blenlib.h" -#include "BLI_utildefines.h" - -#include "DNA_group_types.h" -#include "DNA_object_types.h" -#include "DNA_scene_types.h" - -#include "BKE_collection.h" -#include "BKE_context.h" -#include "BKE_library.h" -#include "BKE_library_remap.h" -#include "BKE_main.h" -#include "BKE_report.h" -#include "BKE_object.h" - -#include "DEG_depsgraph.h" -#include "DEG_depsgraph_build.h" - -#include "ED_screen.h" -#include "ED_object.h" - -#include "WM_api.h" -#include "WM_types.h" - -#include "RNA_access.h" -#include "RNA_define.h" -#include "RNA_enum_types.h" - -#include "object_intern.h" - -/********************* 3d view operators ***********************/ - -/* can be called with C == NULL */ -static const EnumPropertyItem *collection_object_active_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), bool *r_free) -{ - Main *bmain = CTX_data_main(C); - Object *ob; - EnumPropertyItem *item = NULL, item_tmp = {0}; - int totitem = 0; - - if (C == NULL) { - return DummyRNA_NULL_items; - } - - ob = ED_object_context(C); - - /* check that the object exists */ - if (ob) { - Collection *collection; - int i = 0, count = 0; - - /* if 2 or more collections, add option to add to all collections */ - collection = NULL; - while ((collection = BKE_collection_object_find(bmain, collection, ob))) - count++; - - if (count >= 2) { - item_tmp.identifier = item_tmp.name = "All Collections"; - item_tmp.value = INT_MAX; /* this will give NULL on lookup */ - RNA_enum_item_add(&item, &totitem, &item_tmp); - RNA_enum_item_add_separator(&item, &totitem); - } - - /* add collections */ - collection = NULL; - while ((collection = BKE_collection_object_find(bmain, collection, ob))) { - item_tmp.identifier = item_tmp.name = collection->id.name + 2; - /* item_tmp.icon = ICON_ARMATURE_DATA; */ - item_tmp.value = i; - RNA_enum_item_add(&item, &totitem, &item_tmp); - i++; - } - } - - RNA_enum_item_end(&item, &totitem); - *r_free = true; - - return item; -} - -/* get the collection back from the enum index, quite awkward and UI specific */ -static Collection *collection_object_active_find_index(Main *bmain, Object *ob, const int collection_object_index) -{ - Collection *collection = NULL; - int i = 0; - while ((collection = BKE_collection_object_find(bmain, collection, ob))) { - if (i == collection_object_index) { - break; - } - i++; - } - - return collection; -} - -static int objects_add_active_exec(bContext *C, wmOperator *op) -{ - Object *ob = ED_object_context(C); - Main *bmain = CTX_data_main(C); - int single_collection_index = RNA_enum_get(op->ptr, "collection"); - Collection *single_collection = collection_object_active_find_index(bmain, ob, single_collection_index); - Collection *collection; - bool is_cycle = false; - bool updated = false; - - if (ob == NULL) - return OPERATOR_CANCELLED; - - /* now add all selected objects to the collection(s) */ - for (collection = bmain->collection.first; collection; collection = collection->id.next) { - if (single_collection && collection != single_collection) - continue; - if (!BKE_collection_has_object(collection, ob)) - continue; - - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) - { - if (BKE_collection_has_object(collection, base->object)) - continue; - - if (!BKE_collection_object_cyclic_check(bmain, base->object, collection)) { - BKE_collection_object_add(bmain, collection, base->object); - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - updated = true; - } - else { - is_cycle = true; - } - } - CTX_DATA_END; - } - - if (is_cycle) - BKE_report(op->reports, RPT_WARNING, "Skipped some collections because of cycle detected"); - - if (!updated) - return OPERATOR_CANCELLED; - - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); - - return OPERATOR_FINISHED; -} - -void COLLECTION_OT_objects_add_active(wmOperatorType *ot) -{ - PropertyRNA *prop; - - /* identifiers */ - ot->name = "Add Selected To Active Collection"; - ot->description = "Add the object to an object collection that contains the active object"; - ot->idname = "COLLECTION_OT_objects_add_active"; - - /* api callbacks */ - ot->exec = objects_add_active_exec; - ot->invoke = WM_menu_invoke; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - /* properties */ - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", "The collection to add other selected objects to"); - RNA_def_enum_funcs(prop, collection_object_active_itemf); - RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); - ot->prop = prop; -} - -static int objects_remove_active_exec(bContext *C, wmOperator *op) -{ - Main *bmain = CTX_data_main(C); - ViewLayer *view_layer = CTX_data_view_layer(C); - Object *ob = OBACT(view_layer); - int single_collection_index = RNA_enum_get(op->ptr, "collection"); - Collection *single_collection = collection_object_active_find_index(bmain, ob, single_collection_index); - Collection *collection; - bool ok = false; - - if (ob == NULL) - return OPERATOR_CANCELLED; - - /* linking to same collection requires its own loop so we can avoid - * looking up the active objects collections each time */ - - for (collection = bmain->collection.first; collection; collection = collection->id.next) { - if (single_collection && collection != single_collection) - continue; - - if (BKE_collection_has_object(collection, ob)) { - /* Remove collections from selected objects */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) - { - BKE_collection_object_remove(bmain, collection, base->object, false); - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - ok = 1; - } - CTX_DATA_END; - } - } - - if (!ok) - BKE_report(op->reports, RPT_ERROR, "Active object contains no collections"); - - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); - - return OPERATOR_FINISHED; -} - -void COLLECTION_OT_objects_remove_active(wmOperatorType *ot) -{ - PropertyRNA *prop; - - /* identifiers */ - ot->name = "Remove Selected From Active Collection"; - ot->description = "Remove the object from an object collection that contains the active object"; - ot->idname = "COLLECTION_OT_objects_remove_active"; - - /* api callbacks */ - ot->exec = objects_remove_active_exec; - ot->invoke = WM_menu_invoke; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - /* properties */ - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", "The collection to remove other selected objects from"); - RNA_def_enum_funcs(prop, collection_object_active_itemf); - RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); - ot->prop = prop; -} - -static int collection_objects_remove_all_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Main *bmain = CTX_data_main(C); - - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) - { - BKE_object_groups_clear(bmain, base->object); - } - CTX_DATA_END; - - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); - - return OPERATOR_FINISHED; -} - -void COLLECTION_OT_objects_remove_all(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Remove From All Unlinked Collections"; - ot->description = "Remove selected objects from all collections not used in a scene"; - ot->idname = "COLLECTION_OT_objects_remove_all"; - - /* api callbacks */ - ot->exec = collection_objects_remove_all_exec; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -static int collection_objects_remove_exec(bContext *C, wmOperator *op) -{ - Object *ob = ED_object_context(C); - Main *bmain = CTX_data_main(C); - int single_collection_index = RNA_enum_get(op->ptr, "collection"); - Collection *single_collection = collection_object_active_find_index(bmain, ob, single_collection_index); - Collection *collection; - bool updated = false; - - if (ob == NULL) - return OPERATOR_CANCELLED; - - for (collection = bmain->collection.first; collection; collection = collection->id.next) { - if (single_collection && collection != single_collection) - continue; - if (!BKE_collection_has_object(collection, ob)) - continue; - - /* now remove all selected objects from the collection */ - CTX_DATA_BEGIN (C, Base *, base, selected_editable_bases) - { - BKE_collection_object_remove(bmain, collection, base->object, false); - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - updated = true; - } - CTX_DATA_END; - } - - if (!updated) - return OPERATOR_CANCELLED; - - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); - - return OPERATOR_FINISHED; -} - -void COLLECTION_OT_objects_remove(wmOperatorType *ot) -{ - PropertyRNA *prop; - - /* identifiers */ - ot->name = "Remove From Collection"; - ot->description = "Remove selected objects from a collection"; - ot->idname = "COLLECTION_OT_objects_remove"; - - /* api callbacks */ - ot->exec = collection_objects_remove_exec; - ot->invoke = WM_menu_invoke; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - /* properties */ - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", "The collection to remove this object from"); - RNA_def_enum_funcs(prop, collection_object_active_itemf); - RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); - ot->prop = prop; -} - -static int collection_create_exec(bContext *C, wmOperator *op) -{ - Main *bmain = CTX_data_main(C); - char name[MAX_ID_NAME - 2]; /* id name */ - - RNA_string_get(op->ptr, "name", name); - - Collection *collection = BKE_collection_add(bmain, NULL, name); - id_fake_user_set(&collection->id); - - CTX_DATA_BEGIN (C, Base *, base, selected_bases) - { - BKE_collection_object_add(bmain, collection, base->object); - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - } - CTX_DATA_END; - - DEG_relations_tag_update(bmain); - WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); - - return OPERATOR_FINISHED; -} - -void COLLECTION_OT_create(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Create New Collection"; - ot->description = "Create an object collection from selected objects"; - ot->idname = "COLLECTION_OT_create"; - - /* api callbacks */ - ot->exec = collection_create_exec; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - RNA_def_string(ot->srna, "name", "Collection", MAX_ID_NAME - 2, "Name", "Name of the new collection"); -} - -/****************** properties window operators *********************/ - -static int collection_add_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Object *ob = ED_object_context(C); - Main *bmain = CTX_data_main(C); - - if (ob == NULL) - return OPERATOR_CANCELLED; - - Collection *collection = BKE_collection_add(bmain, NULL, "Collection"); - id_fake_user_set(&collection->id); - BKE_collection_object_add(bmain, collection, ob); - - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); - - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_collection_add(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Add to Collection"; - ot->idname = "OBJECT_OT_collection_add"; - ot->description = "Add an object to a new collection"; - - /* api callbacks */ - ot->exec = collection_add_exec; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -static int collection_link_exec(bContext *C, wmOperator *op) -{ - Main *bmain = CTX_data_main(C); - Object *ob = ED_object_context(C); - Collection *collection = BLI_findlink(&bmain->collection, RNA_enum_get(op->ptr, "collection")); - - if (ELEM(NULL, ob, collection)) - return OPERATOR_CANCELLED; - - /* Early return check, if the object is already in collection - * we could skip all the dependency check and just consider - * operator is finished. - */ - if (BKE_collection_has_object(collection, ob)) { - return OPERATOR_FINISHED; - } - - /* Adding object to collection which is used as duplicollection for self is bad idea. - * - * It is also bad idea to add object to collection which is in collection which - * contains our current object. - */ - if (BKE_collection_object_cyclic_check(bmain, ob, collection)) { - BKE_report(op->reports, RPT_ERROR, "Could not add the collection because of dependency cycle detected"); - return OPERATOR_CANCELLED; - } - - BKE_collection_object_add(bmain, collection, ob); - - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); - - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_collection_link(wmOperatorType *ot) -{ - PropertyRNA *prop; - - /* identifiers */ - ot->name = "Link to Collection"; - ot->idname = "OBJECT_OT_collection_link"; - ot->description = "Add an object to an existing collection"; - - /* api callbacks */ - ot->exec = collection_link_exec; - ot->invoke = WM_enum_search_invoke; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; - - /* properties */ - prop = RNA_def_enum(ot->srna, "collection", DummyRNA_NULL_items, 0, "Collection", ""); - RNA_def_enum_funcs(prop, RNA_collection_local_itemf); - RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE); - ot->prop = prop; -} - -static int collection_remove_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Main *bmain = CTX_data_main(C); - Object *ob = ED_object_context(C); - Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; - - if (!ob || !collection) - return OPERATOR_CANCELLED; - - BKE_collection_object_remove(bmain, collection, ob, false); - - DEG_id_tag_update(&collection->id, DEG_TAG_COPY_ON_WRITE); - DEG_relations_tag_update(bmain); - - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, ob); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_collection_remove(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Remove Collection"; - ot->idname = "OBJECT_OT_collection_remove"; - ot->description = "Remove the active object from this collection"; - - /* api callbacks */ - ot->exec = collection_remove_exec; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - - -static int collection_unlink_exec(bContext *C, wmOperator *UNUSED(op)) -{ - Main *bmain = CTX_data_main(C); - Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; - - if (!collection) - return OPERATOR_CANCELLED; - - BKE_libblock_delete(bmain, collection); - - DEG_relations_tag_update(bmain); - - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_collection_unlink(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Unlink Collection"; - ot->idname = "OBJECT_OT_collection_unlink"; - ot->description = "Unlink the collection from all objects"; - - /* api callbacks */ - ot->exec = collection_unlink_exec; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} - -static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */ -{ - Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data; - - if (!collection) - return OPERATOR_CANCELLED; - - CTX_DATA_BEGIN (C, Base *, base, visible_bases) - { - if (((base->flag & BASE_SELECTED) == 0) && ((base->flag & BASE_SELECTABLE) != 0)) { - if (BKE_collection_has_object_recursive(collection, base->object)) { - ED_object_base_select(base, BA_SELECT); - } - } - } - CTX_DATA_END; - - WM_event_add_notifier(C, NC_OBJECT | ND_DRAW, NULL); - - return OPERATOR_FINISHED; -} - -void OBJECT_OT_collection_objects_select(wmOperatorType *ot) -{ - /* identifiers */ - ot->name = "Select Objects in Collection"; - ot->idname = "OBJECT_OT_collection_objects_select"; - ot->description = "Select all objects in collection"; - - /* api callbacks */ - ot->exec = select_grouped_exec; - ot->poll = ED_operator_objectmode; - - /* flags */ - ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; -} diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 7eca34c505f..9279a755b56 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -37,8 +37,8 @@ #include "DNA_anim_types.h" #include "DNA_armature_types.h" #include "DNA_mesh_types.h" +#include "DNA_collection_types.h" #include "DNA_constraint_types.h" -#include "DNA_group_types.h" #include "DNA_lamp_types.h" #include "DNA_lattice_types.h" #include "DNA_material_types.h" diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 3ebec65da69..fc4934fe4b3 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -34,7 +34,7 @@ #include #include "DNA_anim_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_material_types.h" #include "DNA_modifier_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index 432a27da1e7..b105102fa6c 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -39,7 +39,7 @@ #include "DNA_object_types.h" #include "DNA_scene_types.h" #include "DNA_gpencil_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_lattice_types.h" #include "BLI_math.h" diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 8bb60b19dcf..0059d782eaf 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -51,7 +51,7 @@ #include "DNA_world_types.h" #include "DNA_camera_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_material_types.h" #include "DNA_node_types.h" #include "DNA_object_types.h" diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 363c30427db..8e9d40ad4b1 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -33,7 +33,7 @@ #include #include "DNA_action_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_object_types.h" #include "DNA_scene_types.h" diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 67632f6a53a..41aadcc949f 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -39,7 +39,7 @@ #include "BLT_translation.h" #include "DNA_armature_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_node_types.h" diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index fa57df0393a..435f2bb7aa5 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -33,7 +33,7 @@ #include #include "DNA_anim_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_scene_types.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index fdf9d6df374..b9814e97dfc 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -31,9 +31,9 @@ #include "MEM_guardedalloc.h" #include "DNA_armature_types.h" +#include "DNA_collection_types.h" #include "DNA_curve_types.h" #include "DNA_gpencil_types.h" -#include "DNA_group_types.h" #include "DNA_lattice_types.h" #include "DNA_mesh_types.h" #include "DNA_meta_types.h" diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 6633dbdf08e..d33e8ff2662 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -33,7 +33,7 @@ #include #include "DNA_anim_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_scene_types.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/editors/space_outliner/outliner_collections.c b/source/blender/editors/space_outliner/outliner_collections.c index d4c85ce28bd..64315120afd 100644 --- a/source/blender/editors/space_outliner/outliner_collections.c +++ b/source/blender/editors/space_outliner/outliner_collections.c @@ -29,7 +29,7 @@ #include "BLI_utildefines.h" #include "BLI_listbase.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_object_types.h" #include "BKE_context.h" diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.c b/source/blender/editors/space_outliner/outliner_dragdrop.c index e3c089a813f..1c19bb4d3b8 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.c +++ b/source/blender/editors/space_outliner/outliner_dragdrop.c @@ -33,7 +33,7 @@ #include "MEM_guardedalloc.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" #include "DNA_space_types.h" diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 211c9e1a392..d8715f2dfe0 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -31,9 +31,9 @@ #include "DNA_anim_types.h" #include "DNA_armature_types.h" +#include "DNA_collection_types.h" #include "DNA_gpencil_types.h" #include "DNA_gpencil_modifier_types.h" -#include "DNA_group_types.h" #include "DNA_lamp_types.h" #include "DNA_lightprobe_types.h" #include "DNA_object_types.h" diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index ec267d333a7..b845e5c4d40 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -34,7 +34,7 @@ #include "MEM_guardedalloc.h" #include "DNA_anim_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_ID.h" #include "DNA_scene_types.h" #include "DNA_object_types.h" diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index 39d77f75c0e..34734b74a21 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -33,7 +33,7 @@ #include "BLI_listbase.h" #include "BLI_math.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "BLT_translation.h" diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index ec5e11520a6..bc016816075 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -32,7 +32,7 @@ #include #include "DNA_armature_types.h" -#include "DNA_group_types.h" +#include "DNA_collection_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 190ef9fa229..84af223733d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -33,8 +33,8 @@ #include "DNA_anim_types.h" #include "DNA_armature_types.h" +#include "DNA_collection_types.h" #include "DNA_gpencil_types.h" -#include "DNA_group_types.h" #include "DNA_lamp_types.h" #include "DNA_linestyle_types.h" #include "DNA_material_types.h" diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index 91033189035..170a54cd404 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -39,8 +39,8 @@ #include "DNA_constraint_types.h" #include "DNA_camera_types.h" #include "DNA_cachefile_types.h" +#include "DNA_collection_types.h" #include "DNA_gpencil_types.h" -#include "DNA_group_types.h" #include "DNA_key_types.h" #include "DNA_lamp_types.h" #include "DNA_material_types.h" diff --git a/source/blender/editors/space_view3d/view3d_draw_legacy.c b/source/blender/editors/space_view3d/view3d_draw_legacy.c index d0fc36a8a1e..612be3ad6aa 100644 --- a/source/blender/editors/space_view3d/view3d_draw_legacy.c +++ b/source/blender/editors/space_view3d/view3d_draw_legacy.c @@ -34,9 +34,9 @@ #include "DNA_armature_types.h" #include "DNA_camera_types.h" +#include "DNA_collection_types.h" #include "DNA_customdata_types.h" #include "DNA_object_types.h" -#include "DNA_group_types.h" #include "DNA_mesh_types.h" #include "DNA_key_types.h" #include "DNA_lamp_types.h" diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index c1f5f33b38c..ff6aa18be09 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -33,8 +33,8 @@ #include +#include "DNA_collection_types.h" #include "DNA_object_types.h" -#include "DNA_group_types.h" #include "DNA_scene_types.h" #include "DNA_screen_types.h" #include "DNA_space_types.h" -- cgit v1.2.3