[Bf-blender-cvs] [cd317fab65e] blender2.8: Fix wrong attempt to get depsgraph from RNA Groups ViewLayer.

Bastien Montagne noreply at git.blender.org
Thu Feb 1 12:12:21 CET 2018


Commit: cd317fab65e1b6c1652ba7a58786a8cc5bd11843
Author: Bastien Montagne
Date:   Thu Feb 1 12:09:22 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBcd317fab65e1b6c1652ba7a58786a8cc5bd11843

Fix wrong attempt to get depsgraph from RNA Groups ViewLayer.

===================================================================

M	source/blender/makesrna/intern/rna_layer.c

===================================================================

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)



More information about the Bf-blender-cvs mailing list