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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-02-01 14:09:22 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-02-01 14:10:10 +0300
commitcd317fab65e1b6c1652ba7a58786a8cc5bd11843 (patch)
treec498763511e75729545d35d2eccc5a752a06099e /source/blender
parent1ce8a7f3d032830386a0aebf3c3ff6c940e1181a (diff)
Fix wrong attempt to get depsgraph from RNA Groups ViewLayer.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesrna/intern/rna_layer.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_layer.c b/source/blender/makesrna/intern/rna_layer.c
index 131378b5c49..68c4a15e06b 100644
--- a/source/blender/makesrna/intern/rna_layer.c
+++ b/source/blender/makesrna/intern/rna_layer.c
@@ -843,10 +843,14 @@ static int rna_ViewLayer_objects_selected_skip(CollectionPropertyIterator *iter,
static PointerRNA rna_ViewLayer_depsgraph_get(PointerRNA *ptr)
{
- Scene *scene = (Scene *)ptr->id.data;
- ViewLayer *view_layer = (ViewLayer *)ptr->data;
- Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, false);
- return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph);
+ ID *id = ptr->id.data;
+ if (GS(id->name) == ID_SCE) {
+ Scene *scene = (Scene *)id;
+ ViewLayer *view_layer = (ViewLayer *)ptr->data;
+ Depsgraph *depsgraph = BKE_scene_get_depsgraph(scene, view_layer, false);
+ return rna_pointer_inherit_refine(ptr, &RNA_Depsgraph, depsgraph);
+ }
+ return PointerRNA_NULL;
}
static void rna_LayerObjects_selected_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)