From 31da72545ed014e7f91dc945e693d5d7e65a3bf2 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Fri, 19 Sep 2014 22:25:17 +0200 Subject: Cycles: Backward compatibility code for the Clamp splitting in 2.70. If an older file (< 270) had clamp enabled, with e.g. a value of 2.0, Direct and Indirect clamp are now automatically set to 2.0 as well. --- intern/cycles/blender/addon/version_update.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'intern') diff --git a/intern/cycles/blender/addon/version_update.py b/intern/cycles/blender/addon/version_update.py index 6f9509e7d99..6c592f89a76 100644 --- a/intern/cycles/blender/addon/version_update.py +++ b/intern/cycles/blender/addon/version_update.py @@ -28,12 +28,26 @@ def do_versions(self): if not bpy.data.is_saved: return + # Clamp Direct/Indirect separation in 270 + if bpy.data.version <= (2, 70, 0): + for scene in bpy.data.scenes: + cscene = scene.cycles + sample_clamp = cscene.get("sample_clamp", False) + if (sample_clamp and + not cscene.is_property_set("sample_clamp_direct") and + not cscene.is_property_set("sample_clamp_indirect")): + + cscene.sample_clamp_direct = sample_clamp + cscene.sample_clamp_indirect = sample_clamp + + # Change of Volume Bounces in 271 if bpy.data.version <= (2, 71, 0): for scene in bpy.data.scenes: cscene = scene.cycles if not cscene.is_property_set("volume_bounces"): cscene.volume_bounces = 1 + # Caustics Reflective/Refractive separation in 272 for scene in bpy.data.scenes: cscene = scene.cycles if (cscene.get("no_caustics", False) and -- cgit v1.2.3