[Bf-extensions-cvs] [d85787dd] master: Sun position: Fix T80379 - Custom startup breaks the add-on

Damien Picard noreply at git.blender.org
Wed Oct 28 22:51:46 CET 2020


Commit: d85787dd2bf343903cf95d9c4a9bd87d55c71e31
Author: Damien Picard
Date:   Wed Oct 28 20:39:22 2020 +0100
Branches: master
https://developer.blender.org/rBAd85787dd2bf343903cf95d9c4a9bd87d55c71e31

Sun position: Fix T80379 - Custom startup breaks the add-on

The startup world didn't use nodes, so the sky texture node couldn't
be found.

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

M	sun_position/ui_sun.py

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

diff --git a/sun_position/ui_sun.py b/sun_position/ui_sun.py
index e14d9600..fa79a3f0 100644
--- a/sun_position/ui_sun.py
+++ b/sun_position/ui_sun.py
@@ -148,8 +148,9 @@ class SUNPOS_PT_Panel(bpy.types.Panel):
                 col.prop(sp, "time_spread")
         col.separator()
 
-        col.prop_search(sp, "sky_texture", context.scene.world.node_tree,
-                        "nodes")
+        if context.scene.world.node_tree is not None:
+            col.prop_search(sp, "sky_texture", context.scene.world.node_tree,
+                            "nodes")
 
 class SUNPOS_PT_Location(bpy.types.Panel):
     bl_space_type = "PROPERTIES"



More information about the Bf-extensions-cvs mailing list