X Tutup
Skip to content

Commit 0d63f06

Browse files
committed
fix exception when updating light attributes from Python console
1 parent bb9c5ee commit 0d63f06

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

properties/light.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,13 @@ def init():
7070

7171
class LuxCoreLightProps(bpy.types.PropertyGroup):
7272
def update_image(self, context):
73-
if context.lamp:
73+
if getattr(context, "lamp", None):
7474
# For spot lamp (toggle projection mode)
75-
if context.lamp.type == "AREA":
75+
if context.lamp.type == "SPOT":
7676
context.lamp.use_square = self.image is not None
7777

7878
def update_is_laser(self, context):
79-
if context.lamp:
79+
if getattr(context, "lamp", None):
8080
# For area lamp (laser can't be rectangular)
8181
if self.is_laser:
8282
context.lamp.shape = "SQUARE"

0 commit comments

Comments
 (0)
X Tutup