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.
This commit is contained in:
Damien Picard 2020-10-28 20:39:22 +01:00
parent 94989086ae
commit d85787dd2b
Notes: blender-bot 2023-02-14 18:48:59 +01:00
Referenced by issue #80379, Custom "startup.blend" breaks the Sun Position add-on
1 changed files with 3 additions and 2 deletions

View File

@ -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"