Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cycles.py « tests « performance « tests - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c70efe46c6dc9d2c3441c5811d173d933fe482c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import api
import os

def _run(args):
    import bpy
    import time

    scene = bpy.context.scene
    scene.render.engine = 'CYCLES'
    scene.cycles.samples = 4

    start_time = time.time()
    bpy.ops.render.render()
    elapsed_time = time.time() - start_time
    result = {'time': elapsed_time}
    return result

class CyclesTest(api.Test):
    def __init__(self, filepath):
        self.filepath = filepath

    def name(self):
        return 'cycles_' + self.filepath.stem

    def use_device(self):
        return True

    def run(self, env):
        return env.run_in_blender(_run, {}, blendfile=self.filepath)

def generate(env):
    filepaths = env.find_blend_files('cycles')
    return [CyclesTest(filepath) for filepath in filepaths]