[Bf-blender-cvs] [b606161458b] blender2.8: Fix T51821: Viewport not updating when switching worlds

Luca Rood noreply at git.blender.org
Thu Jun 29 14:50:59 CEST 2017


Commit: b606161458be3862e4f0fc92ffca8ffe90eeda5f
Author: Luca Rood
Date:   Thu Jun 29 14:48:43 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBb606161458be3862e4f0fc92ffca8ffe90eeda5f

Fix T51821: Viewport not updating when switching worlds

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

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

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

diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index b8182c813e2..eec7c8b910d 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -1620,6 +1620,14 @@ static void rna_Scene_glsl_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poi
 	DEG_id_tag_update(&scene->id, 0);
 }
 
+static void rna_Scene_world_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+{
+	Scene *sc = (Scene *)ptr->id.data;
+
+	rna_Scene_glsl_update(bmain, scene, ptr);
+	WM_main_add_notifier(NC_WORLD | ND_WORLD, &sc->id);
+}
+
 static void rna_Scene_freestyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
 {
 	Scene *scene = (Scene *)ptr->id.data;
@@ -8906,7 +8914,7 @@ void RNA_def_scene(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "world", PROP_POINTER, PROP_NONE);
 	RNA_def_property_flag(prop, PROP_EDITABLE);
 	RNA_def_property_ui_text(prop, "World", "World used for rendering the scene");
-	RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_glsl_update");
+	RNA_def_property_update(prop, NC_SCENE | ND_WORLD, "rna_Scene_world_update");
 
 	prop = RNA_def_property(srna, "cursor_location", PROP_FLOAT, PROP_XYZ_LENGTH);
 	RNA_def_property_float_sdna(prop, NULL, "cursor");




More information about the Bf-blender-cvs mailing list