diff options
author | Monique Dewanchand <mdewanchand> | 2022-09-14 22:30:20 +0300 |
---|---|---|
committer | Monique <mdewanchand@atmind.nl> | 2022-09-14 22:30:56 +0300 |
commit | 23276bcc37acc54f1e1814abdf482a432523c3a6 (patch) | |
tree | 8677bacc96fb953fb27625a6ae563aa1ae5e1769 /source/blender/makesrna | |
parent | 1a4854898000661dd7cf57492a7a75cb60ea63ef (diff) |
Adding `const Scene*` parameter in many areas.
Related to {D15885} that requires scene parameter
to be added in many places. To speed up the review process
the adding of the scene parameter was added in a separate
patch.
Reviewed By: mont29
Maniphest Tasks: T73411
Differential Revision: https://developer.blender.org/D15930
Diffstat (limited to 'source/blender/makesrna')
-rw-r--r-- | source/blender/makesrna/intern/rna_layer.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c index 6ab9d3a46ad..3a76b9e05c2 100644 --- a/source/blender/makesrna/intern/rna_layer.c +++ b/source/blender/makesrna/intern/rna_layer.c @@ -315,7 +315,7 @@ static void rna_LayerCollection_exclude_update(Main *bmain, Scene *UNUSED(scene) if (!exclude) { /* We need to update animation of objects added back to the scene through enabling this view * layer. */ - FOREACH_OBJECT_BEGIN (view_layer, ob) { + FOREACH_OBJECT_BEGIN (scene, view_layer, ob) { DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION); } FOREACH_OBJECT_END; @@ -347,9 +347,18 @@ static bool rna_LayerCollection_has_objects(LayerCollection *lc) return (lc->runtime_flag & LAYER_COLLECTION_HAS_OBJECTS) != 0; } -static bool rna_LayerCollection_has_selected_objects(LayerCollection *lc, ViewLayer *view_layer) +static bool rna_LayerCollection_has_selected_objects(LayerCollection *lc, + Main *bmain, + ViewLayer *view_layer) { - return BKE_layer_collection_has_selected_objects(view_layer, lc); + LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { + LISTBASE_FOREACH (ViewLayer *, scene_view_layer, &scene->view_layers) { + if (scene_view_layer == view_layer) { + return BKE_layer_collection_has_selected_objects(scene, view_layer, lc); + } + } + } + return false; } #else @@ -442,6 +451,7 @@ static void rna_def_layer_collection(BlenderRNA *brna) func = RNA_def_function( srna, "has_selected_objects", "rna_LayerCollection_has_selected_objects"); + RNA_def_function_flag(func, FUNC_USE_MAIN); RNA_def_function_ui_description(func, ""); prop = RNA_def_pointer( func, "view_layer", "ViewLayer", "", "View layer the layer collection belongs to"); diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a5bae9bad8e..268aacfccc6 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1529,7 +1529,7 @@ static void rna_SpaceView3D_use_local_collections_update(bContext *C, PointerRNA View3D *v3d = (View3D *)ptr->data; if (ED_view3d_local_collections_set(bmain, v3d)) { - BKE_layer_collection_local_sync(view_layer, v3d); + BKE_layer_collection_local_sync(scene, view_layer, v3d); DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); } } |