2023-08-16 00:20:26 +10:00
|
|
|
# SPDX-FileCopyrightText: 2011-2023 Blender Authors
|
2023-06-14 22:49:59 +10:00
|
|
|
#
|
2022-02-11 09:07:11 +11:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2011-01-21 00:06:30 +00:00
|
|
|
|
|
|
|
|
# Use '--write-blend=/tmp/test.blend' to view output
|
|
|
|
|
|
2025-05-05 15:10:22 +02:00
|
|
|
set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/tests/files)
|
2020-01-13 07:11:45 -05:00
|
|
|
set(TEST_PYTHON_DIR ${CMAKE_SOURCE_DIR}/tests/python)
|
2011-01-21 00:06:30 +00:00
|
|
|
set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
|
|
|
|
|
|
2011-03-16 12:06:12 +00:00
|
|
|
# ugh, any better way to do this on testing only?
|
2019-06-25 19:52:37 +02:00
|
|
|
file(MAKE_DIRECTORY ${TEST_OUT_DIR})
|
|
|
|
|
file(MAKE_DIRECTORY ${TEST_OUT_DIR}/io_tests)
|
2020-02-14 11:02:22 +01:00
|
|
|
file(MAKE_DIRECTORY ${TEST_OUT_DIR}/blendfile_io)
|
2011-03-16 12:06:12 +00:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# Check which tests can be enabled.
|
|
|
|
|
if(IS_DIRECTORY ${TEST_SRC_DIR}/render)
|
|
|
|
|
set(TEST_SRC_DIR_EXISTS TRUE)
|
|
|
|
|
|
|
|
|
|
if(OPENIMAGEIO_TOOL)
|
|
|
|
|
set(TEST_OPENIMAGEIO_TOOL_EXISTS TRUE)
|
|
|
|
|
else()
|
|
|
|
|
set(TEST_OPENIMAGEIO_TOOL_EXISTS FALSE)
|
|
|
|
|
message(STATUS "Tests: Disabling render tests, missing oiiotool")
|
|
|
|
|
endif()
|
|
|
|
|
else()
|
|
|
|
|
set(TEST_SRC_DIR_EXISTS FALSE)
|
|
|
|
|
message(STATUS "Tests: Disabling most tests, no test data in ${TEST_SRC_DIR}")
|
|
|
|
|
endif()
|
2011-01-21 00:06:30 +00:00
|
|
|
|
2024-12-24 11:55:29 +01:00
|
|
|
if(WITH_SYSTEM_PYTHON_TESTS)
|
|
|
|
|
if(NOT EXISTS "${TEST_SYSTEM_PYTHON_EXE}")
|
2025-04-05 20:21:57 +11:00
|
|
|
message(ERROR
|
|
|
|
|
"'System Python' tests requested but no valid system python path, "
|
|
|
|
|
"set TEST_SYSTEM_PYTHON_EXE."
|
|
|
|
|
)
|
2024-12-24 11:55:29 +01:00
|
|
|
set(WITH_SYSTEM_PYTHON_TESTS OFF)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
# Run Blender command with parameters.
|
Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.
This does not work, only the last call is effective, all previous
ones have absolutely no effect.
This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.
This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).
NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.
NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
|
|
|
function(add_blender_test_impl testname envvars_list exe)
|
2019-08-02 14:25:40 +02:00
|
|
|
add_test(
|
2019-08-02 15:19:59 +02:00
|
|
|
NAME ${testname}
|
2023-10-26 15:19:33 +11:00
|
|
|
COMMAND ${exe} ${ARGN}
|
2019-08-02 14:25:40 +02:00
|
|
|
)
|
Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.
This does not work, only the last call is effective, all previous
ones have absolutely no effect.
This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.
This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).
NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.
NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
|
|
|
blender_test_set_envvars("${testname}" "${envvars_list}")
|
2019-08-02 14:25:40 +02:00
|
|
|
endfunction()
|
|
|
|
|
|
2023-10-26 15:19:33 +11:00
|
|
|
function(add_blender_test testname)
|
|
|
|
|
add_blender_test_impl(
|
|
|
|
|
"${testname}"
|
Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.
This does not work, only the last call is effective, all previous
ones have absolutely no effect.
This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.
This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).
NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.
NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
|
|
|
""
|
2023-10-26 15:19:33 +11:00
|
|
|
"${TEST_BLENDER_EXE}"
|
|
|
|
|
${TEST_BLENDER_EXE_PARAMS}
|
|
|
|
|
${ARGN}
|
|
|
|
|
)
|
|
|
|
|
endfunction()
|
|
|
|
|
|
2025-08-01 17:24:37 +02:00
|
|
|
function(add_blender_test_allow_error testname)
|
|
|
|
|
# Remove `--debug-exit-on-error` since errors are printed on e.g. meshes with
|
|
|
|
|
# invalid data or failed image loading, but sometimes we want to test those.
|
Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.
- There's a tests/python/modules/io_report.py that can produce
a "fairly short text description of the scene" (meshes, objects,
curves, cameras, lights, materials, armatures, actions, images).
About each object, it lists some basic information (e.g. number
of vertices in the mesh), plus a small slice of "data" (e.g.
first few values of each mesh attribute).
- Custom import parameters, if needed, can be provided by
having a sidecar .json file next to imported file (same
basename, json extension), that would have a single json
object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
covering various possible cases (meshes, animations, materials,
hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
testing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
|
|
|
set(EXE_PARAMS ${TEST_BLENDER_EXE_PARAMS})
|
|
|
|
|
list(REMOVE_ITEM EXE_PARAMS --debug-exit-on-error)
|
|
|
|
|
add_blender_test_impl(
|
|
|
|
|
"${testname}"
|
|
|
|
|
""
|
|
|
|
|
"${TEST_BLENDER_EXE}"
|
|
|
|
|
${EXE_PARAMS}
|
|
|
|
|
${ARGN}
|
|
|
|
|
)
|
|
|
|
|
endfunction()
|
|
|
|
|
|
2023-10-26 15:19:33 +11:00
|
|
|
if(WITH_UI_TESTS)
|
2025-06-12 20:27:38 +02:00
|
|
|
set(_blender_headless_env_vars "BLENDER_BIN=${TEST_BLENDER_EXE}")
|
2025-03-14 22:27:50 +01:00
|
|
|
if(WITH_UI_TESTS_HEADLESS)
|
|
|
|
|
|
|
|
|
|
# Currently only WAYLAND is supported, support for others may be added later.
|
|
|
|
|
# In this case none of the WESTON environment variables will be used.
|
|
|
|
|
if(WITH_GHOST_WAYLAND)
|
|
|
|
|
set(_weston_bin_in_libdir OFF)
|
|
|
|
|
if(DEFINED LIBDIR)
|
|
|
|
|
set(_weston_bin_default "${LIBDIR}/wayland_weston/bin/weston")
|
|
|
|
|
else()
|
|
|
|
|
set(_weston_bin_default "weston")
|
|
|
|
|
endif()
|
|
|
|
|
set(WESTON_BIN "${_weston_bin_default}" CACHE STRING "\
|
|
|
|
|
The location of weston, leave blank for the default location."
|
|
|
|
|
)
|
|
|
|
|
mark_as_advanced(WESTON_BIN)
|
|
|
|
|
if((DEFINED LIBDIR) AND ("${WESTON_BIN}" STREQUAL "${_weston_bin_default}"))
|
|
|
|
|
set(_weston_bin_in_libdir ON)
|
|
|
|
|
endif()
|
2023-10-26 15:19:33 +11:00
|
|
|
|
|
|
|
|
list(APPEND _blender_headless_env_vars
|
2025-03-14 22:27:50 +01:00
|
|
|
"WESTON_BIN=${WESTON_BIN}"
|
2023-10-26 15:19:33 +11:00
|
|
|
)
|
2025-03-14 22:27:50 +01:00
|
|
|
|
|
|
|
|
if(_weston_bin_in_libdir)
|
|
|
|
|
list(APPEND _blender_headless_env_vars
|
|
|
|
|
"WAYLAND_ROOT_DIR=${LIBDIR}/wayland"
|
|
|
|
|
"WESTON_ROOT_DIR=${LIBDIR}/wayland_weston"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2023-10-26 15:19:33 +11:00
|
|
|
endif()
|
2025-03-14 22:27:50 +01:00
|
|
|
else()
|
2025-06-12 20:27:38 +02:00
|
|
|
list(APPEND _blender_headless_env_vars
|
|
|
|
|
"PASS_THROUGH=1"
|
|
|
|
|
)
|
2025-03-14 22:27:50 +01:00
|
|
|
endif()
|
2025-06-12 20:27:38 +02:00
|
|
|
function(add_blender_test_ui testname)
|
|
|
|
|
# Remove `--background`a
|
|
|
|
|
set(EXE_PARAMS ${TEST_BLENDER_EXE_PARAMS})
|
|
|
|
|
list(REMOVE_ITEM EXE_PARAMS --background)
|
|
|
|
|
add_blender_test_impl(
|
|
|
|
|
"${testname}"
|
|
|
|
|
"${_blender_headless_env_vars}"
|
|
|
|
|
"${TEST_PYTHON_EXE}"
|
|
|
|
|
"${CMAKE_SOURCE_DIR}/tests/utils/blender_headless.py"
|
|
|
|
|
# NOTE: attempting to maximize the window causes problems with a headless `weston`,
|
|
|
|
|
# while this could be investigated, use windowed mode instead.
|
|
|
|
|
# Use a window size that balances software GPU rendering with enough room to use the UI.
|
|
|
|
|
--factory-startup
|
|
|
|
|
-p 0 0 800 600
|
|
|
|
|
"${EXE_PARAMS}"
|
|
|
|
|
"${ARGN}"
|
|
|
|
|
)
|
|
|
|
|
endfunction()
|
2023-10-26 15:19:33 +11:00
|
|
|
endif()
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
# Run Python script outside Blender.
|
|
|
|
|
function(add_python_test testname testscript)
|
Tests: use explicit Python to run unit tests
CentOS on the buildbot still runs Python 3.6, which is also used for the
unit tests. This means that the tests can't use language features that
are available to Blender itself. And testing with a different version of
Python than will be used by the actual code seems like a bad idea to me.
This commit adds `TEST_PYTHON_EXECUTABLE` as advanced CMake option. This
will allow us to set a specific Python executable when we need it. When
not set, a platform-specific default will be used:
- On Windows, the `python….exe` from the installation directory. This is
just like before this patch, except that this patch adds the
overridability.
- On macOS/Linux, the `${PYTHON_EXECUTABLE}` as found by CMake.
Every platform should now have a value (configured by the user or
detected by CMake) for `TEST_PYTHON_EXE`, so there is no need to allow
running without. This also removes the need to have some Python files
marked as executable.
If `TEST_PYTHON_EXE` is not user-configured, and thus the above default
is used, a status message is logged by CMake. I've seen this a lot in
other projects, and I like that it shows which values are auto-detected.
However, it's not common in Blender, so if we want we can either remove
it now, or remove it after the buildbot has been set up correctly.
Differential Revision: https://developer.blender.org/D7395
Reviewed by: campbellbarton, mont29, sergey
2020-04-10 10:35:17 +02:00
|
|
|
if(NOT TEST_PYTHON_EXE)
|
|
|
|
|
message(FATAL_ERROR "No Python configured for running tests, set TEST_PYTHON_EXE.")
|
2019-08-02 14:25:40 +02:00
|
|
|
endif()
|
2019-08-02 15:19:59 +02:00
|
|
|
|
Tests: use explicit Python to run unit tests
CentOS on the buildbot still runs Python 3.6, which is also used for the
unit tests. This means that the tests can't use language features that
are available to Blender itself. And testing with a different version of
Python than will be used by the actual code seems like a bad idea to me.
This commit adds `TEST_PYTHON_EXECUTABLE` as advanced CMake option. This
will allow us to set a specific Python executable when we need it. When
not set, a platform-specific default will be used:
- On Windows, the `python….exe` from the installation directory. This is
just like before this patch, except that this patch adds the
overridability.
- On macOS/Linux, the `${PYTHON_EXECUTABLE}` as found by CMake.
Every platform should now have a value (configured by the user or
detected by CMake) for `TEST_PYTHON_EXE`, so there is no need to allow
running without. This also removes the need to have some Python files
marked as executable.
If `TEST_PYTHON_EXE` is not user-configured, and thus the above default
is used, a status message is logged by CMake. I've seen this a lot in
other projects, and I like that it shows which values are auto-detected.
However, it's not common in Blender, so if we want we can either remove
it now, or remove it after the buildbot has been set up correctly.
Differential Revision: https://developer.blender.org/D7395
Reviewed by: campbellbarton, mont29, sergey
2020-04-10 10:35:17 +02:00
|
|
|
add_test(
|
|
|
|
|
NAME ${testname}
|
2022-11-03 11:48:47 +11:00
|
|
|
COMMAND ${TEST_PYTHON_EXE} ${TEST_PYTHON_EXE_EXTRA_ARGS} ${testscript} ${ARGN}
|
2022-12-05 23:05:25 +01:00
|
|
|
WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>
|
Tests: use explicit Python to run unit tests
CentOS on the buildbot still runs Python 3.6, which is also used for the
unit tests. This means that the tests can't use language features that
are available to Blender itself. And testing with a different version of
Python than will be used by the actual code seems like a bad idea to me.
This commit adds `TEST_PYTHON_EXECUTABLE` as advanced CMake option. This
will allow us to set a specific Python executable when we need it. When
not set, a platform-specific default will be used:
- On Windows, the `python….exe` from the installation directory. This is
just like before this patch, except that this patch adds the
overridability.
- On macOS/Linux, the `${PYTHON_EXECUTABLE}` as found by CMake.
Every platform should now have a value (configured by the user or
detected by CMake) for `TEST_PYTHON_EXE`, so there is no need to allow
running without. This also removes the need to have some Python files
marked as executable.
If `TEST_PYTHON_EXE` is not user-configured, and thus the above default
is used, a status message is logged by CMake. I've seen this a lot in
other projects, and I like that it shows which values are auto-detected.
However, it's not common in Blender, so if we want we can either remove
it now, or remove it after the buildbot has been set up correctly.
Differential Revision: https://developer.blender.org/D7395
Reviewed by: campbellbarton, mont29, sergey
2020-04-10 10:35:17 +02:00
|
|
|
)
|
Tests: Refactor handling of environment variables when invoking tests.
The current handling had a fairly bad issue: multiple calls to
`set_tests_properties` to set envvars of a same test.
This does not work, only the last call is effective, all previous
ones have absolutely no effect.
This has been addressed by moving all 'set envvar for test' logic into a
single CMake function, `blender_test_set_envvars`.
This function takes optional extra envvars if needed, and define a set
of default ones (currently, `PATH` from `PLATFORM_ENV_INSTALL` if
defined, and the 'nuke' `exitcode=0` `LSAN_OPTIONS` if relevant).
NOTE: The way `blender_test_set_envvars` handles extra envvars passed to
it as parameter is fairly basic and unsafe, in that there is no check
whether a same envvar is defined more than once. Think for now this is
an acceptable limitation.
NOTE: Although this commit _should_ be a non-functional change one, the
unification of the handling of all envvars makes it hard to ensure there is no
side effects.
The `PATH` envvar e.g. was set to either `PLATFORM_ENV_INSTALL` if defined,
or a copy of that variable's definition, but only in Windows case. So technically,
the behavior for this envvar is changed.
2024-01-05 21:13:54 +01:00
|
|
|
blender_test_set_envvars("${testname}" "")
|
2019-08-02 14:25:40 +02:00
|
|
|
endfunction()
|
2011-03-18 23:58:13 +00:00
|
|
|
|
2023-11-08 18:41:33 +01:00
|
|
|
# Run Python render test.
|
|
|
|
|
function(add_render_test testname testscript)
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_OPENIMAGEIO_TOOL_EXISTS)
|
|
|
|
|
set(_args ${ARGN} --blender "${TEST_BLENDER_EXE}" --oiiotool "${OPENIMAGEIO_TOOL}")
|
|
|
|
|
if(WITH_TESTS_BATCHED)
|
|
|
|
|
list(APPEND _args --batch)
|
|
|
|
|
endif()
|
|
|
|
|
add_python_test(${testname} ${testscript} ${_args})
|
2023-11-08 18:41:33 +01:00
|
|
|
endif()
|
|
|
|
|
endfunction()
|
|
|
|
|
|
2024-12-24 11:55:29 +01:00
|
|
|
# Run Python script outside Blender, using system default Python3 interpreter,
|
|
|
|
|
# NOT the one specified in `TEST_PYTHON_EXE`.
|
|
|
|
|
function(add_system_python_test testname testscript)
|
|
|
|
|
if(NOT WITH_SYSTEM_PYTHON_TESTS)
|
|
|
|
|
return()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_test(
|
|
|
|
|
NAME ${testname}
|
|
|
|
|
COMMAND ${TEST_SYSTEM_PYTHON_EXE} ${testscript} ${ARGN}
|
|
|
|
|
WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>
|
|
|
|
|
)
|
|
|
|
|
blender_test_set_envvars("${testname}" "")
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# TESTS USING SYSTEM PYTHON
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
2024-12-24 11:55:29 +01:00
|
|
|
add_system_python_test(
|
|
|
|
|
script_validate_on_system_python
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/system_python/load_tool_scripts.py
|
|
|
|
|
--root-dir ${CMAKE_SOURCE_DIR}
|
|
|
|
|
)
|
|
|
|
|
|
2011-03-18 23:58:13 +00:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# GENERAL PYTHON CORRECTNESS TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_load_keymap
|
2013-02-26 04:48:16 +00:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_keymap_completeness.py
|
|
|
|
|
)
|
|
|
|
|
|
2021-03-14 19:06:48 +11:00
|
|
|
add_blender_test(
|
|
|
|
|
script_validate_keymap
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_keymap_validate.py
|
|
|
|
|
-- --relaxed # Disable minor things that should not cause tests to break.
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_load_addons
|
2011-03-18 23:58:13 +00:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_load_addons.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_load_modules
|
2011-03-18 23:58:13 +00:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_load_py_modules.py
|
|
|
|
|
)
|
|
|
|
|
|
2020-02-11 10:15:31 +01:00
|
|
|
add_blender_test(
|
|
|
|
|
script_bundled_modules
|
2023-01-09 13:15:20 +01:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_bundled_modules.py -- --inside-blender
|
2020-02-11 10:15:31 +01:00
|
|
|
)
|
|
|
|
|
|
Python: add HTTP file downloader
Add a new package `scripts/modules/_bpy_internal/http`, containing
classes to download files via HTTP.
The code is intentionally put into the `_bpy_internal` package, as I
don't intend it to be the end-all-be-all of downloaders for general
use in add-ons. It's been written to support the Remote Asset Library
project (#134495), where it will be used to download JSON files (to
get the list of assets on the server) as well as the asset files
themselves.
The module consists of several parts. The main ones are:
`class ConditionalDownloader`
: File downloader, which downloads a URL to a file on disk.
It supports conditional requests via `ETag`/`If-None-Match` and
`Last-Modified`/`If-Modified-Since` HTTP headers (RFC 7273, section 3.
Precondition Header Fields). A `304 Not Modified` response is
treated as a succesful download.
Metadata of the request (the response length in bytes, and the above
headers) are stored on disk, in a location that is determined by the
user of the class. Probably in the future it would be nice to have a
single sqlite database for this (there's a TODO in the code about
this).
The downloader uses the Requests library, and manages its own HTTP
session object. This way it can handle TCP/IP connection reuse,
automatically retry failing connections, and in the future
HTTP-level authentication.
`class BackgroundDownloader`
: Wrapper for a `ConditionalDownloader` that manages a background
process for the actual downloading.
It runs the downloader in a background process, while ensuring that
its reporters (see below) get called on the main process. This way
it's possible to do background downloading, while still receiving
progress reports in a modal operator, which in turn can directly
call Blender's Python API. Care was taken to [not use Python
threads][1]
`class DownloadReporter`
: Protocol class. Objects adhering to the protocol can be given to a
`ConditionalDownloader` or `BackgroundDownloader`. The protocol has
functions like `download_starts(…)`, `download_progress(…)`,
`download_error(…)`, which will be called by the downloader to
report on what it's doing.
I chose to make this a protocol, rather than an abstract superclass,
because then it's possible to make an Operator a DownloadReporter
without requiring multi-classing.
[1]: https://docs.blender.org/api/main/info_gotchas_threading.html
Pull Request: https://projects.blender.org/blender/blender/pulls/138327
2025-08-01 12:27:56 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_http_downloader
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_http_downloader.py
|
|
|
|
|
)
|
|
|
|
|
|
2011-03-22 14:09:07 +00:00
|
|
|
# test running operators doesn't segfault under various conditions
|
2025-04-24 06:11:30 +02:00
|
|
|
if(WITH_TESTS_EXPERIMENTAL)
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_run_operators
|
2014-03-27 07:30:22 +11:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_run_operators.py
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2011-03-22 14:09:07 +00:00
|
|
|
|
2015-09-24 20:49:44 +10:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# PY API TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
2025-08-06 23:13:58 +00:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_bpy_app_tempdir
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_app_tempdir.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_bpy_path
|
2015-09-24 20:49:44 +10:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_path.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_bpy_utils_units
|
2015-09-24 20:49:44 +10:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_utils_units.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_mathutils
|
2011-12-20 01:49:24 +00:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_mathutils.py
|
|
|
|
|
)
|
|
|
|
|
|
2022-07-12 16:05:15 +10:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_bpy_driver_secure_eval
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_driver_secure_eval.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_idprop
|
2017-03-19 03:37:22 +11:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_idprop.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_idprop_datablock
|
Datablock ID Properties
The absence of datablock properties "will certainly be resolved soon as the need for them is becoming obvious" said the [[http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes|Python Nodes release notes]]. So this patch allows Python scripts to create ID Properties which reference datablocks.
This functionality is implemented for `PointerProperty` and now such properties can be created with Python.
In addition to the standard update callback, `PointerProperty` can have a `poll` callback (standard RNA) which is useful for search menus. For details see the test included in this patch.
Original author: @artfunkel
Alexander (Blend4Web Team)
Reviewers: brecht, artfunkel, mont29, campbellbarton
Reviewed By: mont29, campbellbarton
Subscribers: jta, sergey, campbellbarton, wisaac, poseidon4o, mont29, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov, fjuhec, sharlybg, cardboard, duarteframos, blueprintrandom, a.romanov, BYOB, disnel, aditiapratama, bliblubli, dfelinto, lukastoenne
Maniphest Tasks: T37754
Differential Revision: https://developer.blender.org/D113
2017-04-13 12:30:03 +03:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_idprop_datablock.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-08-25 18:47:37 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_prop
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_prop.py
|
|
|
|
|
)
|
|
|
|
|
|
Python: add foreach_get and foreach_set methods to pyrna_prop_array
This allows fast access to various arrays in the Python API.
Most notably, `image.pixels` can be accessed much more efficiently now.
**Benchmark**
Below are the results of a benchmark that compares different ways to
set/get all pixel values. I do the tests on 2048x2048 rgba images.
The benchmark tests the following dimensions:
- Byte vs. float per color channel
- Python list vs. numpy array containing floats
- `foreach_set` (new) vs. `image.pixels = ...` (old)
```
Pixel amount: 2048 * 2048 = 4.194.304
Byte buffer size: 16.8 mb
Float buffer size: 67.1 mb
Set pixel colors:
byte - new - list: 271 ms
byte - new - buffer: 29 ms
byte - old - list: 350 ms
byte - old - buffer: 2900 ms
float - new - list: 249 ms
float - new - buffer: 8 ms
float - old - list: 330 ms
float - old - buffer: 2880 ms
Get pixel colors:
byte - list: 128 ms
byte - buffer: 9 ms
float - list: 125 ms
float - buffer: 8 ms
```
**Observations**
The best set and get speed can be achieved with buffers and a float image,
at the cost of higher memory consumption. Furthermore, using buffers when
using `pixels = ...` is incredibly slow, because it is not optimized.
Optimizing this is possible, but might not be trivial (there were multiple
attempts afaik).
Float images are faster due to overhead introduced by the api for byte images.
If I profiled it correctly, a lot of time is spend in the `[0, 1] -> {0, ..., 255}`
conversion. The functions doing that conversion is `unit_float_to_uchar_clamp`.
While I have an idea on how it can be optimized, I do not know if it can be done
without changing its functionality slightly. Performance wise the best solution
would be to not do this conversion at all and accept byte input from the api
user directly, but that seems to be a more involved task as well.
Differential Revision: https://developer.blender.org/D7053
Reviewers: JacquesLucke, mont29
2020-03-13 12:57:12 +01:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_prop_array
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_prop_array.py
|
|
|
|
|
)
|
|
|
|
|
|
2022-04-07 14:32:21 +10:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_text
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_text.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-06-16 16:17:06 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_bmesh
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bmesh.py
|
|
|
|
|
)
|
|
|
|
|
|
2024-08-08 14:42:24 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
script_pyapi_grease_pencil
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_grease_pencil.py
|
|
|
|
|
)
|
|
|
|
|
|
2019-12-18 16:09:47 +01:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# DATA MANAGEMENT TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2019-12-18 16:09:47 +01:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
id_management
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_id_management.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-01-08 18:33:48 +01:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_rna_paths
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_rna_paths.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-01-24 18:33:26 +01:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_rna_accessors
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_rna_accessors.py
|
|
|
|
|
)
|
|
|
|
|
|
2014-02-02 13:29:08 -05:00
|
|
|
# ------------------------------------------------------------------------------
|
2020-02-13 17:48:00 +01:00
|
|
|
# BLEND IO & LINKING
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2020-02-13 17:48:00 +01:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
blendfile_io
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_io.py --
|
|
|
|
|
--output-dir ${TEST_OUT_DIR}/blendfile_io/
|
|
|
|
|
)
|
|
|
|
|
|
2024-05-08 17:28:32 +02:00
|
|
|
# This test can be extremely long, especially in debug builds.
|
|
|
|
|
# Generate BLENDFILE_VERSIONING_SPLIT_RANGE instances of the test,
|
|
|
|
|
# each processing their own subset of the whole set of blendfiles.
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
2025-09-25 13:04:32 +02:00
|
|
|
set(BLENDFILE_VERSIONING_SPLIT_RANGE 128)
|
2025-04-06 13:52:15 +02:00
|
|
|
math(EXPR BLENDFILE_VERSIONING_SPLIT_RANGE_CMAKE "${BLENDFILE_VERSIONING_SPLIT_RANGE} - 1")
|
|
|
|
|
foreach(idx RANGE ${BLENDFILE_VERSIONING_SPLIT_RANGE_CMAKE})
|
|
|
|
|
add_blender_test(
|
|
|
|
|
"blendfile_versioning_${idx}_over_${BLENDFILE_VERSIONING_SPLIT_RANGE}"
|
|
|
|
|
--log "*blendfile*"
|
|
|
|
|
--debug-memory
|
|
|
|
|
--debug
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_versioning.py --
|
|
|
|
|
--src-test-dir ${TEST_SRC_DIR}/
|
2025-06-21 14:06:43 +02:00
|
|
|
--output-dir ${TEST_OUT_DIR}/blendfile_io/
|
2025-04-06 13:52:15 +02:00
|
|
|
--slice-range ${BLENDFILE_VERSIONING_SPLIT_RANGE}
|
|
|
|
|
--slice-index ${idx}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
|
2024-05-08 17:28:32 +02:00
|
|
|
add_blender_test(
|
2025-04-06 13:52:15 +02:00
|
|
|
blendfile_liblink
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_liblink.py --
|
2024-05-08 17:28:32 +02:00
|
|
|
--src-test-dir ${TEST_SRC_DIR}/
|
2025-04-06 13:52:15 +02:00
|
|
|
--output-dir ${TEST_OUT_DIR}/blendfile_io/
|
2024-05-08 17:28:32 +02:00
|
|
|
)
|
2025-01-15 17:28:01 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
blendfile_relationships
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_relationships.py --
|
|
|
|
|
--src-test-dir ${TEST_SRC_DIR}/
|
|
|
|
|
--output-dir ${TEST_OUT_DIR}/blendfile_io/
|
|
|
|
|
)
|
2020-02-13 17:48:00 +01:00
|
|
|
|
2025-10-01 15:14:28 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
blendfile_library_overrides
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_library_overrides.py --
|
|
|
|
|
--output-dir ${TEST_OUT_DIR}/blendfile_io/
|
|
|
|
|
--test-dir "${TEST_SRC_DIR}/libraries_and_linking"
|
|
|
|
|
)
|
2025-06-23 12:53:55 +02:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
blendfile_header
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_header.py --
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests/blend_parsing"
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
2021-03-22 11:33:48 +01:00
|
|
|
|
2020-02-13 17:48:00 +01:00
|
|
|
# ------------------------------------------------------------------------------
|
2014-02-02 13:29:08 -05:00
|
|
|
# MODELING TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2014-02-02 13:29:08 -05:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
bmesh_bevel
|
|
|
|
|
${TEST_SRC_DIR}/modeling/bevel_regression.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/bevel_operator.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2018-02-12 07:23:23 -05:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bmesh_boolean
|
|
|
|
|
${TEST_SRC_DIR}/modeling/bool_regression.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/boolean_operator.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2017-02-16 15:36:00 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bmesh_split_faces
|
|
|
|
|
${TEST_SRC_DIR}/modeling/split_faces_test.blend
|
|
|
|
|
--python-text run_tests
|
|
|
|
|
)
|
2020-12-30 13:12:29 -06:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
curve_to_mesh
|
|
|
|
|
${TEST_SRC_DIR}/modeling/curve_to_mesh.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/curve_to_mesh.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2024-01-16 21:59:15 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
curves_extrude
|
|
|
|
|
${TEST_SRC_DIR}/modeling/curves_extrude.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/curves_extrude.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2024-12-02 16:30:41 +01:00
|
|
|
|
2025-09-03 22:13:12 -04:00
|
|
|
add_blender_test(
|
|
|
|
|
mesh_join
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/mesh_join.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-10-14 20:50:36 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
object_edit
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/object_edit.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
object_conversion
|
|
|
|
|
${TEST_SRC_DIR}/modeling/object_conversion.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/object_conversion.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
object_api
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/bl_object.py
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2025-02-11 23:09:20 +01:00
|
|
|
|
2025-07-01 16:30:00 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
geometry_attributes
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_geometry_attributes.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-08-26 11:03:27 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
geonode_file_reporting
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_geonode_file_reporting.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests"
|
|
|
|
|
)
|
|
|
|
|
|
2017-05-26 21:57:45 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# MODIFIERS TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2017-05-26 21:57:45 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
object_modifier_array
|
|
|
|
|
${TEST_SRC_DIR}/modifier_stack/array_test.blend
|
|
|
|
|
--python-text run_tests.py
|
|
|
|
|
)
|
2020-01-13 07:11:45 -05:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
modifiers
|
|
|
|
|
${TEST_SRC_DIR}/modeling/modifiers.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/modifiers.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-04-27 16:47:07 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
physics_cloth
|
|
|
|
|
${TEST_SRC_DIR}/physics/cloth_test.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/physics_cloth.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-04-27 16:47:07 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
physics_softbody
|
|
|
|
|
${TEST_SRC_DIR}/physics/softbody_test.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/physics_softbody.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-12-17 20:44:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
physics_dynamic_paint
|
|
|
|
|
${TEST_SRC_DIR}/physics/dynamic_paint_test.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/physics_dynamic_paint.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-12-17 20:44:55 +05:30
|
|
|
|
2021-05-18 14:02:41 +02:00
|
|
|
add_blender_test(
|
2025-04-06 13:52:15 +02:00
|
|
|
deform_modifiers
|
|
|
|
|
${TEST_SRC_DIR}/modeling/deform_modifiers.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/deform_modifiers.py
|
2021-05-18 14:02:41 +02:00
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-12-17 20:44:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_MOD_OCEANSIM)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
physics_ocean
|
|
|
|
|
${TEST_SRC_DIR}/physics/ocean_test.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/physics_ocean.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2020-12-17 20:44:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
physics_particle_system
|
|
|
|
|
${TEST_SRC_DIR}/physics/physics_particle_test.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/physics_particle_system.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-12-17 20:44:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
physics_particle_instance
|
|
|
|
|
${TEST_SRC_DIR}/physics/physics_particle_instance.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/physics_particle_instance.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
2020-12-17 20:44:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
constraints
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_constraints.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/constraints"
|
|
|
|
|
)
|
2025-07-08 22:17:36 +02:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
multires
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/bl_multires.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sculpting"
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
2020-02-25 12:16:34 +01:00
|
|
|
|
2020-01-13 07:11:45 -05:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# OPERATORS TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
operators
|
|
|
|
|
${TEST_SRC_DIR}/modeling/operators.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/operators.py
|
|
|
|
|
--
|
|
|
|
|
--run-all-tests
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2020-01-13 07:11:45 -05:00
|
|
|
|
2020-09-15 10:41:08 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# ANIMATION TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
2023-12-29 12:31:34 +01:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_animation_armature
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_armature.py
|
|
|
|
|
)
|
|
|
|
|
|
2023-11-14 18:14:01 +02:00
|
|
|
add_blender_test(
|
2025-04-06 13:52:15 +02:00
|
|
|
bl_animation_bake
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_bake.py
|
2023-11-14 18:14:01 +02:00
|
|
|
)
|
|
|
|
|
|
2020-09-15 10:41:08 +02:00
|
|
|
add_blender_test(
|
2025-04-06 13:52:15 +02:00
|
|
|
bl_animation_nla_strip
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_nla_strip.py
|
2020-09-15 10:41:08 +02:00
|
|
|
)
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
bl_animation_drivers
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_drivers.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
)
|
2024-03-04 18:02:49 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_animation_fcurves
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_fcurves.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
)
|
2023-11-07 16:17:32 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_animation_action
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_action.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
--output-dir "${TEST_OUT_DIR}/bl_animation_action"
|
|
|
|
|
)
|
2025-03-27 12:56:46 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_animation_keyframing
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_keyframing.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
)
|
2025-02-04 11:29:05 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_pose_assets
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pose_assets.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
)
|
2023-11-20 17:52:28 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_rigging_symmetrize
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_rigging_symmetrize.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
)
|
2025-10-14 05:10:13 +02:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
vertex_group_painting
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/vertex_group_painting.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/animation"
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
2022-02-04 14:19:44 +01:00
|
|
|
|
2025-04-10 22:09:06 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# BRUSH TESTS
|
|
|
|
|
add_blender_test(
|
|
|
|
|
bl_brush
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_brush_test.py
|
|
|
|
|
)
|
|
|
|
|
|
2023-08-30 12:37:21 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2023-09-05 14:27:20 +02:00
|
|
|
# NODE GROUP TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2023-11-15 12:26:48 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
2025-06-18 08:39:01 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_node_structure_type_inference
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_node_structure_type_inference.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/node_group"
|
|
|
|
|
)
|
|
|
|
|
|
2025-07-24 08:13:34 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_node_socket_usage_inference
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_node_socket_usage_inference.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/node_group"
|
|
|
|
|
)
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_node_group_compat
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_node_group_compat.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/node_group"
|
|
|
|
|
)
|
2023-08-30 12:37:21 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
bl_node_group_interface
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_node_group_interface.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/node_group"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2023-01-19 17:07:23 +11:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# SVG TESTS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
2022-10-11 15:02:40 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
set(_svg_render_tests complex path)
|
2022-10-11 15:02:40 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
foreach(render_test ${_svg_render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
io_curve_svg_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/bl_io_curve_svg_test.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests/svg/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/io_curve_svg"
|
2019-08-30 17:50:01 +02:00
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endforeach()
|
2019-08-30 17:50:01 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
unset(_svg_render_tests)
|
|
|
|
|
endif()
|
2021-11-09 13:35:51 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# RENDER TESTS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
2021-11-09 13:35:51 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if((WITH_CYCLES OR WITH_GPU_RENDER_TESTS) AND TEST_SRC_DIR_EXISTS)
|
|
|
|
|
set(render_tests
|
|
|
|
|
attributes
|
|
|
|
|
camera
|
2025-08-31 02:58:12 +02:00
|
|
|
colorspace
|
2025-04-06 13:52:15 +02:00
|
|
|
bsdf
|
|
|
|
|
hair
|
|
|
|
|
image_colorspace
|
|
|
|
|
image_data_types
|
|
|
|
|
image_mapping
|
|
|
|
|
image_texture_limit
|
|
|
|
|
integrator
|
|
|
|
|
light
|
|
|
|
|
light_group
|
|
|
|
|
light_linking
|
|
|
|
|
mesh
|
2025-09-09 16:15:43 +02:00
|
|
|
node_inlining
|
2025-04-06 13:52:15 +02:00
|
|
|
pointcloud
|
|
|
|
|
principled_bsdf
|
|
|
|
|
shader
|
|
|
|
|
shadow_catcher
|
|
|
|
|
sss
|
|
|
|
|
texture
|
|
|
|
|
)
|
2021-11-09 13:35:51 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_OPENSUBDIV)
|
|
|
|
|
list(APPEND render_tests displacement)
|
|
|
|
|
endif()
|
2021-11-09 13:35:51 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_FREESTYLE)
|
|
|
|
|
list(APPEND render_tests render_layer)
|
|
|
|
|
endif()
|
2021-11-09 13:35:51 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_MOD_FLUID)
|
|
|
|
|
list(APPEND render_tests motion_blur reports volume)
|
|
|
|
|
endif()
|
2022-09-21 17:58:34 +02:00
|
|
|
|
2025-05-13 05:07:45 +02:00
|
|
|
if(WITH_OPENVDB AND WITH_MOD_FLUID)
|
|
|
|
|
# Some tests in the OpenVDB folder make use of fluid simulations to generate smoke
|
2025-04-06 13:52:15 +02:00
|
|
|
list(APPEND render_tests openvdb)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(WITH_OPENIMAGEDENOISE)
|
|
|
|
|
list(APPEND render_tests denoise)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
# Disabled until new OpenPGL version with deterministic results.
|
|
|
|
|
# if(WITH_CYCLES_PATH_GUIDING)
|
|
|
|
|
# list(APPEND render_tests guiding)
|
|
|
|
|
# endif()
|
|
|
|
|
|
|
|
|
|
if(WITH_GPU_RENDER_TESTS)
|
|
|
|
|
list(APPEND render_tests grease_pencil)
|
|
|
|
|
endif()
|
2019-08-30 17:50:01 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
list(SORT render_tests)
|
|
|
|
|
|
|
|
|
|
# Cycles
|
|
|
|
|
if(WITH_CYCLES)
|
|
|
|
|
set(_cycles_blocklist "")
|
2025-06-03 14:46:32 +02:00
|
|
|
set(_cycles_all_test_devices CPU CUDA OPTIX HIP HIP-RT METAL METAL-RT ONEAPI ONEAPI-RT)
|
|
|
|
|
set(_cycles_osl_test_devices CPU OPTIX)
|
2025-04-06 13:52:15 +02:00
|
|
|
foreach(_cycles_device ${CYCLES_TEST_DEVICES})
|
2025-06-03 14:46:32 +02:00
|
|
|
if(NOT ${_cycles_device} IN_LIST _cycles_all_test_devices)
|
2025-04-06 13:52:15 +02:00
|
|
|
message(FATAL_ERROR "Unknown Cycles test device ${_cycles_device}."
|
2025-06-03 14:46:32 +02:00
|
|
|
"Supported devices are: ${_cycles_all_test_devices}")
|
2021-01-14 12:24:24 +01:00
|
|
|
endif()
|
2025-04-06 13:52:15 +02:00
|
|
|
string(TOLOWER "${_cycles_device}" _cycles_device_lower)
|
|
|
|
|
set(_cycles_render_tests bake;${render_tests};osl)
|
|
|
|
|
|
2025-06-03 14:46:32 +02:00
|
|
|
set(_cycles_osl_test_type none)
|
|
|
|
|
if(WITH_CYCLES_OSL)
|
|
|
|
|
# If the render device is CPU, or a GPU WITH_CYCLES_TEST_OSL enabled,
|
|
|
|
|
# then enable the limited OSL tests (Tests OSL camera with OSL shading turned off).
|
|
|
|
|
# This specific configuration is chosen to avoid long test times on the GPU due to
|
|
|
|
|
# OSL JIT compilation, unless the developer explicitly enables OSL tests.
|
|
|
|
|
if(("${_cycles_device_lower}" STREQUAL "cpu") OR (WITH_CYCLES_TEST_OSL AND ${_cycles_device} IN_LIST _cycles_osl_test_devices))
|
|
|
|
|
set(_cycles_osl_test_type limited)
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
foreach(render_test ${_cycles_render_tests})
|
|
|
|
|
set(_cycles_test_name "cycles_${render_test}_${_cycles_device_lower}")
|
|
|
|
|
if(NOT(WITH_CYCLES_TEST_OSL AND WITH_CYCLES_OSL AND ("${render_test}" STREQUAL "osl")))
|
2025-06-03 14:46:32 +02:00
|
|
|
# Only run OSL specific tests during this phase if WITH_CYCLES_TEST_OSL isn't enabled
|
2025-04-06 13:52:15 +02:00
|
|
|
add_render_test(
|
|
|
|
|
${_cycles_test_name}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/cycles"
|
|
|
|
|
--device ${_cycles_device}
|
2025-06-03 14:46:32 +02:00
|
|
|
--osl "${_cycles_osl_test_type}"
|
2025-04-06 13:52:15 +02:00
|
|
|
)
|
|
|
|
|
if(NOT ("${_cycles_device_lower}" STREQUAL "cpu"))
|
|
|
|
|
set_tests_properties(${_cycles_test_name} PROPERTIES RUN_SERIAL TRUE)
|
|
|
|
|
endif()
|
2025-02-10 14:13:42 +01:00
|
|
|
endif()
|
2020-10-28 16:19:03 +01:00
|
|
|
|
2025-06-03 14:46:32 +02:00
|
|
|
# OSL variations of every test if WITH_CYCLES_TEST_OSL is set.
|
|
|
|
|
if(WITH_CYCLES_TEST_OSL AND NOT "${_cycles_osl_test_type}" STREQUAL "none")
|
|
|
|
|
add_render_test(
|
|
|
|
|
${_cycles_test_name}_osl
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/cycles_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/cycles_osl"
|
|
|
|
|
--device ${_cycles_device}
|
|
|
|
|
--osl "all"
|
|
|
|
|
)
|
|
|
|
|
if(NOT ("${_cycles_device_lower}" STREQUAL "cpu"))
|
|
|
|
|
set_tests_properties(${_cycles_test_name}_osl PROPERTIES RUN_SERIAL TRUE)
|
2023-03-30 19:46:49 +02:00
|
|
|
endif()
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
2024-08-14 17:00:48 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
unset(_cycles_test_name)
|
|
|
|
|
endforeach()
|
2025-06-03 14:46:32 +02:00
|
|
|
unset(_cycles_osl_test_type)
|
2025-04-06 13:52:15 +02:00
|
|
|
endforeach()
|
2025-06-03 14:46:32 +02:00
|
|
|
unset(_cycles_osl_test_devices)
|
|
|
|
|
unset(_cycles_all_test_devices)
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(WITH_GPU_RENDER_TESTS)
|
|
|
|
|
list(APPEND gpu_render_tests ${render_tests})
|
|
|
|
|
list(FILTER gpu_render_tests EXCLUDE REGEX light_group|shadow_catcher|denoise|guiding|reports)
|
|
|
|
|
|
|
|
|
|
set(_gpu_render_tests_arguments)
|
2024-08-14 17:00:48 +02:00
|
|
|
|
2025-06-13 12:36:14 +02:00
|
|
|
# EEVEE
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_OPENGL_BACKEND)
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
2025-05-01 17:54:22 +02:00
|
|
|
eevee_opengl_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py
|
2025-04-06 13:52:15 +02:00
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
2025-05-01 17:54:22 +02:00
|
|
|
--outdir "${TEST_OUT_DIR}/eevee_opengl"
|
2025-04-06 13:52:15 +02:00
|
|
|
--gpu-backend opengl
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
2019-08-30 17:50:01 +02:00
|
|
|
endforeach()
|
|
|
|
|
endif()
|
2019-05-16 20:21:35 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_METAL_BACKEND)
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
2025-05-01 17:54:22 +02:00
|
|
|
eevee_metal_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py
|
2025-04-06 13:52:15 +02:00
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
2025-05-01 17:54:22 +02:00
|
|
|
--outdir "${TEST_OUT_DIR}/eevee_metal"
|
2025-04-06 13:52:15 +02:00
|
|
|
--gpu-backend metal
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
endif()
|
2024-01-29 15:39:14 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_VULKAN_BACKEND AND WITH_GPU_RENDER_TESTS_VULKAN)
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
2025-05-01 17:54:22 +02:00
|
|
|
eevee_vulkan_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py
|
2025-04-06 13:52:15 +02:00
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
2025-05-01 17:54:22 +02:00
|
|
|
--outdir "${TEST_OUT_DIR}/eevee_vulkan"
|
2025-04-06 13:52:15 +02:00
|
|
|
--gpu-backend vulkan
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
endif()
|
2024-01-29 15:39:14 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# Workbench
|
|
|
|
|
if(WITH_OPENGL_BACKEND)
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
workbench_opengl_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/workbench_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/workbench_opengl"
|
|
|
|
|
--gpu-backend opengl
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
endif()
|
2024-09-14 12:35:02 +10:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_METAL_BACKEND)
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
workbench_metal_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/workbench_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/workbench_metal"
|
|
|
|
|
--gpu-backend metal
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
endif()
|
2023-10-05 16:02:49 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_VULKAN_BACKEND AND WITH_GPU_RENDER_TESTS_VULKAN)
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
workbench_vulkan_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/workbench_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
2025-09-05 14:34:14 +02:00
|
|
|
--outdir "${TEST_OUT_DIR}/workbench_vulkan"
|
2025-04-06 13:52:15 +02:00
|
|
|
--gpu-backend vulkan
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
endif()
|
2024-09-05 13:58:14 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# Overlay
|
|
|
|
|
if(WITH_GPU_RENDER_TESTS_HEADED)
|
2024-09-05 13:58:14 +02:00
|
|
|
if(WITH_OPENGL_BACKEND)
|
2025-04-06 13:52:15 +02:00
|
|
|
add_render_test(
|
|
|
|
|
overlay_opengl
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/overlay_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/overlay"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/overlay"
|
|
|
|
|
--gpu-backend opengl
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
2024-09-05 13:58:14 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(WITH_METAL_BACKEND)
|
2025-04-06 13:52:15 +02:00
|
|
|
add_render_test(
|
|
|
|
|
overlay_metal
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/overlay_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/overlay"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/overlay"
|
|
|
|
|
--gpu-backend metal
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
2024-09-05 13:58:14 +02:00
|
|
|
endif()
|
|
|
|
|
|
2024-12-16 16:18:06 +01:00
|
|
|
if(WITH_VULKAN_BACKEND AND WITH_GPU_RENDER_TESTS_VULKAN)
|
2025-04-06 13:52:15 +02:00
|
|
|
add_render_test(
|
|
|
|
|
overlay_vulkan
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/overlay_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/overlay"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/overlay"
|
|
|
|
|
--gpu-backend vulkan
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
2025-02-20 17:18:59 +01:00
|
|
|
endif()
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
2025-04-02 03:01:59 +00:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_HYDRA)
|
|
|
|
|
# Hydra Storm
|
|
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
storm_hydra_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/storm_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/storm_hydra"
|
|
|
|
|
--export_method "HYDRA"
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
2023-08-04 15:01:55 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
foreach(render_test ${gpu_render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
storm_usd_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/storm_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/render/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/storm_usd"
|
|
|
|
|
--export_method "USD"
|
|
|
|
|
${_gpu_render_tests_arguments}
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
2019-05-28 17:57:16 +02:00
|
|
|
endif()
|
2025-04-06 13:52:15 +02:00
|
|
|
unset(_gpu_render_tests_arguments)
|
2019-05-16 20:21:35 +02:00
|
|
|
endif()
|
2015-01-22 15:53:49 +05:00
|
|
|
endif()
|
Render Layers and Collections (merge from render-layers)
Design Documents
----------------
* https://wiki.blender.org/index.php/Dev:2.8/Source/Layers
* https://wiki.blender.org/index.php/Dev:2.8/Source/DataDesignRevised
User Commit Log
---------------
* New Layer and Collection system to replace render layers and viewport layers.
* A layer is a set of collections of objects (and their drawing options) required for specific tasks.
* A collection is a set of objects, equivalent of the old layers in Blender. A collection can be shared across multiple layers.
* All Scenes have a master collection that all other collections are children of.
* New collection "context" tab (in Properties Editor)
* New temporary viewport "collections" panel to control per-collection
visibility
Missing User Features
---------------------
* Collection "Filter"
Option to add objects based on their names
* Collection Manager operators
The existing buttons are placeholders
* Collection Manager drawing
The editor main region is empty
* Collection Override
* Per-Collection engine settings
This will come as a separate commit, as part of the clay-engine branch
Dev Commit Log
--------------
* New DNA file (DNA_layer_types.h) with the new structs
We are replacing Base by a new extended Base while keeping it backward
compatible with some legacy settings (i.e., lay, flag_legacy).
Renamed all Base to BaseLegacy to make it clear the areas of code that
still need to be converted
Note: manual changes were required on - deg_builder_nodes.h, rna_object.c, KX_Light.cpp
* Unittesting for main syncronization requirements
- read, write, add/copy/remove objects, copy scene, collection
link/unlinking, context)
* New Editor: Collection Manager
Based on patch by Julian Eisel
This is extracted from the layer-manager branch. With the following changes:
- Renamed references of layer manager to collections manager
- I doesn't include the editors/space_collections/ draw and util files
- The drawing code itself will be implemented separately by Julian
* Base / Object:
A little note about them. Original Blender code would try to keep them
in sync through the code, juggling flags back and forth. This will now
be handled by Depsgraph, keeping Object and Bases more separated
throughout the non-rendering code.
Scene.base is being cleared in doversion, and the old viewport drawing
code was poorly converted to use the new bases while the new viewport
code doesn't get merged and replace the old one.
Python API Changes
------------------
```
- scene.layers
+ # no longer exists
- scene.objects
+ scene.scene_layers.active.objects
- scene.objects.active
+ scene.render_layers.active.objects.active
- bpy.context.scene.objects.link()
+ bpy.context.scene_collection.objects.link()
- bpy_extras.object_utils.object_data_add(context, obdata, operator=None, use_active_layer=True, name=None)
+ bpy_extras.object_utils.object_data_add(context, obdata, operator=None, name=None)
- bpy.context.object.select
+ bpy.context.object.select = True
+ bpy.context.object.select = False
+ bpy.context.object.select_get()
+ bpy.context.object.select_set(action='SELECT')
+ bpy.context.object.select_set(action='DESELECT')
-AddObjectHelper.layers
+ # no longer exists
```
2017-02-07 10:18:38 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# COMPOSITOR TESTS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
2024-12-13 14:54:19 +01:00
|
|
|
set(compositor_tests
|
|
|
|
|
input
|
|
|
|
|
output
|
2025-06-26 17:26:59 +02:00
|
|
|
color
|
|
|
|
|
filter
|
2025-07-01 16:30:00 +02:00
|
|
|
utilities
|
2024-12-13 14:54:19 +01:00
|
|
|
vector
|
|
|
|
|
|
2025-02-10 10:40:29 +01:00
|
|
|
pixel_nodes
|
2024-12-13 14:54:19 +01:00
|
|
|
multiple_node_setups
|
|
|
|
|
)
|
2021-03-26 16:04:09 +01:00
|
|
|
|
2024-12-13 14:54:19 +01:00
|
|
|
if(WITH_LIBMV)
|
2025-06-26 17:26:59 +02:00
|
|
|
list(APPEND compositor_tests keying mask tracking transform anisotropic_filtering)
|
2024-12-13 14:54:19 +01:00
|
|
|
endif()
|
2023-01-19 17:07:23 +11:00
|
|
|
|
2024-12-13 14:54:19 +01:00
|
|
|
foreach(comp_test ${compositor_tests})
|
|
|
|
|
add_render_test(
|
2024-12-19 14:33:09 +02:00
|
|
|
compositor_cpu_${comp_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
|
2024-12-13 14:54:19 +01:00
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_cpu"
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
2023-08-19 15:00:54 +02:00
|
|
|
|
2025-02-14 16:17:18 +01:00
|
|
|
add_blender_test(
|
|
|
|
|
compositor_cpu_file_output
|
2025-02-16 20:42:16 +11:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/compositor_file_output_tests.py
|
2025-02-14 16:17:18 +01:00
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/file_output/"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_cpu/file_output"
|
|
|
|
|
)
|
2023-08-19 15:00:54 +02:00
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_GPU_COMPOSITOR_TESTS AND TEST_SRC_DIR_EXISTS)
|
|
|
|
|
set(compositor_tests
|
|
|
|
|
input
|
|
|
|
|
output
|
2025-06-26 17:26:59 +02:00
|
|
|
color
|
|
|
|
|
filter
|
2025-07-01 16:30:00 +02:00
|
|
|
utilities
|
2025-04-06 13:52:15 +02:00
|
|
|
vector
|
2023-08-24 11:37:29 +10:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
pixel_nodes
|
|
|
|
|
multiple_node_setups
|
|
|
|
|
)
|
2023-08-19 15:00:54 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_LIBMV)
|
2025-06-26 17:26:59 +02:00
|
|
|
list(APPEND compositor_tests keying mask tracking transform)
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(WITH_OPENGL_BACKEND)
|
|
|
|
|
foreach(comp_test ${compositor_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
compositor_opengl_${comp_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_opengl"
|
2025-02-14 16:17:18 +01:00
|
|
|
--gpu-backend opengl
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endforeach()
|
|
|
|
|
add_blender_test(
|
|
|
|
|
compositor_opengl_file_output
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/compositor_file_output_tests.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/file_output/"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_opengl/file_output"
|
|
|
|
|
--gpu-backend opengl
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
if(WITH_METAL_BACKEND)
|
|
|
|
|
foreach(comp_test ${compositor_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
compositor_metal_${comp_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_metal"
|
2025-02-14 16:17:18 +01:00
|
|
|
--gpu-backend metal
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endforeach()
|
|
|
|
|
add_blender_test(
|
|
|
|
|
compositor_metal_file_output
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/compositor_file_output_tests.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/file_output/"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_metal/file_output"
|
|
|
|
|
--gpu-backend metal
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
if(WITH_VULKAN_BACKEND)
|
|
|
|
|
foreach(comp_test ${compositor_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
compositor_vulkan_${comp_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_vulkan"
|
2025-02-14 16:17:18 +01:00
|
|
|
--gpu-backend vulkan
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endforeach()
|
|
|
|
|
add_blender_test(
|
|
|
|
|
compositor_vulkan_file_output
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/compositor_file_output_tests.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/compositor/file_output/"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/compositor_vulkan/file_output"
|
|
|
|
|
--gpu-backend vulkan
|
|
|
|
|
)
|
2023-01-19 17:07:23 +11:00
|
|
|
endif()
|
2021-03-26 16:04:09 +01:00
|
|
|
endif()
|
|
|
|
|
|
2025-07-30 13:18:47 +02:00
|
|
|
add_blender_test(
|
|
|
|
|
compositing_node_group
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/compositing_node_group.py
|
|
|
|
|
)
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# GEOMETRY NODE TESTS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
2021-07-27 21:00:28 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
set(geo_node_tests
|
|
|
|
|
attributes
|
2025-04-13 13:55:23 +02:00
|
|
|
closure
|
2025-04-06 13:52:15 +02:00
|
|
|
curve_primitives
|
|
|
|
|
curves
|
|
|
|
|
curves/interpolate_curves
|
|
|
|
|
foreach_geometry_element_zone
|
|
|
|
|
geometry
|
|
|
|
|
grease_pencil
|
2025-05-10 07:24:33 +02:00
|
|
|
import
|
2025-04-06 13:52:15 +02:00
|
|
|
instance
|
2025-07-24 16:16:40 +02:00
|
|
|
list
|
2025-04-06 13:52:15 +02:00
|
|
|
repeat_zone
|
|
|
|
|
mesh_primitives
|
|
|
|
|
mesh
|
|
|
|
|
mesh/extrude
|
|
|
|
|
mesh/split_edges
|
|
|
|
|
mesh/triangulate
|
|
|
|
|
points
|
|
|
|
|
texture
|
|
|
|
|
utilities
|
|
|
|
|
vector
|
|
|
|
|
)
|
2021-09-29 21:12:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_GMP)
|
|
|
|
|
list(APPEND geo_node_tests mesh/boolean)
|
|
|
|
|
endif()
|
2021-09-29 21:12:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_OPENVDB)
|
|
|
|
|
list(APPEND geo_node_tests volume)
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
if(WITH_OPENSUBDIV)
|
|
|
|
|
list(APPEND geo_node_tests mesh/subdivision_tests)
|
|
|
|
|
endif()
|
2021-09-29 21:12:55 +05:30
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
foreach(geo_node_test ${geo_node_tests})
|
2021-07-27 21:00:28 +05:30
|
|
|
file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/${geo_node_test}/*.blend")
|
|
|
|
|
foreach(file ${files})
|
|
|
|
|
get_filename_component(filename ${file} NAME_WE)
|
|
|
|
|
add_blender_test(
|
2024-01-03 18:35:50 +01:00
|
|
|
geo_node_${geo_node_test}_${filename}
|
2021-07-27 21:00:28 +05:30
|
|
|
${file}
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/geo_node_test.py
|
|
|
|
|
)
|
2025-01-03 13:23:38 +11:00
|
|
|
endforeach()
|
2025-04-06 13:52:15 +02:00
|
|
|
endforeach()
|
2023-06-16 10:00:55 +02:00
|
|
|
|
|
|
|
|
file(GLOB files "${TEST_SRC_DIR}/modeling/geometry_nodes/simulation/*.blend")
|
|
|
|
|
foreach(file ${files})
|
|
|
|
|
get_filename_component(filename ${file} NAME_WE)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
geo_node_simulation_test_${filename}
|
|
|
|
|
${file}
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/geo_node_sim_test.py
|
2023-11-04 16:41:18 +11:00
|
|
|
)
|
2023-06-16 10:00:55 +02:00
|
|
|
endforeach()
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# SCREENSHOT TESTS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
2025-01-30 18:44:23 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_GPU_RENDER_TESTS AND TEST_SRC_DIR_EXISTS)
|
|
|
|
|
set(render_tests
|
|
|
|
|
)
|
2025-01-30 18:44:23 +01:00
|
|
|
|
2025-04-24 06:11:30 +02:00
|
|
|
if(WITH_TESTS_EXPERIMENTAL)
|
2025-04-06 13:52:15 +02:00
|
|
|
# The viewport tests are flakey and difficult to keep up to date for use
|
|
|
|
|
# in a CI environment due to constantly changing UI, but may still be helpful
|
|
|
|
|
# for local development.
|
|
|
|
|
#
|
|
|
|
|
# Additionally, they do not currently succeed in an ASAN build. (2025-01-29)
|
|
|
|
|
list(APPEND render_tests viewport)
|
2018-02-14 20:33:33 +01:00
|
|
|
endif()
|
2025-04-06 13:52:15 +02:00
|
|
|
|
|
|
|
|
foreach(render_test ${render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
screenshot_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ui_screenshot_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/screenshot/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/screenshot"
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
2018-02-14 20:33:33 +01:00
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# I/O TESTS
|
|
|
|
|
# ------------------------------------------------------------------------------
|
2018-02-14 20:33:33 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_ALEMBIC AND TEST_SRC_DIR_EXISTS)
|
2017-04-21 16:20:01 +02:00
|
|
|
find_package_wrapper(Alembic)
|
|
|
|
|
if(NOT ALEMBIC_FOUND)
|
|
|
|
|
message(FATAL_ERROR "Alembic is enabled but cannot be found")
|
|
|
|
|
endif()
|
|
|
|
|
get_filename_component(real_include_dir ${ALEMBIC_INCLUDE_DIR} REALPATH)
|
|
|
|
|
get_filename_component(ALEMBIC_ROOT_DIR ${real_include_dir} DIRECTORY)
|
2019-04-17 06:35:54 +02:00
|
|
|
|
2018-02-16 01:22:34 +01:00
|
|
|
add_python_test(
|
2024-01-03 18:35:50 +01:00
|
|
|
io_alembic_export_tests
|
2020-08-17 12:55:23 +02:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/alembic_export_tests.py
|
2019-09-07 14:03:39 +02:00
|
|
|
--blender "${TEST_BLENDER_EXE}"
|
2018-02-16 01:22:34 +01:00
|
|
|
--testdir "${TEST_SRC_DIR}/alembic"
|
|
|
|
|
--alembic-root "${ALEMBIC_ROOT_DIR}"
|
|
|
|
|
)
|
2019-04-17 06:35:54 +02:00
|
|
|
|
2019-08-02 14:25:40 +02:00
|
|
|
add_blender_test(
|
2020-02-14 15:14:46 +01:00
|
|
|
script_alembic_io
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_io_test.py
|
2017-06-04 17:05:59 -06:00
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/alembic"
|
2025-10-07 05:46:34 +02:00
|
|
|
--outdir "${TEST_OUT_DIR}/io_alembic"
|
2017-08-04 08:11:42 +10:00
|
|
|
)
|
2017-04-14 12:54:20 +02:00
|
|
|
endif()
|
2017-04-18 14:18:06 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_USD AND TEST_SRC_DIR_EXISTS)
|
2023-02-14 12:11:53 +01:00
|
|
|
add_blender_test(
|
2024-01-03 18:35:50 +01:00
|
|
|
io_usd_export
|
2023-11-04 16:41:18 +11:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_usd_export_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/usd"
|
2023-02-14 12:11:53 +01:00
|
|
|
)
|
2021-10-20 12:07:28 -04:00
|
|
|
add_blender_test(
|
2024-01-03 18:35:50 +01:00
|
|
|
io_usd_import
|
2021-10-20 12:07:28 -04:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_usd_import_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/usd"
|
2025-04-25 19:57:12 +02:00
|
|
|
--outdir "${TEST_OUT_DIR}/io_usd"
|
2021-10-20 12:07:28 -04:00
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
2025-08-01 17:24:37 +02:00
|
|
|
add_blender_test_allow_error(
|
2025-04-06 13:52:15 +02:00
|
|
|
io_fbx_import
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/io_fbx_import_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests/fbx"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/io_fbx"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.
- There's a tests/python/modules/io_report.py that can produce
a "fairly short text description of the scene" (meshes, objects,
curves, cameras, lights, materials, armatures, actions, images).
About each object, it lists some basic information (e.g. number
of vertices in the mesh), plus a small slice of "data" (e.g.
first few values of each mesh attribute).
- Custom import parameters, if needed, can be provided by
having a sidecar .json file next to imported file (same
basename, json extension), that would have a single json
object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
covering various possible cases (meshes, animations, materials,
hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
testing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_IO_WAVEFRONT_OBJ AND TEST_SRC_DIR_EXISTS)
|
2025-08-01 17:24:37 +02:00
|
|
|
add_blender_test_allow_error(
|
Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.
- There's a tests/python/modules/io_report.py that can produce
a "fairly short text description of the scene" (meshes, objects,
curves, cameras, lights, materials, armatures, actions, images).
About each object, it lists some basic information (e.g. number
of vertices in the mesh), plus a small slice of "data" (e.g.
first few values of each mesh attribute).
- Custom import parameters, if needed, can be provided by
having a sidecar .json file next to imported file (same
basename, json extension), that would have a single json
object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
covering various possible cases (meshes, animations, materials,
hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
testing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
|
|
|
io_obj_import
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/io_obj_import_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests/obj"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/io_obj"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_IO_PLY AND TEST_SRC_DIR_EXISTS)
|
2025-08-01 17:24:37 +02:00
|
|
|
add_blender_test_allow_error(
|
Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.
- There's a tests/python/modules/io_report.py that can produce
a "fairly short text description of the scene" (meshes, objects,
curves, cameras, lights, materials, armatures, actions, images).
About each object, it lists some basic information (e.g. number
of vertices in the mesh), plus a small slice of "data" (e.g.
first few values of each mesh attribute).
- Custom import parameters, if needed, can be provided by
having a sidecar .json file next to imported file (same
basename, json extension), that would have a single json
object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
covering various possible cases (meshes, animations, materials,
hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
testing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
|
|
|
io_ply_import
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/io_ply_import_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests/ply"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/io_ply"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_IO_STL AND TEST_SRC_DIR_EXISTS)
|
2025-08-01 17:24:37 +02:00
|
|
|
add_blender_test_allow_error(
|
Tests: Add FBX import tests, switch OBJ/PLY/STL import tests to the same machinery
"Expected textual data output" comparison based tests for FBX,
OBJ, PLY, STL import.
- There's a tests/python/modules/io_report.py that can produce
a "fairly short text description of the scene" (meshes, objects,
curves, cameras, lights, materials, armatures, actions, images).
About each object, it lists some basic information (e.g. number
of vertices in the mesh), plus a small slice of "data" (e.g.
first few values of each mesh attribute).
- Custom import parameters, if needed, can be provided by
having a sidecar .json file next to imported file (same
basename, json extension), that would have a single json
object with custom arguments.
- Add FBX test coverage, with 46 fairly small files (total size 3.8MB)
covering various possible cases (meshes, animations, materials,
hierarchies, cameras, etc. etc.).
- Switch OBJ/PLY/STL import tests to the above machinery, remove C++
testing code.
Pull Request: https://projects.blender.org/blender/blender/pulls/132624
2025-01-15 05:52:15 +01:00
|
|
|
io_stl_import
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/io_stl_import_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/io_tests/stl"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/io_stl"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_CODEC_FFMPEG AND TEST_SRC_DIR_EXISTS)
|
2018-03-05 15:32:49 +01:00
|
|
|
add_python_test(
|
2019-03-15 19:11:33 +01:00
|
|
|
ffmpeg
|
2018-03-05 15:32:49 +01:00
|
|
|
${CMAKE_CURRENT_LIST_DIR}/ffmpeg_tests.py
|
2019-09-07 14:03:39 +02:00
|
|
|
--blender "${TEST_BLENDER_EXE}"
|
2019-07-01 17:18:43 +02:00
|
|
|
--testdir "${TEST_SRC_DIR}/ffmpeg"
|
2018-03-05 15:32:49 +01:00
|
|
|
)
|
|
|
|
|
endif()
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS AND TEST_OPENIMAGEIO_TOOL_EXISTS)
|
2023-08-17 13:15:56 +10:00
|
|
|
set(OPTIONAL_FORMATS "")
|
2023-02-20 19:04:34 -08:00
|
|
|
if(WITH_IMAGE_CINEON)
|
|
|
|
|
set(OPTIONAL_FORMATS "${OPTIONAL_FORMATS} CINEON")
|
|
|
|
|
endif()
|
|
|
|
|
if(WITH_IMAGE_OPENEXR)
|
|
|
|
|
set(OPTIONAL_FORMATS "${OPTIONAL_FORMATS} OPENEXR")
|
|
|
|
|
endif()
|
|
|
|
|
if(WITH_IMAGE_OPENJPEG)
|
|
|
|
|
set(OPTIONAL_FORMATS "${OPTIONAL_FORMATS} OPENJPEG")
|
|
|
|
|
endif()
|
|
|
|
|
if(WITH_IMAGE_WEBP)
|
|
|
|
|
set(OPTIONAL_FORMATS "${OPTIONAL_FORMATS} WEBP")
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_blender_test(
|
2024-01-03 18:35:50 +01:00
|
|
|
imbuf_save
|
2023-02-20 19:04:34 -08:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_imbuf_save.py
|
|
|
|
|
--
|
|
|
|
|
-test_dir "${TEST_SRC_DIR}/imbuf_io"
|
|
|
|
|
-output_dir "${TEST_OUT_DIR}/imbuf_io/save"
|
2024-01-25 10:04:16 +01:00
|
|
|
-oiiotool "${OPENIMAGEIO_TOOL}"
|
2023-02-20 19:04:34 -08:00
|
|
|
-optional_formats "${OPTIONAL_FORMATS}"
|
|
|
|
|
)
|
|
|
|
|
|
2025-08-01 17:24:37 +02:00
|
|
|
add_blender_test_allow_error(
|
2024-01-03 18:35:50 +01:00
|
|
|
imbuf_load
|
2023-02-20 19:04:34 -08:00
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_imbuf_load.py
|
|
|
|
|
--
|
|
|
|
|
-test_dir "${TEST_SRC_DIR}/imbuf_io"
|
|
|
|
|
-output_dir "${TEST_OUT_DIR}/imbuf_io/load"
|
2024-01-25 10:04:16 +01:00
|
|
|
-oiiotool "${OPENIMAGEIO_TOOL}"
|
2023-02-20 19:04:34 -08:00
|
|
|
-optional_formats "${OPTIONAL_FORMATS}"
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2020-11-01 21:33:38 +01:00
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# SEQUENCER RENDER TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2020-11-01 21:33:38 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
2020-11-01 21:33:38 +01:00
|
|
|
set(render_tests
|
2024-02-13 13:20:24 +01:00
|
|
|
effects
|
2024-01-28 20:26:44 +01:00
|
|
|
filter
|
2024-02-13 13:20:24 +01:00
|
|
|
transform
|
2024-09-20 12:56:57 +02:00
|
|
|
blend_modes_byte
|
|
|
|
|
blend_modes_float
|
2024-11-13 14:59:38 +02:00
|
|
|
ffmpeg
|
2020-11-01 21:33:38 +01:00
|
|
|
)
|
|
|
|
|
|
Video: HDR video input/output support
HDR video files are properly read into Blender, and can be rendered out
of Blender.
HDR video reading / decoding:
- Two flavors of HDR are recognized, based on color related video
metadata: "PQ" (Rec.2100 Perceptual Quantizer, aka SMPTE 2084) and
"HLG" (Rec.2100 Hybrid-Log-Gamma, aka ARIB STD B67). Both are read
effectively into floating point images, and their color space
transformations are done through OpenColorIO.
- The OCIO config shipped in Blender has been extended to contain
Rec.2100-PQ and Rec.2100-HLG color spaces.
- Note that if you already had a HDR video in sequencer or movie clip,
it would have looked "incorrect" previously, and it will continue to
look incorrect, since it already has "wrong" color space assigned to
it. Either re-add it (which should assign the correct color space),
or manually change the color space to PQ or HLG one as needed.
HDR video writing / encoding"
- For H.265 and AV1 the video encoding options now display the HDR mode.
Similar to reading, there are PQ and HLG HDR mode options.
- Reference white is assumed to be 100 nits.
- YUV uses "full" ("PC/jpeg") color range.
- No mastering display metadata is written into the video file, since
generally that information is not known inside Blender.
More details and screenshots in the PR.
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120033
2025-07-21 19:26:07 +02:00
|
|
|
set(video_output_tests
|
|
|
|
|
video_output
|
|
|
|
|
)
|
|
|
|
|
|
2020-11-01 21:33:38 +01:00
|
|
|
foreach(render_test ${render_tests})
|
2023-11-08 18:41:33 +01:00
|
|
|
add_render_test(
|
2020-11-01 21:33:38 +01:00
|
|
|
sequencer_render_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sequencer_render_tests.py
|
2024-12-10 14:52:34 +01:00
|
|
|
--testdir "${TEST_SRC_DIR}/sequence_editing/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/sequence_editing"
|
2020-11-01 21:33:38 +01:00
|
|
|
)
|
|
|
|
|
endforeach()
|
Video: HDR video input/output support
HDR video files are properly read into Blender, and can be rendered out
of Blender.
HDR video reading / decoding:
- Two flavors of HDR are recognized, based on color related video
metadata: "PQ" (Rec.2100 Perceptual Quantizer, aka SMPTE 2084) and
"HLG" (Rec.2100 Hybrid-Log-Gamma, aka ARIB STD B67). Both are read
effectively into floating point images, and their color space
transformations are done through OpenColorIO.
- The OCIO config shipped in Blender has been extended to contain
Rec.2100-PQ and Rec.2100-HLG color spaces.
- Note that if you already had a HDR video in sequencer or movie clip,
it would have looked "incorrect" previously, and it will continue to
look incorrect, since it already has "wrong" color space assigned to
it. Either re-add it (which should assign the correct color space),
or manually change the color space to PQ or HLG one as needed.
HDR video writing / encoding"
- For H.265 and AV1 the video encoding options now display the HDR mode.
Similar to reading, there are PQ and HLG HDR mode options.
- Reference white is assumed to be 100 nits.
- YUV uses "full" ("PC/jpeg") color range.
- No mastering display metadata is written into the video file, since
generally that information is not known inside Blender.
More details and screenshots in the PR.
Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/120033
2025-07-21 19:26:07 +02:00
|
|
|
|
|
|
|
|
foreach(video_output_test ${video_output_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
sequencer_render_${video_output_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sequencer_video_output_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sequence_editing/${video_output_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/sequence_editing"
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
sequencer_input_colorspace
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/sequencer_input_colorspace.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sequence_editing"
|
|
|
|
|
)
|
2025-07-24 20:37:16 +02:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
sequencer_load_meta_stack
|
|
|
|
|
${TEST_SRC_DIR}/sequence_editing/vse_load_meta_stack.blend
|
|
|
|
|
--python ${TEST_PYTHON_DIR}/sequencer_load_meta_stack.py
|
|
|
|
|
)
|
2020-11-01 21:33:38 +01:00
|
|
|
endif()
|
|
|
|
|
|
2025-02-14 07:36:00 +01:00
|
|
|
# ------------------------------------------------------------------------------
|
2025-02-26 01:28:24 +01:00
|
|
|
# SCULPTING TESTS
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2025-02-26 01:28:24 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
add_blender_test(
|
|
|
|
|
bl_sculpt_operators
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/bl_sculpt.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sculpting"
|
|
|
|
|
)
|
2025-06-12 06:26:05 +02:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
bl_sculpt_brush_curve_presets
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/sculpt_paint/brush_strength_curves_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sculpting"
|
|
|
|
|
)
|
2025-06-23 19:22:33 +02:00
|
|
|
|
|
|
|
|
add_blender_test(
|
|
|
|
|
bl_sculpt_mask_filter
|
|
|
|
|
--python ${CMAKE_CURRENT_LIST_DIR}/sculpt_paint/mask_filter_test.py
|
|
|
|
|
--
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sculpting"
|
|
|
|
|
)
|
2025-04-06 13:52:15 +02:00
|
|
|
endif()
|
2025-02-14 07:36:00 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(WITH_GPU_MESH_PAINT_TESTS AND TEST_SRC_DIR_EXISTS)
|
|
|
|
|
set(render_tests
|
|
|
|
|
brushes
|
|
|
|
|
)
|
2025-02-14 07:36:00 +01:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
foreach(render_test ${render_tests})
|
|
|
|
|
add_render_test(
|
|
|
|
|
sculpt_render_${render_test}
|
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/sculpt_brush_render_tests.py
|
|
|
|
|
--testdir "${TEST_SRC_DIR}/sculpting/${render_test}"
|
|
|
|
|
--outdir "${TEST_OUT_DIR}/sculpting"
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
2025-02-14 07:36:00 +01:00
|
|
|
endif()
|
|
|
|
|
|
2020-11-01 21:33:38 +01:00
|
|
|
|
2023-10-26 15:19:33 +11:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# Headless GUI Tests
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2023-10-26 15:19:33 +11:00
|
|
|
|
|
|
|
|
if(WITH_UI_TESTS)
|
|
|
|
|
# This could be generated with:
|
2023-11-07 14:50:22 +11:00
|
|
|
# `"${TEST_PYTHON_EXE}" "${CMAKE_CURRENT_LIST_DIR}/ui_simulate/run.py" --list-tests`
|
2023-10-26 15:19:33 +11:00
|
|
|
# list explicitly so changes bisecting/updated are sure to re-run CMake.
|
2025-06-12 20:27:38 +02:00
|
|
|
set(_ui_tests
|
2025-07-15 02:09:48 +02:00
|
|
|
test_sculpt.asset_shelf_brush_selection
|
2025-09-16 16:15:47 +02:00
|
|
|
test_tools.sculpt_mode_toolbar
|
2025-07-24 11:41:46 +02:00
|
|
|
test_undo.compositor_make_group
|
2023-10-26 15:19:33 +11:00
|
|
|
test_undo.text_editor_edit_mode_mix
|
|
|
|
|
test_undo.text_editor_simple
|
|
|
|
|
test_undo.view3d_edit_mode_multi_window
|
|
|
|
|
test_undo.view3d_font_edit_mode_simple
|
|
|
|
|
test_undo.view3d_mesh_edit_separate
|
|
|
|
|
test_undo.view3d_mesh_particle_edit_mode_simple
|
|
|
|
|
test_undo.view3d_multi_mode_multi_window
|
|
|
|
|
test_undo.view3d_multi_mode_select
|
|
|
|
|
test_undo.view3d_sculpt_dyntopo_and_edit
|
|
|
|
|
test_undo.view3d_sculpt_dyntopo_simple
|
2025-05-27 17:44:28 +02:00
|
|
|
test_undo.view3d_sculpt_dyntopo_stroke_toggle
|
2023-10-26 15:19:33 +11:00
|
|
|
test_undo.view3d_sculpt_with_memfile_step
|
2025-05-22 05:48:07 +02:00
|
|
|
test_undo.view3d_sculpt_trim
|
2023-10-26 15:19:33 +11:00
|
|
|
test_undo.view3d_simple
|
|
|
|
|
test_undo.view3d_texture_paint_complex
|
|
|
|
|
test_undo.view3d_texture_paint_simple
|
2025-08-12 00:56:45 +02:00
|
|
|
test_workspace.sanity_check_general
|
|
|
|
|
test_workspace.sanity_check_2d_animation
|
|
|
|
|
test_workspace.sanity_check_sculpting
|
2025-09-25 11:57:14 +02:00
|
|
|
test_workspace.sanity_check_storyboarding
|
2025-08-12 00:56:45 +02:00
|
|
|
test_workspace.sanity_check_vfx
|
|
|
|
|
test_workspace.sanity_check_video_editing
|
2023-10-26 15:19:33 +11:00
|
|
|
)
|
2025-06-12 20:27:38 +02:00
|
|
|
foreach(ui_test ${_ui_tests})
|
2025-03-14 22:27:50 +01:00
|
|
|
add_blender_test_ui(
|
2024-01-03 18:35:50 +01:00
|
|
|
"ui_${ui_test}"
|
2023-10-26 15:19:33 +11:00
|
|
|
--enable-event-simulate
|
2023-11-07 14:50:22 +11:00
|
|
|
--python "${CMAKE_CURRENT_LIST_DIR}/ui_simulate/run_blender_setup.py"
|
2023-10-26 15:19:33 +11:00
|
|
|
--
|
|
|
|
|
--tests "${ui_test}"
|
|
|
|
|
)
|
|
|
|
|
endforeach()
|
2025-06-12 20:27:38 +02:00
|
|
|
unset(_ui_tests)
|
2023-10-26 15:19:33 +11:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# VIEW LAYER Tests
|
|
|
|
|
# ------------------------------------------------------------------------------
|
Collections and groups unification
OVERVIEW
* In 2.7 terminology, all layers and groups are now collection datablocks.
* These collections are nestable, linkable, instanceable, overrideable, ..
which opens up new ways to set up scenes and link + override data.
* Viewport/render visibility and selectability are now a part of the collection
and shared across all view layers and linkable.
* View layers define which subset of the scene collection hierarchy is excluded
for each. For many workflows one view layer can be used, these are more of an
advanced feature now.
OUTLINER
* The outliner now has a "View Layer" display mode instead of "Collections",
which can display the collections and/or objects in the view layer.
* In this display mode, collections can be excluded with the right click menu.
These will then be greyed out and their objects will be excluded.
* To view collections not linked to any scene, the "Blender File" display mode
can be used, with the new filtering option to just see Colleciton datablocks.
* The outliner right click menus for collections and objects were reorganized.
* Drag and drop still needs to be improved. Like before, dragging the icon or
text gives different results, we'll unify this later.
LINKING AND OVERRIDES
* Collections can now be linked into the scene without creating an instance,
with the link/append operator or from the collections view in the outliner.
* Collections can get static overrides with the right click menu in the outliner,
but this is rather unreliable and not clearly communicated at the moment.
* We still need to improve the make override operator to turn collection instances
into collections with overrides directly in the scene.
PERFORMANCE
* We tried to make performance not worse than before and improve it in some
cases. The main thing that's still a bit slower is multiple scenes, we have to
change the layer syncing to only updated affected scenes.
* Collections keep a list of their parent collections for faster incremental
updates in syncing and caching.
* View layer bases are now in a object -> base hash to avoid quadratic time
lookups internally and in API functions like visible_get().
VERSIONING
* Compatibility with 2.7 files should be improved due to the new visibility
controls. Of course users may not want to set up their scenes differently
now to avoid having separate layers and groups.
* Compatibility with 2.8 is mostly there, and was tested on Eevee demo and Hero
files. There's a few things which are know to be not quite compatible, like
nested layer collections inside groups.
* The versioning code for 2.8 files is quite complicated, and isolated behind
#ifdef so it can be removed at the end of the release cycle.
KNOWN ISSUES
* The G-key group operators in the 3D viewport were left mostly as is, they
need to be modified still to fit better.
* Same for the groups panel in the object properties. This needs to be updated
still, or perhaps replaced by something better.
* Collections must all have a unique name. Less restrictive namespacing is to
be done later, we'll have to see how important this is as all objects within
the collections must also have a unique name anyway.
* Full scene copy and delete scene are exactly doing the right thing yet.
Differential Revision: https://developer.blender.org/D3383
https://code.blender.org/2018/05/collections-and-groups/
2018-04-30 15:57:22 +02:00
|
|
|
|
2025-04-06 13:52:15 +02:00
|
|
|
if(TEST_SRC_DIR_EXISTS)
|
|
|
|
|
# TODO: disabled for now after collection unification
|
|
|
|
|
# add_subdirectory(view_layer)
|
|
|
|
|
endif()
|
2024-11-15 18:12:52 +01:00
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------------
|
|
|
|
|
# Linux Release sainty checks
|
2025-04-06 13:52:15 +02:00
|
|
|
# ------------------------------------------------------------------------------
|
2024-11-15 18:12:52 +01:00
|
|
|
|
|
|
|
|
if(WITH_LINUX_OFFICIAL_RELEASE_TESTS)
|
2024-11-18 12:32:17 +01:00
|
|
|
get_filename_component(release_root_folder ${TEST_BLENDER_EXE} DIRECTORY)
|
2025-01-20 15:27:32 +01:00
|
|
|
set(extra_args "")
|
|
|
|
|
if(WITH_COMPILER_ASAN)
|
|
|
|
|
set(extra_args
|
|
|
|
|
${extra_args}
|
|
|
|
|
--sanitizer-build
|
|
|
|
|
)
|
|
|
|
|
endif()
|
2024-11-15 18:12:52 +01:00
|
|
|
add_python_test(
|
|
|
|
|
linux_release_sanity_checks
|
|
|
|
|
${CMAKE_SOURCE_DIR}/tools/check_blender_release/check_release.py
|
2025-01-20 15:27:32 +01:00
|
|
|
-- --directory "${release_root_folder}" ${extra_args}
|
2024-11-15 18:12:52 +01:00
|
|
|
)
|
2025-01-20 15:27:32 +01:00
|
|
|
unset(extra_args)
|
2024-11-15 18:12:52 +01:00
|
|
|
unset(release_root_folder)
|
|
|
|
|
endif()
|