Files
test2/tests/python/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

1463 lines
40 KiB
CMake
Raw Normal View History

# SPDX-FileCopyrightText: 2011-2023 Blender Authors
#
# SPDX-License-Identifier: GPL-2.0-or-later
# Use '--write-blend=/tmp/test.blend' to view output
set(TEST_SRC_DIR ${CMAKE_SOURCE_DIR}/tests/files)
set(TEST_PYTHON_DIR ${CMAKE_SOURCE_DIR}/tests/python)
set(TEST_OUT_DIR ${CMAKE_BINARY_DIR}/tests)
# ugh, any better way to do this on testing only?
file(MAKE_DIRECTORY ${TEST_OUT_DIR})
file(MAKE_DIRECTORY ${TEST_OUT_DIR}/io_tests)
file(MAKE_DIRECTORY ${TEST_OUT_DIR}/blendfile_io)
# 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()
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."
)
set(WITH_SYSTEM_PYTHON_TESTS OFF)
endif()
endif()
# Run Blender command with parameters.
function(add_blender_test_impl testname envvars_list exe)
add_test(
NAME ${testname}
COMMAND ${exe} ${ARGN}
)
blender_test_set_envvars("${testname}" "${envvars_list}")
endfunction()
function(add_blender_test testname)
add_blender_test_impl(
"${testname}"
""
"${TEST_BLENDER_EXE}"
${TEST_BLENDER_EXE_PARAMS}
${ARGN}
)
endfunction()
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.
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()
if(WITH_UI_TESTS)
set(_blender_headless_env_vars "BLENDER_BIN=${TEST_BLENDER_EXE}")
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()
list(APPEND _blender_headless_env_vars
"WESTON_BIN=${WESTON_BIN}"
)
if(_weston_bin_in_libdir)
list(APPEND _blender_headless_env_vars
"WAYLAND_ROOT_DIR=${LIBDIR}/wayland"
"WESTON_ROOT_DIR=${LIBDIR}/wayland_weston"
)
endif()
endif()
else()
list(APPEND _blender_headless_env_vars
"PASS_THROUGH=1"
)
endif()
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()
endif()
# Run Python script outside Blender.
function(add_python_test testname testscript)
if(NOT TEST_PYTHON_EXE)
message(FATAL_ERROR "No Python configured for running tests, set TEST_PYTHON_EXE.")
endif()
add_test(
NAME ${testname}
COMMAND ${TEST_PYTHON_EXE} ${TEST_PYTHON_EXE_EXTRA_ARGS} ${testscript} ${ARGN}
WORKING_DIRECTORY $<TARGET_FILE_DIR:blender>
)
blender_test_set_envvars("${testname}" "")
endfunction()
# Run Python render test.
function(add_render_test testname testscript)
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})
endif()
endfunction()
# 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
# ------------------------------------------------------------------------------
add_system_python_test(
script_validate_on_system_python
${CMAKE_CURRENT_LIST_DIR}/system_python/load_tool_scripts.py
--root-dir ${CMAKE_SOURCE_DIR}
)
# ------------------------------------------------------------------------------
# GENERAL PYTHON CORRECTNESS TESTS
# ------------------------------------------------------------------------------
add_blender_test(
script_load_keymap
--python ${CMAKE_CURRENT_LIST_DIR}/bl_keymap_completeness.py
)
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.
)
add_blender_test(
script_load_addons
--python ${CMAKE_CURRENT_LIST_DIR}/bl_load_addons.py
)
add_blender_test(
script_load_modules
--python ${CMAKE_CURRENT_LIST_DIR}/bl_load_py_modules.py
)
add_blender_test(
script_bundled_modules
--python ${CMAKE_CURRENT_LIST_DIR}/bl_bundled_modules.py -- --inside-blender
)
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
)
# test running operators doesn't segfault under various conditions
if(WITH_TESTS_EXPERIMENTAL)
add_blender_test(
script_run_operators
--python ${CMAKE_CURRENT_LIST_DIR}/bl_run_operators.py
)
endif()
2015-09-24 20:49:44 +10:00
# ------------------------------------------------------------------------------
# PY API TESTS
# ------------------------------------------------------------------------------
add_blender_test(
script_pyapi_bpy_app_tempdir
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_app_tempdir.py
)
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
)
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
)
add_blender_test(
script_pyapi_mathutils
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_mathutils.py
)
add_blender_test(
script_pyapi_bpy_driver_secure_eval
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bpy_driver_secure_eval.py
)
add_blender_test(
script_pyapi_idprop
2017-03-19 03:37:22 +11:00
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_idprop.py
)
add_blender_test(
script_pyapi_idprop_datablock
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_idprop_datablock.py
)
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
)
add_blender_test(
script_pyapi_text
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_text.py
)
add_blender_test(
script_pyapi_bmesh
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_bmesh.py
)
add_blender_test(
script_pyapi_grease_pencil
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pyapi_grease_pencil.py
)
# ------------------------------------------------------------------------------
# DATA MANAGEMENT TESTS
# ------------------------------------------------------------------------------
add_blender_test(
id_management
--python ${CMAKE_CURRENT_LIST_DIR}/bl_id_management.py
)
add_blender_test(
bl_rna_paths
--python ${CMAKE_CURRENT_LIST_DIR}/bl_rna_paths.py
)
add_blender_test(
bl_rna_accessors
--python ${CMAKE_CURRENT_LIST_DIR}/bl_rna_accessors.py
)
# ------------------------------------------------------------------------------
# BLEND IO & LINKING
# ------------------------------------------------------------------------------
add_blender_test(
blendfile_io
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_io.py --
--output-dir ${TEST_OUT_DIR}/blendfile_io/
)
# 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.
if(TEST_SRC_DIR_EXISTS)
set(BLENDFILE_VERSIONING_SPLIT_RANGE 128)
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}/
--output-dir ${TEST_OUT_DIR}/blendfile_io/
--slice-range ${BLENDFILE_VERSIONING_SPLIT_RANGE}
--slice-index ${idx}
)
endforeach()
add_blender_test(
blendfile_liblink
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_liblink.py --
--src-test-dir ${TEST_SRC_DIR}/
--output-dir ${TEST_OUT_DIR}/blendfile_io/
)
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/
)
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"
)
add_blender_test(
blendfile_header
--python ${CMAKE_CURRENT_LIST_DIR}/bl_blendfile_header.py --
--testdir "${TEST_SRC_DIR}/io_tests/blend_parsing"
)
endif()
# ------------------------------------------------------------------------------
# MODELING TESTS
# ------------------------------------------------------------------------------
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
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
add_blender_test(
bmesh_split_faces
${TEST_SRC_DIR}/modeling/split_faces_test.blend
--python-text run_tests
)
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
)
add_blender_test(
curves_extrude
${TEST_SRC_DIR}/modeling/curves_extrude.blend
--python ${TEST_PYTHON_DIR}/curves_extrude.py
--
--run-all-tests
)
Tests: Add object conversion tests Adding object conversion tests to verify the refactored object type conversion code works as intended. The object conversion operator `exec()` function is restructured by PR #130668 to clean up code path for better readability, since it's a relatively big change, this test is put up to verify that: - For supported object type pairs, converted objects would have the expected target object type. - For unsupported/unimplemented type pairs, the test expect the converted object to have the same type as the source object. - Verify that the code behaviour stays exactly the same as prior to the change in #130668, including code logic that are later subject to change and redesign, in which case this test file/script would need to be updated accrodingly. This test added such files: - `tests/data/modelling/object_conversion.blend`: Sets up differnt types of input objects and their expected converted object combinations. - `tests/python/object_conversion.py`: Does mesh equal checks for objects that are converted to mesh against expected objects in the blend file, and does object type checks for other target types. Note: This test currently does not do topology-level equal check except for when target object type is `MESH`. Equal check hasn't been implemented for other object types yet, but ideally in the future we should use topology check on top of type check for other object types as well. See https://projects.blender.org/blender/blender/pulls/130668 Pull Request: https://projects.blender.org/blender/blender/pulls/130738
2024-12-02 16:30:41 +01:00
add_blender_test(
mesh_join
--python ${TEST_PYTHON_DIR}/mesh_join.py
)
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()
add_blender_test(
geometry_attributes
--python ${CMAKE_CURRENT_LIST_DIR}/bl_geometry_attributes.py
)
add_blender_test(
geonode_file_reporting
--python ${CMAKE_CURRENT_LIST_DIR}/bl_geonode_file_reporting.py
--
--testdir "${TEST_SRC_DIR}/io_tests"
)
# ------------------------------------------------------------------------------
# MODIFIERS TESTS
# ------------------------------------------------------------------------------
if(TEST_SRC_DIR_EXISTS)
add_blender_test(
object_modifier_array
${TEST_SRC_DIR}/modifier_stack/array_test.blend
--python-text run_tests.py
)
add_blender_test(
modifiers
${TEST_SRC_DIR}/modeling/modifiers.blend
--python ${TEST_PYTHON_DIR}/modifiers.py
--
--run-all-tests
)
add_blender_test(
physics_cloth
${TEST_SRC_DIR}/physics/cloth_test.blend
--python ${TEST_PYTHON_DIR}/physics_cloth.py
--
--run-all-tests
)
add_blender_test(
physics_softbody
${TEST_SRC_DIR}/physics/softbody_test.blend
--python ${TEST_PYTHON_DIR}/physics_softbody.py
--
--run-all-tests
)
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
)
add_blender_test(
deform_modifiers
${TEST_SRC_DIR}/modeling/deform_modifiers.blend
--python ${TEST_PYTHON_DIR}/deform_modifiers.py
--
--run-all-tests
)
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()
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
)
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
)
add_blender_test(
constraints
--python ${CMAKE_CURRENT_LIST_DIR}/bl_constraints.py
--
--testdir "${TEST_SRC_DIR}/constraints"
)
add_blender_test(
multires
--python ${TEST_PYTHON_DIR}/bl_multires.py
--
--testdir "${TEST_SRC_DIR}/sculpting"
)
endif()
# ------------------------------------------------------------------------------
# OPERATORS TESTS
# ------------------------------------------------------------------------------
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()
# ------------------------------------------------------------------------------
# ANIMATION TESTS
# ------------------------------------------------------------------------------
add_blender_test(
bl_animation_armature
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_armature.py
)
add_blender_test(
bl_animation_bake
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_bake.py
)
add_blender_test(
bl_animation_nla_strip
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_nla_strip.py
)
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"
)
add_blender_test(
bl_animation_fcurves
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_fcurves.py
--
--testdir "${TEST_SRC_DIR}/animation"
)
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"
)
add_blender_test(
bl_animation_keyframing
--python ${CMAKE_CURRENT_LIST_DIR}/bl_animation_keyframing.py
--
--testdir "${TEST_SRC_DIR}/animation"
)
Anim: create pose assets to different libraries Similar to how brush assets are created and managed this PR allows to export pose assets into a different library. Because of this there is a limitation to this where each asset is stored in a separate blend file. This may be lifted in the future as there are planned changes in the design phase: #122061 ### Create Asset Now available in the 3D viewport in the "Pose" menu: "Create Pose Asset". The button in the Dope Sheet will now call this new operator as well. Clicking either of those will open a popup in which you can: * Choose the name of the asset, which library and catalog it goes into. * Clicking "Create" will create a pose asset on disk in the given library. It is possible to create files into an outside library or add it in the current file. The latter option does a lot less since it basically just creates the action and tags it as an asset. If no Asset Shelf **AND** no Asset Browser is visible anywhere in Blender, the Asset Shelf will be shown on the 3D viewport from which the operator was called. ### Adjust Pose Asset Right clicking a pose asset that has been created in the way described before will have options to overwrite it. Only the active object will be considered for updating a pose asset Available Options (the latter 3 under the "Modify Pose Asset" submenu): * Adjust Pose Asset: From the selected bones, update ONLY channels that are also present in the asset. This is the default. * Replace: Will completely replace the data in the Pose Asset from the current selection * Add: Adds the current selection to the Pose Asset. Any already existing channels have their values updated * Remove: Remove selected bones from the pose asset Currently this refreshes the thumbnail. In the case of custom thumbnails it might not be something want ### Deleting an existing Pose Asset Right click on a Pose Asset and hit "Delete Pose Asset". Works in the shelf and in the asset library. Doing so will pop up a confirmation dialog, if confirming, the asset is gone forever. Deleting a local asset is basically the same as clearing the asset. This is a bit confusing because you get two options that basically do the same thing sometimes, but "Delete" works in other cases as well. I currently don't see a way around that. Part of design #131840 Pull Request: https://projects.blender.org/blender/blender/pulls/132747
2025-02-04 11:29:05 +01:00
add_blender_test(
bl_pose_assets
--python ${CMAKE_CURRENT_LIST_DIR}/bl_pose_assets.py
--
--testdir "${TEST_SRC_DIR}/animation"
)
add_blender_test(
bl_rigging_symmetrize
--python ${CMAKE_CURRENT_LIST_DIR}/bl_rigging_symmetrize.py
--
--testdir "${TEST_SRC_DIR}/animation"
)
add_blender_test(
vertex_group_painting
--python ${CMAKE_CURRENT_LIST_DIR}/vertex_group_painting.py
--
--testdir "${TEST_SRC_DIR}/animation"
)
endif()
# ------------------------------------------------------------------------------
# BRUSH TESTS
add_blender_test(
bl_brush
--python ${CMAKE_CURRENT_LIST_DIR}/bl_brush_test.py
)
Nodes: Panels integration with blend files and UI Part 3/3 of #109135, #110272 Switch to new node group interfaces and deprecate old DNA and API. This completes support for panels in node drawing and in node group interface declarations in particular. The new node group interface DNA and RNA code has been added in parts 1 and 2 (#110885, #110952) but has not be enabled yet. This commit completes the integration by * enabling the new RNA API * using the new API in UI * read/write new interfaces from blend files * add versioning for backward compatibility * add forward-compatible writing code to reconstruct old interfaces All places accessing node group interface declarations should now be using the new API. A runtime cache has been added that allows simple linear access to socket inputs and outputs even when a panel hierarchy is used. Old DNA has been deprecated and should only be accessed for versioning (inputs/outputs renamed to inputs_legacy/outputs_legacy to catch errors). Versioning code ensures both backward and forward compatibility of existing files. The API for old interfaces is removed. The new API is very similar but is defined on the `ntree.interface` instead of the `ntree` directly. Breaking change notifications and detailed instructions for migrating will be added. A python test has been added for the node group API functions. This includes new functionality such as creating panels and moving items between different levels. This patch does not yet contain panel representations in the modifier UI. This has been tested in a separate branch and will be added with a later PR (#108565). Pull Request: https://projects.blender.org/blender/blender/pulls/111348
2023-08-30 12:37:21 +02:00
# ------------------------------------------------------------------------------
# NODE GROUP TESTS
# ------------------------------------------------------------------------------
if(TEST_SRC_DIR_EXISTS)
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"
)
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"
)
add_blender_test(
bl_node_group_compat
--python ${CMAKE_CURRENT_LIST_DIR}/bl_node_group_compat.py
--
--testdir "${TEST_SRC_DIR}/node_group"
)
Nodes: Panels integration with blend files and UI Part 3/3 of #109135, #110272 Switch to new node group interfaces and deprecate old DNA and API. This completes support for panels in node drawing and in node group interface declarations in particular. The new node group interface DNA and RNA code has been added in parts 1 and 2 (#110885, #110952) but has not be enabled yet. This commit completes the integration by * enabling the new RNA API * using the new API in UI * read/write new interfaces from blend files * add versioning for backward compatibility * add forward-compatible writing code to reconstruct old interfaces All places accessing node group interface declarations should now be using the new API. A runtime cache has been added that allows simple linear access to socket inputs and outputs even when a panel hierarchy is used. Old DNA has been deprecated and should only be accessed for versioning (inputs/outputs renamed to inputs_legacy/outputs_legacy to catch errors). Versioning code ensures both backward and forward compatibility of existing files. The API for old interfaces is removed. The new API is very similar but is defined on the `ntree.interface` instead of the `ntree` directly. Breaking change notifications and detailed instructions for migrating will be added. A python test has been added for the node group API functions. This includes new functionality such as creating panels and moving items between different levels. This patch does not yet contain panel representations in the modifier UI. This has been tested in a separate branch and will be added with a later PR (#108565). Pull Request: https://projects.blender.org/blender/blender/pulls/111348
2023-08-30 12:37:21 +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()
# ------------------------------------------------------------------------------
# SVG TESTS
# ------------------------------------------------------------------------------
if(TEST_SRC_DIR_EXISTS)
set(_svg_render_tests complex path)
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"
)
endforeach()
unset(_svg_render_tests)
endif()
# ------------------------------------------------------------------------------
# RENDER TESTS
# ------------------------------------------------------------------------------
if((WITH_CYCLES OR WITH_GPU_RENDER_TESTS) AND TEST_SRC_DIR_EXISTS)
set(render_tests
attributes
camera
Color Management: Add working color space for blend files * Store scene linear to XYZ conversion matrix in each blend file, along with the colorspace name. The matrix is the source of truth. The name is currently only used for error logging about unknown color spaces. * Add Working Space option in color management panel, to change the working space for the entire blend file. Changing this will pop up a dialog, with a default enabled option to convert all colors in the blend file to the new working space. Note this is necessarily only an approximation. * Link and append automatically converts to the color space of the main open blend file. * There is builtin support for Rec.709, Rec.2020 and ACEScg working spaces, in addition to the working space of custom OpenColorIO configs. * Undo of working space for linked datablocks isn't quite correct when going to a smaller gamut working space. This can be fixed by reloading the file so the linked datablocks are reloaded. Compatibility with blend files saved with a custom OpenColorIO config is tricky, as we can not detect this. * We assume that if the blend file has no information about the scene linear color space, it is the default one from the active OCIO config. And the same for any blend files linked or appended. This is effectively the same behavior as before. * Now that there is a warning when color spaces are missing, it is more likely that a user will notice something is wrong and only save the blend file with the correct config active. * As no automatic working space conversion happens on file load, there is an opportunity to correct things by changing the working space with "Convert Colors" disabled. This can also be scripted for all blend files in a project. Ref #144911 Pull Request: https://projects.blender.org/blender/blender/pulls/145476
2025-08-31 02:58:12 +02:00
colorspace
bsdf
hair
image_colorspace
image_data_types
image_mapping
image_texture_limit
integrator
light
light_group
light_linking
mesh
node_inlining
pointcloud
principled_bsdf
shader
shadow_catcher
sss
texture
)
if(WITH_OPENSUBDIV)
list(APPEND render_tests displacement)
endif()
if(WITH_FREESTYLE)
list(APPEND render_tests render_layer)
endif()
if(WITH_MOD_FLUID)
list(APPEND render_tests motion_blur reports volume)
endif()
if(WITH_OPENVDB AND WITH_MOD_FLUID)
# Some tests in the OpenVDB folder make use of fluid simulations to generate smoke
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()
list(SORT render_tests)
# Cycles
if(WITH_CYCLES)
set(_cycles_blocklist "")
set(_cycles_all_test_devices CPU CUDA OPTIX HIP HIP-RT METAL METAL-RT ONEAPI ONEAPI-RT)
set(_cycles_osl_test_devices CPU OPTIX)
foreach(_cycles_device ${CYCLES_TEST_DEVICES})
if(NOT ${_cycles_device} IN_LIST _cycles_all_test_devices)
message(FATAL_ERROR "Unknown Cycles test device ${_cycles_device}."
"Supported devices are: ${_cycles_all_test_devices}")
endif()
string(TOLOWER "${_cycles_device}" _cycles_device_lower)
set(_cycles_render_tests bake;${render_tests};osl)
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()
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")))
# Only run OSL specific tests during this phase if WITH_CYCLES_TEST_OSL isn't enabled
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}
--osl "${_cycles_osl_test_type}"
)
if(NOT ("${_cycles_device_lower}" STREQUAL "cpu"))
set_tests_properties(${_cycles_test_name} PROPERTIES RUN_SERIAL TRUE)
endif()
endif()
# 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)
endif()
endif()
unset(_cycles_test_name)
endforeach()
unset(_cycles_osl_test_type)
endforeach()
unset(_cycles_osl_test_devices)
unset(_cycles_all_test_devices)
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)
# EEVEE
if(WITH_OPENGL_BACKEND)
foreach(render_test ${gpu_render_tests})
add_render_test(
eevee_opengl_${render_test}
${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py
--testdir "${TEST_SRC_DIR}/render/${render_test}"
--outdir "${TEST_OUT_DIR}/eevee_opengl"
--gpu-backend opengl
${_gpu_render_tests_arguments}
)
endforeach()
endif()
if(WITH_METAL_BACKEND)
foreach(render_test ${gpu_render_tests})
add_render_test(
eevee_metal_${render_test}
${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py
--testdir "${TEST_SRC_DIR}/render/${render_test}"
--outdir "${TEST_OUT_DIR}/eevee_metal"
--gpu-backend metal
${_gpu_render_tests_arguments}
)
endforeach()
endif()
if(WITH_VULKAN_BACKEND AND WITH_GPU_RENDER_TESTS_VULKAN)
foreach(render_test ${gpu_render_tests})
add_render_test(
eevee_vulkan_${render_test}
${CMAKE_CURRENT_LIST_DIR}/eevee_render_tests.py
--testdir "${TEST_SRC_DIR}/render/${render_test}"
--outdir "${TEST_OUT_DIR}/eevee_vulkan"
--gpu-backend vulkan
${_gpu_render_tests_arguments}
)
endforeach()
endif()
# 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()
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()
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}"
--outdir "${TEST_OUT_DIR}/workbench_vulkan"
--gpu-backend vulkan
${_gpu_render_tests_arguments}
)
endforeach()
endif()
# Overlay
if(WITH_GPU_RENDER_TESTS_HEADED)
if(WITH_OPENGL_BACKEND)
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}
)
endif()
if(WITH_METAL_BACKEND)
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}
)
endif()
if(WITH_VULKAN_BACKEND AND WITH_GPU_RENDER_TESTS_VULKAN)
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}
)
endif()
endif()
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()
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()
endif()
unset(_gpu_render_tests_arguments)
endif()
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
# ------------------------------------------------------------------------------
# COMPOSITOR TESTS
# ------------------------------------------------------------------------------
if(TEST_SRC_DIR_EXISTS)
set(compositor_tests
input
output
color
filter
utilities
vector
pixel_nodes
multiple_node_setups
)
if(WITH_LIBMV)
list(APPEND compositor_tests keying mask tracking transform anisotropic_filtering)
endif()
foreach(comp_test ${compositor_tests})
add_render_test(
compositor_cpu_${comp_test}
${CMAKE_CURRENT_LIST_DIR}/compositor_render_tests.py
--testdir "${TEST_SRC_DIR}/compositor/${comp_test}"
--outdir "${TEST_OUT_DIR}/compositor_cpu"
)
endforeach()
add_blender_test(
compositor_cpu_file_output
--python ${CMAKE_CURRENT_LIST_DIR}/compositor_file_output_tests.py
--
--testdir "${TEST_SRC_DIR}/compositor/file_output/"
--outdir "${TEST_OUT_DIR}/compositor_cpu/file_output"
)
endif()
if(WITH_GPU_COMPOSITOR_TESTS AND TEST_SRC_DIR_EXISTS)
set(compositor_tests
input
output
color
filter
utilities
vector
2023-08-24 11:37:29 +10:00
pixel_nodes
multiple_node_setups
)
if(WITH_LIBMV)
list(APPEND compositor_tests keying mask tracking transform)
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"
--gpu-backend opengl
)
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"
--gpu-backend metal
)
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"
--gpu-backend vulkan
)
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
)
endif()
endif()
add_blender_test(
compositing_node_group
--python ${CMAKE_CURRENT_LIST_DIR}/compositing_node_group.py
)
# ------------------------------------------------------------------------------
# GEOMETRY NODE TESTS
# ------------------------------------------------------------------------------
Regression Testing: Running tests based on blend files Runs tests based on blend files with minimum python interaction. Developed as part of GSoC 2021 - Regression Testing of Geometry Nodes. Earlier, tests were built from scratch by adding a modifier/operation from the Python API. Now, tests can also be created inside blender and are compared using Python script. Features: Automatically adding expected object if it doesn't exist. This patch adds tests for the following Geometry Nodes category: * Curves * Geometry * Mesh * Points The implemented UML diagram for refactoring of mesh test framework. {F10225906} Technical Changes: SpecMeshTest: It adds the modifier/operation based on the Spec provided. BlendFileTest: It applies already existing modifier/operation from the blend file. Test folders hierarchy with tests. This folder should be extracted to `lib\tests\modeling` {F10240651} Note: The `geometry_nodes` folder might lie under another `geometry_nodes` folder while extracting, please double check. Use the inner-most one. The hierarchy should be: -`lib\tests\modeling\geometry_nodes\mesh` -`lib\tests\modeling\geometry_nodes\points` and so on. * From `ctest` the tests should be run as `ctest -R geo_node -C [Configuration]` on Windows. * Each single test can be run with its entire name e..g `ctest -R geo_node_geometry_join_geometry`.(just an example). Run `ctest -N -R geo_node` to see all tests. * From blender, the tests can be run `blender -b path\to\blend\file --python path\to\geo_node_test.py` Reviewed By: zazizizou, JacquesLucke Differential Revision: https://developer.blender.org/D11611
2021-07-27 21:00:28 +05:30
if(TEST_SRC_DIR_EXISTS)
set(geo_node_tests
attributes
closure
curve_primitives
curves
curves/interpolate_curves
foreach_geometry_element_zone
geometry
grease_pencil
import
instance
list
repeat_zone
mesh_primitives
mesh
mesh/extrude
mesh/split_edges
mesh/triangulate
points
texture
utilities
vector
)
if(WITH_GMP)
list(APPEND geo_node_tests mesh/boolean)
endif()
if(WITH_OPENVDB)
list(APPEND geo_node_tests volume)
endif()
if(WITH_OPENSUBDIV)
list(APPEND geo_node_tests mesh/subdivision_tests)
endif()
foreach(geo_node_test ${geo_node_tests})
Regression Testing: Running tests based on blend files Runs tests based on blend files with minimum python interaction. Developed as part of GSoC 2021 - Regression Testing of Geometry Nodes. Earlier, tests were built from scratch by adding a modifier/operation from the Python API. Now, tests can also be created inside blender and are compared using Python script. Features: Automatically adding expected object if it doesn't exist. This patch adds tests for the following Geometry Nodes category: * Curves * Geometry * Mesh * Points The implemented UML diagram for refactoring of mesh test framework. {F10225906} Technical Changes: SpecMeshTest: It adds the modifier/operation based on the Spec provided. BlendFileTest: It applies already existing modifier/operation from the blend file. Test folders hierarchy with tests. This folder should be extracted to `lib\tests\modeling` {F10240651} Note: The `geometry_nodes` folder might lie under another `geometry_nodes` folder while extracting, please double check. Use the inner-most one. The hierarchy should be: -`lib\tests\modeling\geometry_nodes\mesh` -`lib\tests\modeling\geometry_nodes\points` and so on. * From `ctest` the tests should be run as `ctest -R geo_node -C [Configuration]` on Windows. * Each single test can be run with its entire name e..g `ctest -R geo_node_geometry_join_geometry`.(just an example). Run `ctest -N -R geo_node` to see all tests. * From blender, the tests can be run `blender -b path\to\blend\file --python path\to\geo_node_test.py` Reviewed By: zazizizou, JacquesLucke Differential Revision: https://developer.blender.org/D11611
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(
geo_node_${geo_node_test}_${filename}
Regression Testing: Running tests based on blend files Runs tests based on blend files with minimum python interaction. Developed as part of GSoC 2021 - Regression Testing of Geometry Nodes. Earlier, tests were built from scratch by adding a modifier/operation from the Python API. Now, tests can also be created inside blender and are compared using Python script. Features: Automatically adding expected object if it doesn't exist. This patch adds tests for the following Geometry Nodes category: * Curves * Geometry * Mesh * Points The implemented UML diagram for refactoring of mesh test framework. {F10225906} Technical Changes: SpecMeshTest: It adds the modifier/operation based on the Spec provided. BlendFileTest: It applies already existing modifier/operation from the blend file. Test folders hierarchy with tests. This folder should be extracted to `lib\tests\modeling` {F10240651} Note: The `geometry_nodes` folder might lie under another `geometry_nodes` folder while extracting, please double check. Use the inner-most one. The hierarchy should be: -`lib\tests\modeling\geometry_nodes\mesh` -`lib\tests\modeling\geometry_nodes\points` and so on. * From `ctest` the tests should be run as `ctest -R geo_node -C [Configuration]` on Windows. * Each single test can be run with its entire name e..g `ctest -R geo_node_geometry_join_geometry`.(just an example). Run `ctest -N -R geo_node` to see all tests. * From blender, the tests can be run `blender -b path\to\blend\file --python path\to\geo_node_test.py` Reviewed By: zazizizou, JacquesLucke Differential Revision: https://developer.blender.org/D11611
2021-07-27 21:00:28 +05:30
${file}
--python ${TEST_PYTHON_DIR}/geo_node_test.py
)
endforeach()
endforeach()
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
)
endforeach()
endif()
# ------------------------------------------------------------------------------
# SCREENSHOT TESTS
# ------------------------------------------------------------------------------
if(WITH_GPU_RENDER_TESTS AND TEST_SRC_DIR_EXISTS)
set(render_tests
)
if(WITH_TESTS_EXPERIMENTAL)
# 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)
endif()
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()
endif()
# ------------------------------------------------------------------------------
# I/O TESTS
# ------------------------------------------------------------------------------
if(WITH_ALEMBIC AND TEST_SRC_DIR_EXISTS)
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)
add_python_test(
io_alembic_export_tests
${CMAKE_CURRENT_LIST_DIR}/alembic_export_tests.py
--blender "${TEST_BLENDER_EXE}"
--testdir "${TEST_SRC_DIR}/alembic"
--alembic-root "${ALEMBIC_ROOT_DIR}"
)
add_blender_test(
script_alembic_io
--python ${CMAKE_CURRENT_LIST_DIR}/bl_alembic_io_test.py
--
--testdir "${TEST_SRC_DIR}/alembic"
--outdir "${TEST_OUT_DIR}/io_alembic"
)
endif()
if(WITH_USD AND TEST_SRC_DIR_EXISTS)
Fix T103354: Author extents on UsdGeomMesh A properly authored USD file will have the extent attribute authored on all prims conforming to UsdGeomBoundable. This cached extent information is useful because it allows the 3D range of prims to be quickly understood without reading potentially large arrays of data. Note that because the shape of prims may change over time, extent attributes are always evaluated for a given timecode. This patch introduces support for authoring extents on meshes and volumes during export to USD. Because extents are common to multiple kinds of geometries, the main support for authoring extents has been placed in USDAbstractWriter, whose new author_extent method can operate on any prim conforming to pxr::UsdGeomBoundable. The USD library already provides us the code necessary to compute the bounds for a given prim, in pxr::UsdGeomBBoxCache::ComputeLocalBound. Note that not all prims that are imageable are boundable, such as transforms and cameras. For more details on extents, see https://graphics.pixar.com/usd/release/api/class_usd_geom_boundable.html#details. Note that when new types of geometries are introduced, such as curves in https://developer.blender.org/D16545, we will need to update the USD writer for that geometry such that it calls this->author_extent. Update on Feb 2: This patch has been updated to include a unit test to ensure authored extents are valid. This test requires new test assets that will need to be submitted via svn. The test assets are attached in the d16837_usd_test_assets.zip file. To use, unzip and merge the contents of this zip into the lib/tests/usd folder. This unit test also addresses #104269 by validating compliance of exported USD via UsdUtils.ComplianceChecker. Pull Request #104676
2023-02-14 12:11:53 +01:00
add_blender_test(
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"
Fix T103354: Author extents on UsdGeomMesh A properly authored USD file will have the extent attribute authored on all prims conforming to UsdGeomBoundable. This cached extent information is useful because it allows the 3D range of prims to be quickly understood without reading potentially large arrays of data. Note that because the shape of prims may change over time, extent attributes are always evaluated for a given timecode. This patch introduces support for authoring extents on meshes and volumes during export to USD. Because extents are common to multiple kinds of geometries, the main support for authoring extents has been placed in USDAbstractWriter, whose new author_extent method can operate on any prim conforming to pxr::UsdGeomBoundable. The USD library already provides us the code necessary to compute the bounds for a given prim, in pxr::UsdGeomBBoxCache::ComputeLocalBound. Note that not all prims that are imageable are boundable, such as transforms and cameras. For more details on extents, see https://graphics.pixar.com/usd/release/api/class_usd_geom_boundable.html#details. Note that when new types of geometries are introduced, such as curves in https://developer.blender.org/D16545, we will need to update the USD writer for that geometry such that it calls this->author_extent. Update on Feb 2: This patch has been updated to include a unit test to ensure authored extents are valid. This test requires new test assets that will need to be submitted via svn. The test assets are attached in the d16837_usd_test_assets.zip file. To use, unzip and merge the contents of this zip into the lib/tests/usd folder. This unit test also addresses #104269 by validating compliance of exported USD via UsdUtils.ComplianceChecker. Pull Request #104676
2023-02-14 12:11:53 +01:00
)
add_blender_test(
io_usd_import
--python ${CMAKE_CURRENT_LIST_DIR}/bl_usd_import_test.py
--
--testdir "${TEST_SRC_DIR}/usd"
USD: Animated camera property import Imports in the following animated data from UsdGeomCameras: - Focal length - DOF distance - DOF fstop - Clip start, Clip end - Tilt shift x, Tilt shift y - Aperture sizes (with caveats) Implementation wise, it's more complicated than I'd like due to needing to read in both non-animated and animated data for each property. And because I've tried to reduce the duplication of various transforms we have to do on each value. E.g. scaling values by "tenth of scene units" or the extraction of the USD clipping range from a GfVec2f into 2 separate properties, and 2 separate fcurves, in Blender etc. The current approach was the best I could come up with so far. Aperture sizes remain problematic for import, with animation data and without, due to how Blender selects the largest sensor dimension to base downstream calculations on and for which there's no concept in USD to strictly dictate which dimension to use. Additionally, changing the sensor size will impact the Tilt values as well. This means that if the Aperture sizes are animated, we must also animate the tilt values; leads to more fcurves being created than perhaps expected. The `projection` attribute (perspective and orthographic) remains unchanged (non animated only) due to differences in how USD<>Blender interoperate with the Orthographic projection method. Note: Blender only exports perspective cameras due to the same reason. Pull Request: https://projects.blender.org/blender/blender/pulls/137487
2025-04-25 19:57:12 +02:00
--outdir "${TEST_OUT_DIR}/io_usd"
)
endif()
if(TEST_SRC_DIR_EXISTS)
add_blender_test_allow_error(
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()
if(WITH_IO_WAVEFRONT_OBJ AND TEST_SRC_DIR_EXISTS)
add_blender_test_allow_error(
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()
if(WITH_IO_PLY AND TEST_SRC_DIR_EXISTS)
add_blender_test_allow_error(
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()
if(WITH_IO_STL AND TEST_SRC_DIR_EXISTS)
add_blender_test_allow_error(
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()
if(WITH_CODEC_FFMPEG AND TEST_SRC_DIR_EXISTS)
add_python_test(
ffmpeg
${CMAKE_CURRENT_LIST_DIR}/ffmpeg_tests.py
--blender "${TEST_BLENDER_EXE}"
--testdir "${TEST_SRC_DIR}/ffmpeg"
)
endif()
if(TEST_SRC_DIR_EXISTS AND TEST_OPENIMAGEIO_TOOL_EXISTS)
set(OPTIONAL_FORMATS "")
Tests: Add tests for image format saving and loading This adds saving and loading tests for our supported image formats. **Saving - bf_imbuf_save.py** There are 2 template images which are loaded anew for each file save attempt. One is an 8-bit RGBA image and the other 32-bit. This is required as many formats use a variety of factors to determine which of `ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates are constructed to have alpha transparency as well as values > 1 (or clamped to 1 for the case of the 8-bit template). Test flow: - Load in an appropriate template image - Save it to the desired format with the desired set of options - Compare against the reference image Notes: - 98 references are used totaling ~3.6MB - 10-12 second test runtime - Templates can be reconstructed with the create-templates.blend file **Loading - bf_imbuf_load.py** Test flow: - Load in each of the reference images - Save them back out as .exr - Save additional metadata to a secondary file (alpha mode, colorspace etc) - Compare the saved out .exr with another set of reference .exrs - Compare the saved out file metadata with set of reference metadata Notes: - 98 exr references are used totaling ~10MB - 10-12 second test runtime as well A HTML report is not implemented. The diff output organization is very similar to the other tests so it should be somewhat easy to do in the future if we want. The standard set of environment variables are implemented for both: BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR Pull Request #104442
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(
imbuf_save
Tests: Add tests for image format saving and loading This adds saving and loading tests for our supported image formats. **Saving - bf_imbuf_save.py** There are 2 template images which are loaded anew for each file save attempt. One is an 8-bit RGBA image and the other 32-bit. This is required as many formats use a variety of factors to determine which of `ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates are constructed to have alpha transparency as well as values > 1 (or clamped to 1 for the case of the 8-bit template). Test flow: - Load in an appropriate template image - Save it to the desired format with the desired set of options - Compare against the reference image Notes: - 98 references are used totaling ~3.6MB - 10-12 second test runtime - Templates can be reconstructed with the create-templates.blend file **Loading - bf_imbuf_load.py** Test flow: - Load in each of the reference images - Save them back out as .exr - Save additional metadata to a secondary file (alpha mode, colorspace etc) - Compare the saved out .exr with another set of reference .exrs - Compare the saved out file metadata with set of reference metadata Notes: - 98 exr references are used totaling ~10MB - 10-12 second test runtime as well A HTML report is not implemented. The diff output organization is very similar to the other tests so it should be somewhat easy to do in the future if we want. The standard set of environment variables are implemented for both: BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR Pull Request #104442
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"
-oiiotool "${OPENIMAGEIO_TOOL}"
Tests: Add tests for image format saving and loading This adds saving and loading tests for our supported image formats. **Saving - bf_imbuf_save.py** There are 2 template images which are loaded anew for each file save attempt. One is an 8-bit RGBA image and the other 32-bit. This is required as many formats use a variety of factors to determine which of `ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates are constructed to have alpha transparency as well as values > 1 (or clamped to 1 for the case of the 8-bit template). Test flow: - Load in an appropriate template image - Save it to the desired format with the desired set of options - Compare against the reference image Notes: - 98 references are used totaling ~3.6MB - 10-12 second test runtime - Templates can be reconstructed with the create-templates.blend file **Loading - bf_imbuf_load.py** Test flow: - Load in each of the reference images - Save them back out as .exr - Save additional metadata to a secondary file (alpha mode, colorspace etc) - Compare the saved out .exr with another set of reference .exrs - Compare the saved out file metadata with set of reference metadata Notes: - 98 exr references are used totaling ~10MB - 10-12 second test runtime as well A HTML report is not implemented. The diff output organization is very similar to the other tests so it should be somewhat easy to do in the future if we want. The standard set of environment variables are implemented for both: BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR Pull Request #104442
2023-02-20 19:04:34 -08:00
-optional_formats "${OPTIONAL_FORMATS}"
)
add_blender_test_allow_error(
imbuf_load
Tests: Add tests for image format saving and loading This adds saving and loading tests for our supported image formats. **Saving - bf_imbuf_save.py** There are 2 template images which are loaded anew for each file save attempt. One is an 8-bit RGBA image and the other 32-bit. This is required as many formats use a variety of factors to determine which of `ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates are constructed to have alpha transparency as well as values > 1 (or clamped to 1 for the case of the 8-bit template). Test flow: - Load in an appropriate template image - Save it to the desired format with the desired set of options - Compare against the reference image Notes: - 98 references are used totaling ~3.6MB - 10-12 second test runtime - Templates can be reconstructed with the create-templates.blend file **Loading - bf_imbuf_load.py** Test flow: - Load in each of the reference images - Save them back out as .exr - Save additional metadata to a secondary file (alpha mode, colorspace etc) - Compare the saved out .exr with another set of reference .exrs - Compare the saved out file metadata with set of reference metadata Notes: - 98 exr references are used totaling ~10MB - 10-12 second test runtime as well A HTML report is not implemented. The diff output organization is very similar to the other tests so it should be somewhat easy to do in the future if we want. The standard set of environment variables are implemented for both: BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR Pull Request #104442
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"
-oiiotool "${OPENIMAGEIO_TOOL}"
Tests: Add tests for image format saving and loading This adds saving and loading tests for our supported image formats. **Saving - bf_imbuf_save.py** There are 2 template images which are loaded anew for each file save attempt. One is an 8-bit RGBA image and the other 32-bit. This is required as many formats use a variety of factors to determine which of `ibuf->rect` or `ibuf->rectfloat` to use for processing. The templates are constructed to have alpha transparency as well as values > 1 (or clamped to 1 for the case of the 8-bit template). Test flow: - Load in an appropriate template image - Save it to the desired format with the desired set of options - Compare against the reference image Notes: - 98 references are used totaling ~3.6MB - 10-12 second test runtime - Templates can be reconstructed with the create-templates.blend file **Loading - bf_imbuf_load.py** Test flow: - Load in each of the reference images - Save them back out as .exr - Save additional metadata to a secondary file (alpha mode, colorspace etc) - Compare the saved out .exr with another set of reference .exrs - Compare the saved out file metadata with set of reference metadata Notes: - 98 exr references are used totaling ~10MB - 10-12 second test runtime as well A HTML report is not implemented. The diff output organization is very similar to the other tests so it should be somewhat easy to do in the future if we want. The standard set of environment variables are implemented for both: BLENDER_TEST_UPDATE, BLENDER_VERBOSE, and BLENDER_TEST_COLOR Pull Request #104442
2023-02-20 19:04:34 -08:00
-optional_formats "${OPTIONAL_FORMATS}"
)
endif()
# ------------------------------------------------------------------------------
# SEQUENCER RENDER TESTS
# ------------------------------------------------------------------------------
if(TEST_SRC_DIR_EXISTS)
set(render_tests
effects
filter
transform
blend_modes_byte
blend_modes_float
ffmpeg
)
set(video_output_tests
video_output
)
foreach(render_test ${render_tests})
add_render_test(
sequencer_render_${render_test}
${CMAKE_CURRENT_LIST_DIR}/sequencer_render_tests.py
--testdir "${TEST_SRC_DIR}/sequence_editing/${render_test}"
--outdir "${TEST_OUT_DIR}/sequence_editing"
)
endforeach()
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"
)
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
)
endif()
# ------------------------------------------------------------------------------
# SCULPTING TESTS
# ------------------------------------------------------------------------------
if(TEST_SRC_DIR_EXISTS)
add_blender_test(
bl_sculpt_operators
--python ${CMAKE_CURRENT_LIST_DIR}/bl_sculpt.py
--
--testdir "${TEST_SRC_DIR}/sculpting"
)
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"
)
add_blender_test(
bl_sculpt_mask_filter
--python ${CMAKE_CURRENT_LIST_DIR}/sculpt_paint/mask_filter_test.py
--
--testdir "${TEST_SRC_DIR}/sculpting"
)
endif()
if(WITH_GPU_MESH_PAINT_TESTS AND TEST_SRC_DIR_EXISTS)
set(render_tests
brushes
)
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()
endif()
# ------------------------------------------------------------------------------
# Headless GUI Tests
# ------------------------------------------------------------------------------
if(WITH_UI_TESTS)
# This could be generated with:
# `"${TEST_PYTHON_EXE}" "${CMAKE_CURRENT_LIST_DIR}/ui_simulate/run.py" --list-tests`
# list explicitly so changes bisecting/updated are sure to re-run CMake.
set(_ui_tests
test_sculpt.asset_shelf_brush_selection
test_tools.sculpt_mode_toolbar
test_undo.compositor_make_group
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
test_undo.view3d_sculpt_dyntopo_stroke_toggle
test_undo.view3d_sculpt_with_memfile_step
test_undo.view3d_sculpt_trim
test_undo.view3d_simple
test_undo.view3d_texture_paint_complex
test_undo.view3d_texture_paint_simple
test_workspace.sanity_check_general
test_workspace.sanity_check_2d_animation
test_workspace.sanity_check_sculpting
test_workspace.sanity_check_storyboarding
test_workspace.sanity_check_vfx
test_workspace.sanity_check_video_editing
)
foreach(ui_test ${_ui_tests})
add_blender_test_ui(
"ui_${ui_test}"
--enable-event-simulate
--python "${CMAKE_CURRENT_LIST_DIR}/ui_simulate/run_blender_setup.py"
--
--tests "${ui_test}"
)
endforeach()
unset(_ui_tests)
endif()
# ------------------------------------------------------------------------------
# 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
if(TEST_SRC_DIR_EXISTS)
# TODO: disabled for now after collection unification
# add_subdirectory(view_layer)
endif()
# ------------------------------------------------------------------------------
# Linux Release sainty checks
# ------------------------------------------------------------------------------
if(WITH_LINUX_OFFICIAL_RELEASE_TESTS)
get_filename_component(release_root_folder ${TEST_BLENDER_EXE} DIRECTORY)
set(extra_args "")
if(WITH_COMPILER_ASAN)
set(extra_args
${extra_args}
--sanitizer-build
)
endif()
add_python_test(
linux_release_sanity_checks
${CMAKE_SOURCE_DIR}/tools/check_blender_release/check_release.py
-- --directory "${release_root_folder}" ${extra_args}
)
unset(extra_args)
unset(release_root_folder)
endif()