Fix error when enabling Mist pass but there was no world. Can't find mist settings, so check for World first.

This commit is contained in:
Pablo Vazquez 2014-04-05 17:52:06 -03:00
parent 49d1c8d8c6
commit 1bd3922b3a

@ -885,9 +885,10 @@ class CyclesWorld_PT_mist(CyclesButtonsPanel, Panel):
@classmethod @classmethod
def poll(cls, context): def poll(cls, context):
if CyclesButtonsPanel.poll(context): if CyclesButtonsPanel.poll(context):
for rl in context.scene.render.layers: if context.world:
if rl.use_pass_mist: for rl in context.scene.render.layers:
return True if rl.use_pass_mist:
return True
return False return False