diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-08-30 06:13:44 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-08-30 06:42:28 +0300 |
commit | e06050945e25c26167c4f193d214936e70a231a8 (patch) | |
tree | c6513a052a8ac8832a9173712c5454a6f19ca7b9 /source/blender | |
parent | 3abbae2d7c054922059f087addea6675d6e26d14 (diff) |
Cleanup: pass v3d as const to view layer utilities
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/BKE_layer.h | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer.c | 12 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/layer_utils.c | 16 |
3 files changed, 26 insertions, 14 deletions
diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 7fe932edf31..1976509543d 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -98,7 +98,7 @@ int BKE_layer_collection_findindex(struct ViewLayer *view_layer, const struct La void BKE_main_collection_sync(const struct Main *bmain); void BKE_scene_collection_sync(const struct Scene *scene); void BKE_layer_collection_sync(const struct Scene *scene, struct ViewLayer *view_layer); -void BKE_layer_collection_local_sync(struct ViewLayer *view_layer, struct View3D *v3d); +void BKE_layer_collection_local_sync(struct ViewLayer *view_layer, const struct View3D *v3d); void BKE_main_collection_sync_remap(const struct Main *bmain); @@ -129,7 +129,7 @@ void BKE_layer_collection_isolate_global(struct Scene *scene, struct LayerCollection *lc, bool extend); void BKE_layer_collection_isolate_local(struct ViewLayer *view_layer, - struct View3D *v3d, + const struct View3D *v3d, struct LayerCollection *lc, bool extend); void BKE_layer_collection_set_visible(struct ViewLayer *view_layer, @@ -150,7 +150,7 @@ void BKE_layer_eval_view_layer_indexed(struct Depsgraph *depsgraph, typedef struct ObjectsVisibleIteratorData { struct ViewLayer *view_layer; - struct View3D *v3d; + const struct View3D *v3d; } ObjectsVisibleIteratorData; void BKE_view_layer_selected_objects_iterator_begin(BLI_Iterator *iter, void *data_in); @@ -169,7 +169,7 @@ struct ObjectsInModeIteratorData { int object_mode; int object_type; struct ViewLayer *view_layer; - struct View3D *v3d; + const struct View3D *v3d; struct Base *base_active; }; @@ -361,13 +361,13 @@ struct ObjectsInModeParams { }; Base **BKE_view_layer_array_from_bases_in_mode_params(struct ViewLayer *view_layer, - struct View3D *v3d, + const struct View3D *v3d, uint *r_len, const struct ObjectsInModeParams *params); struct Object **BKE_view_layer_array_from_objects_in_mode_params( struct ViewLayer *view_layer, - struct View3D *v3d, + const struct View3D *v3d, uint *len, const struct ObjectsInModeParams *params); diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c index cf6139d9449..4da59ff302d 100644 --- a/source/blender/blenkernel/intern/layer.c +++ b/source/blender/blenkernel/intern/layer.c @@ -1088,7 +1088,7 @@ bool BKE_base_is_visible(const View3D *v3d, const Base *base) return base->flag & BASE_VISIBLE_VIEWLAYER; } -bool BKE_object_is_visible_in_viewport(const struct View3D *v3d, const struct Object *ob) +bool BKE_object_is_visible_in_viewport(const View3D *v3d, const struct Object *ob) { BLI_assert(v3d != NULL); @@ -1231,7 +1231,7 @@ static void layer_collection_local_sync(ViewLayer *view_layer, } } -void BKE_layer_collection_local_sync(ViewLayer *view_layer, View3D *v3d) +void BKE_layer_collection_local_sync(ViewLayer *view_layer, const View3D *v3d) { const unsigned short local_collections_uuid = v3d->local_collections_uuid; @@ -1251,7 +1251,7 @@ void BKE_layer_collection_local_sync(ViewLayer *view_layer, View3D *v3d) * Same as BKE_layer_collection_isolate_local but for a viewport */ void BKE_layer_collection_isolate_local(ViewLayer *view_layer, - View3D *v3d, + const View3D *v3d, LayerCollection *lc, bool extend) { @@ -1463,11 +1463,11 @@ bool BKE_scene_has_object(Scene *scene, Object *ob) * \{ */ typedef struct LayerObjectBaseIteratorData { - View3D *v3d; + const View3D *v3d; Base *base; } LayerObjectBaseIteratorData; -static bool object_bases_iterator_is_valid(View3D *v3d, Base *base, const int flag) +static bool object_bases_iterator_is_valid(const View3D *v3d, Base *base, const int flag) { BLI_assert((v3d == NULL) || (v3d->spacetype == SPACE_VIEW3D)); @@ -1484,7 +1484,7 @@ static void object_bases_iterator_begin(BLI_Iterator *iter, void *data_in_v, con { ObjectsVisibleIteratorData *data_in = data_in_v; ViewLayer *view_layer = data_in->view_layer; - View3D *v3d = data_in->v3d; + const View3D *v3d = data_in->v3d; Base *base = view_layer->object_bases.first; /* when there are no objects */ diff --git a/source/blender/blenkernel/intern/layer_utils.c b/source/blender/blenkernel/intern/layer_utils.c index d77c214130a..20ad0cb6af1 100644 --- a/source/blender/blenkernel/intern/layer_utils.c +++ b/source/blender/blenkernel/intern/layer_utils.c @@ -34,8 +34,12 @@ #include "MEM_guardedalloc.h" +/* -------------------------------------------------------------------- */ +/** \name Objects in Mode Array + * \{ */ + Base **BKE_view_layer_array_from_bases_in_mode_params(ViewLayer *view_layer, - View3D *v3d, + const View3D *v3d, uint *r_len, const struct ObjectsInModeParams *params) { @@ -83,7 +87,7 @@ Base **BKE_view_layer_array_from_bases_in_mode_params(ViewLayer *view_layer, } Object **BKE_view_layer_array_from_objects_in_mode_params(ViewLayer *view_layer, - View3D *v3d, + const View3D *v3d, uint *r_len, const struct ObjectsInModeParams *params) { @@ -97,6 +101,12 @@ Object **BKE_view_layer_array_from_objects_in_mode_params(ViewLayer *view_layer, return (Object **)base_array; } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Filter Functions + * \{ */ + bool BKE_view_layer_filter_edit_mesh_has_uvs(Object *ob, void *UNUSED(user_data)) { if (ob->type == OB_MESH) { @@ -124,3 +134,5 @@ bool BKE_view_layer_filter_edit_mesh_has_edges(Object *ob, void *UNUSED(user_dat } return false; } + +/** \} */ |