|
1 | 1 | import bpy |
2 | | - |
3 | | -from ..Utils.SFR_TestRender import TestRender |
| 2 | +import itertools as it |
4 | 3 |
|
5 | 4 | from bpy.types import Context, Operator |
| 5 | + |
6 | 6 | from .. import SFR_Settings |
| 7 | +from ..Utils.SFR_TestRender import TestRender |
7 | 8 | from ..install_deps import dependencies |
| 9 | +from ..Utils.fib import fib |
8 | 10 |
|
9 | 11 |
|
10 | 12 | class SFR_Benchmark_cy(Operator): |
@@ -290,17 +292,21 @@ def execute(self, context: Context): |
290 | 292 | iteration = 0 |
291 | 293 | repeat = True |
292 | 294 | TestRender(path, iteration, settings) |
293 | | - while repeat: |
| 295 | + for x in it.takewhile(lambda _: repeat, fib()): |
| 296 | + # save best value found so far before rendering next iteration |
| 297 | + best_val_found = cycles.sample_clamp_indirect |
294 | 298 | # set settings |
295 | | - cycles.sample_clamp_indirect += 1 |
| 299 | + cycles.sample_clamp_indirect += x |
| 300 | + print(f"Indirect Clamp increment {x} to {cycles.sample_clamp_indirect}") |
296 | 301 | if self.insert_keyframes: |
297 | 302 | keyframe_insert('cycles.sample_clamp_indirect') |
298 | 303 | # set next |
299 | 304 | iteration += 1 |
300 | 305 | print("Indirect Clamp Iteration: ", iteration) |
301 | 306 | # start second render |
302 | 307 | repeat = TestRender(path, iteration, settings) |
303 | | - cycles.sample_clamp_indirect -= 1 |
| 308 | + print(f"Best value found: {best_val_found}") |
| 309 | + cycles.sample_clamp_indirect = best_val_found |
304 | 310 | if self.insert_keyframes: |
305 | 311 | keyframe_insert('cycles.sample_clamp_indirect') |
306 | 312 |
|
|
0 commit comments