Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Gavrilov <angavrilov@gmail.com>2022-10-09 14:10:35 +0300
committerAlexander Gavrilov <angavrilov@gmail.com>2022-10-10 17:13:06 +0300
commitbb8dba8609ed86bb0bd9bc231a84a352c293a14d (patch)
treee8aa488b6faace6f97b84119c64380b6f9b55431 /source/blender/makesrna/intern/rna_layer.c
parentf5e1a2119d2584cd823154d0ace5e4bf95cde5a1 (diff)
Fix missing view layer update when iterating a collection from Python.
The previous fix ignored the most fundamental access operation. Follow up to 4a60c4746ddf fixing 68589a31ebfb.
Diffstat (limited to 'source/blender/makesrna/intern/rna_layer.c')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index 427a38094be..b08d4b60fcc 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -369,6 +369,16 @@ static bool rna_LayerCollection_has_selected_objects(LayerCollection *lc,
return false;
}
+void rna_LayerCollection_children_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)
+{
+ Scene *scene = (Scene *)ptr->owner_id;
+ LayerCollection *lc = (LayerCollection *)ptr->data;
+ ViewLayer *view_layer = BKE_view_layer_find_from_collection(scene, lc);
+ BKE_view_layer_synced_ensure(scene, view_layer);
+
+ rna_iterator_listbase_begin(iter, &lc->layer_collections, NULL);
+}
+
static bool rna_LayerCollection_children_lookupint(struct PointerRNA *ptr,
int key,
struct PointerRNA *r_ptr)
@@ -435,7 +445,7 @@ static void rna_def_layer_collection(BlenderRNA *brna)
RNA_def_property_struct_type(prop, "LayerCollection");
RNA_def_property_ui_text(prop, "Children", "Child layer collections");
RNA_def_property_collection_funcs(prop,
- NULL,
+ "rna_LayerCollection_children_begin",
NULL,
NULL,
NULL,