Skip to content

Commit

Permalink
fix: world panel disappear if world datablock is removed
Browse files Browse the repository at this point in the history
  • Loading branch information
bdancer committed May 4, 2015
1 parent 2c23d38 commit 3190476
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions ui/properties_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ def draw(self, context):
self.layout.template_preview(context.world)


class VRAY_WP_context_world(classes.VRayWorldPanel):
class VRAY_WP_context_world(classes.VRayPanel):
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = 'world'
bl_label = ""
bl_options = {'HIDE_HEADER'}

Expand All @@ -56,20 +59,21 @@ def draw(self, context):
elif world:
layout.template_ID(space, "pin_id")

VRayWorld = context.world.vray
if context.world:
VRayWorld = context.world.vray

layout.separator()
layout.prop(VRayWorld, 'global_light_level', slider=True)
layout.separator()
layout.prop(VRayWorld, 'global_light_level', slider=True)

classes.NtreeWidget(layout, VRayWorld, "World Tree", "vray.add_nodetree_world", 'WORLD')
classes.NtreeWidget(layout, VRayWorld, "World Tree", "vray.add_nodetree_world", 'WORLD')

if not classes.TreeHasNodes(VRayWorld.ntree):
return
if not classes.TreeHasNodes(VRayWorld.ntree):
return

activeNode = VRayWorld.ntree.nodes[-1]
activeNode = VRayWorld.ntree.nodes[-1]

layout.separator()
classes.DrawNodePanel(context, self.layout, activeNode, PLUGINS)
layout.separator()
classes.DrawNodePanel(context, self.layout, activeNode, PLUGINS)


def GetRegClasses():
Expand Down

0 comments on commit 3190476

Please sign in to comment.