Listing the "Blender Foundation" as copyright holder implied the Blender Foundation holds copyright to files which may include work from many developers. While keeping copyright on headers makes sense for isolated libraries, Blender's own code may be refactored or moved between files in a way that makes the per file copyright holders less meaningful. Copyright references to the "Blender Foundation" have been replaced with "Blender Authors", with the exception of `./extern/` since these this contains libraries which are more isolated, any changed to license headers there can be handled on a case-by-case basis. Some directories in `./intern/` have also been excluded: - `./intern/cycles/` it's own `AUTHORS` file is planned. - `./intern/opensubdiv/`. An "AUTHORS" file has been added, using the chromium projects authors file as a template. Design task: #110784 Ref !110783.
43 lines
995 B
Python
43 lines
995 B
Python
# SPDX-FileCopyrightText: 2021-2022 Blender Authors
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
import api
|
|
|
|
|
|
def _run(filepath):
|
|
import bpy
|
|
import time
|
|
|
|
# Load once to ensure it's cached by OS
|
|
bpy.ops.wm.open_mainfile(filepath=filepath)
|
|
bpy.ops.wm.read_homefile(use_empty=True, use_factory_startup=True)
|
|
|
|
# Measure loading the second time
|
|
start_time = time.time()
|
|
bpy.ops.wm.open_mainfile(filepath=filepath)
|
|
elapsed_time = time.time() - start_time
|
|
|
|
result = {'time': elapsed_time}
|
|
return result
|
|
|
|
|
|
class BlendLoadTest(api.Test):
|
|
def __init__(self, filepath):
|
|
self.filepath = filepath
|
|
|
|
def name(self):
|
|
return self.filepath.stem
|
|
|
|
def category(self):
|
|
return "blend_load"
|
|
|
|
def run(self, env, device_id):
|
|
result, _ = env.run_in_blender(_run, str(self.filepath))
|
|
return result
|
|
|
|
|
|
def generate(env):
|
|
filepaths = env.find_blend_files('*/*')
|
|
return [BlendLoadTest(filepath) for filepath in filepaths]
|