From d820f65635cccdd7e9142eb74f63b3492ea12272 Mon Sep 17 00:00:00 2001 From: Greg Zaal Date: Thu, 18 Jul 2024 09:54:36 +0200 Subject: [PATCH] Update some shadow properties with changes in Blender 4.2 --- __init__.py | 2 +- ui.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/__init__.py b/__init__.py index ab0e3cf..3604ad2 100644 --- a/__init__.py +++ b/__init__.py @@ -20,7 +20,7 @@ "name": "Gaffer", "description": "Master your lighting workflow with easy access to light properties, HDRIs and other tools", "author": "Greg Zaal", - "version": (3, 2, 3), + "version": (3, 2, 4), "blender": (3, 4, 0), "location": "3D View > Sidebar & World Settings > HDRI", "warning": "", diff --git a/ui.py b/ui.py index 6e02d2c..bd0f4b9 100644 --- a/ui.py +++ b/ui.py @@ -302,7 +302,10 @@ def draw_more_options_cycles(box, scene, light, material, node_strength, is_port text="MIS", toggle=True, ) - row.prop(light.data.cycles, "cast_shadow", text="Shadows", toggle=True) + if hasattr(light.data.cycles, "cast_shadow"): # Before Blender 4.2 + row.prop(light.data.cycles, "cast_shadow", text="Shadows", toggle=True) + else: # Blender 4.2+ + row.prop(light.data, "use_shadow", text="Shadows", toggle=True) row.separator() for v in visibility[1:]: # All but camera if bpy.app.version_string >= "3.0": @@ -378,10 +381,6 @@ def draw_more_options_eevee(box, scene, light): row = col.row(align=True) row.prop(light.data, "use_shadow", text="Shadows", toggle=True) - if light.data.use_shadow: - row.prop(light.data, "use_contact_shadow", text="Contact", toggle=True) - if light.data.use_contact_shadow: - row.prop(light.data, "contact_shadow_thickness") row.separator() row.prop(light.data, "specular_factor")