Navigation Menu

Skip to content

Commit

Permalink
fix exception when updating light attributes from Python console
Browse files Browse the repository at this point in the history
  • Loading branch information
Theverat committed May 7, 2018
1 parent bb9c5ee commit 0d63f06
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions properties/light.py
Expand Up @@ -70,13 +70,13 @@ def init():

class LuxCoreLightProps(bpy.types.PropertyGroup):
def update_image(self, context):
if context.lamp:
if getattr(context, "lamp", None):
# For spot lamp (toggle projection mode)
if context.lamp.type == "AREA":
if context.lamp.type == "SPOT":
context.lamp.use_square = self.image is not None

def update_is_laser(self, context):
if context.lamp:
if getattr(context, "lamp", None):
# For area lamp (laser can't be rectangular)
if self.is_laser:
context.lamp.shape = "SQUARE"
Expand Down

0 comments on commit 0d63f06

Please sign in to comment.