Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/collection.c
| Show All 24 Lines | |||||
| #include "BLI_iterator.h" | #include "BLI_iterator.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| #include "BLI_math_base.h" | #include "BLI_math_base.h" | ||||
| #include "BLI_threads.h" | #include "BLI_threads.h" | ||||
| #include "BLT_translation.h" | #include "BLT_translation.h" | ||||
| #include "BKE_anim_data.h" | #include "BKE_anim_data.h" | ||||
| #include "BKE_collection.h" | #include "BKE_collection.h" | ||||
| #include "BKE_icons.h" | #include "BKE_icons.h" | ||||
ankitm: Run `make format` or use extensions (VSCode, Sublime Text) for `clang-format`.
Alphabetical… | |||||
| #include "BKE_idprop.h" | #include "BKE_idprop.h" | ||||
| #include "BKE_idtype.h" | #include "BKE_idtype.h" | ||||
| #include "BKE_layer.h" | #include "BKE_layer.h" | ||||
| #include "BKE_lib_id.h" | #include "BKE_lib_id.h" | ||||
| #include "BKE_lib_query.h" | #include "BKE_lib_query.h" | ||||
| #include "BKE_lib_remap.h" | #include "BKE_lib_remap.h" | ||||
| #include "BKE_main.h" | #include "BKE_main.h" | ||||
| #include "BKE_object.h" | #include "BKE_object.h" | ||||
| ▲ Show 20 Lines • Show All 1,035 Lines • ▼ Show 20 Lines | if (collection_src != NULL) { | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* Adding will fail if object is already in collection. | /* Adding will fail if object is already in collection. | ||||
| * However we still need to remove it from the other collections. */ | * However we still need to remove it from the other collections. */ | ||||
| BKE_collection_object_add(bmain, collection_dst, ob); | BKE_collection_object_add(bmain, collection_dst, ob); | ||||
| scene_collections_object_remove(bmain, scene, ob, false, collection_dst); | scene_collections_object_remove(bmain, scene, ob, false, collection_dst); | ||||
| } | } | ||||
| ViewLayer *view_layer = scene->view_layers.first; | |||||
Done Inline ActionsThe first view layer is not special, it may not be the active one dfelinto: The first view layer is not special, it may not be the active one | |||||
| LayerCollection *lc_master = view_layer->layer_collections.first; | |||||
| LISTBASE_FOREACH (LayerCollection *, lc_iter, &lc_master->layer_collections) { | |||||
| BKE_layer_collection_set_flag(lc_iter, LAYER_COLLECTION_EXCLUDE, true); | |||||
| } | |||||
Done Inline ActionsUse LISTBASE_FOREACH. wmWindow *window = wm->windows.first; window != NULL; window = window->next ankitm: Use `LISTBASE_FOREACH`.
Same for
wmWindow *window = wm->windows.first; window != NULL… | |||||
| LISTBASE_FOREACH (Base *, base, &view_layer->object_bases) { | |||||
| base->flag &= ~BASE_HIDDEN; | |||||
| } | |||||
| BKE_layer_collection_sync(scene, view_layer); | |||||
| DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); | |||||
| LISTBASE_FOREACH (LayerCollection *, lc_iter, &lc_master->layer_collections) { | |||||
| BKE_layer_collection_set_flag(lc_iter, LAYER_COLLECTION_EXCLUDE, false); | |||||
| } | |||||
| BKE_layer_collection_sync(scene, view_layer); | |||||
| } | } | ||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Collection Scene Membership | /** \name Collection Scene Membership | ||||
| * \{ */ | * \{ */ | ||||
| ▲ Show 20 Lines • Show All 619 Lines • Show Last 20 Lines | |||||
Run make format or use extensions (VSCode, Sublime Text) for clang-format.
Alphabetical order for headers.
Same for
https://wiki.blender.org/wiki/Tools/ClangFormat