Skip to content

Commit

Permalink
Update some shadow properties with changes in Blender 4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
gregzaal committed Jul 18, 2024
1 parent e48f0ff commit d820f65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
9 changes: 4 additions & 5 deletions ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit d820f65

Please sign in to comment.