Commit Graph

741 Commits

Author SHA1 Message Date
Jesse Yurkovich 2d34a09043 Tests: Address imbuf_save failures on ARM64 builds
This does 2 things to address the ARM64 failures:
- Increases the threshold to be inline with what Cycles uses
- Disables the 2 problematic WebP variations (#105006 will track)
2023-02-20 21:36:19 -08:00
Jesse Yurkovich 7699c7407d 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:06:38 -08:00
Hans Goudey d465b92823 Cleanup: Make format, fix missing static warning 2023-02-15 17:39:53 -05:00
Michael B Johnson 5040c39d1a 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
Campbell Barton 91346755ce Cleanup: use '#' prefix for issues instead of 'T'
Match the convention from Gitea instead of Phabricator's T for tasks.
2023-02-12 14:56:05 +11:00
Campbell Barton fefc6a73b3 Fix pep8 checker operating on dot-files
Temporary editor files were included which could make the checker fail.
2023-02-11 14:12:43 +11:00
Campbell Barton 9f4edf8c2a Cleanup: remove unused variables 2023-02-11 14:04:35 +11:00
Campbell Barton b77c82e2bb Tests: minor updates to make bl_rna_manual_reference more useful
- Avoid flooding the output with every match that succeeds.
- Report patterns listed in the manual that don't match anything in
  Blender.
- Disable external URL lookups, this is too slow.
  Instead use a LOCAL_PREFIX (a local build of the manual)
  or skip the test.
2023-02-10 14:04:15 +11:00
Lukas Stockner 0220bdc2d5 Cycles: Tests: Add option to increase SPP for manual comparisons
Useful for validating changes when sampling/noise changes:
- First run with BLENDER_TEST_UPDATE=1 and e.g. CYCLESTEST_SPP_MULTIPLIER=32
- Apply your change
- Run with only CYCLESTEST_SPP_MULTIPLIER=32
- Compare
- Reset the SVN repo

Differential Revision: https://developer.blender.org/D17107
2023-02-03 21:00:47 +01:00
Jacques Lucke bbc18673f3 Cleanup: make format 2023-02-02 13:16:39 +01:00
Michael Kowalski f359a39d11 Fix T100028: Convert USD camera properties to mm from USD units.
Authored by Sonny Campbell.

Currently when importing a USD file, some of the camera properties are
ignored, or the units are not converted correctly from USD world units.
On import we currently set the focal length, but not the camera sensor
size (horizontal and vertical aperture), so the camera field of view
is wrong. The sensor size information is in the USD file, but is ignored
for perspective cameras.

USD uses "tenth of a world unit" scale for some physical camera properties
like focal length and aperture.
https://graphics.pixar.com/usd/release/api/class_usd_geom_camera.html#UsdGeom_CameraUnits

I have added the UsdStage's metersPerUnit parameter to the ImportSettings
so the camera can do the required conversion on import. This will convert from
the USD file's world units to millimeters for Blender's camera settings.

Reviewed by: Sybren and makowalski.

Differential Revision: https://developer.blender.org/D16019
2023-01-30 17:22:26 -05:00
Bastien Montagne 3649c05f57 Cleanup: Run `make format` on codebase. 2023-01-30 09:40:17 +01:00
Michael Kowalski fa57c691f6 USD IO CI Tests
Various new CI tests for USD Import / Export functionalty:

Import:
 - Added mesh import tests for topology types and multiple UV sets. (Python)

Export:
 - Added a verification tests for mesh topology. (C++)
 - Added a test to make sure UsdPreviewSurface export conversion of materials
is correct. (C++)

Reviewed by: Sybren and Hans.

Differential Revision: https://developer.blender.org/D16274
2023-01-25 14:51:39 -05:00
Jacques Lucke 85908e9edf Geometry Nodes: new Interpolate Curves node
This adds a new `Interpolate Curves` node. It allows generating new curves
between a set of existing guide curves. This is essential for procedural hair.

Usage:
- One has to provide a set of guide curves and a set of root positions for
  the generated curves. New curves are created starting from these root
  positions. The N closest guide curves are used for the interpolation.
- An additional up vector can be provided for every guide curve and
  root position. This is typically a surface normal or nothing. This allows
  generating child curves that are properly oriented based on the
  surface orientation.
- Sometimes a point should only be interpolated using a subset of the
  guides. This can be achieved using the `Guide Group ID` and
  `Point Group ID` inputs. The curve generated at a specific point will
  only take the guides with the same id into account. This allows e.g.
  for hair parting.
- The `Max Neighbors` input limits how many guide curves are taken
  into account for every interpolated curve.

Differential Revision: https://developer.blender.org/D16642
2023-01-20 12:09:38 +01:00
Campbell Barton 66dee44088 CMake: quiet references to undeclared variable warnings
These warnings can reveal errors in logic, so quiet them by checking
if the features are enabled before using variables or by assigning
empty strings in some cases.

- Check CMAKE_THREAD_LIBS_INIT is set before use as CMake docs
  note that this may be left unset if it's not needed.
- Remove BOOST/OPENVDB/VULKAN references when disable.
- Define INC_SYS even when empty.
- Remove PNG_INC from freetype (not defined anywhere).
2023-01-19 17:10:42 +11:00
Campbell Barton ca3e19f4c5 Fixes for 'make check_pep8' target
- Skip files in dirs starting with '.' (`.git` was being searched).
- Update --disable list for pylint.
2023-01-18 18:27:49 +11:00
Brecht Van Lommel 589cbbf0e3 Tests: test availability of new bundled Python libraries
Differential Revision: https://developer.blender.org/D16733
2023-01-09 13:42:56 +01:00
Chris Blackbourn 8c194e1ba6 Cleanup: format 2022-12-29 20:49:08 +13:00
Hans Goudey 99fcfdd9fb Tests: Print when mesh test starts, to help debugging crashes 2022-12-20 12:02:05 -06:00
Hans Goudey 7907803694 Tests: Remove random shuffling from modifiers test
These are meant to be regression tests, not fuzz tests. The "random"
shuffling made debugging quite annoying, even though the random order
was the same every time. Instead, hard-code the two lists to make
things more obvious. The resulting list doesn't make much sense
(for example, the multires modifier has to be first in the stack),
but for now avoid changing things further.

Also remove some comments that weren't helpful.
2022-12-20 10:40:52 -06:00
Bastien Montagne b93025db59 Add concept of 'runtime' ID in Main data-base.
Such IDs are tagged with the new `LIB_TAG_RUNTIME`. They are essentially
like any other regular ID, except that they do not get written in .blend
files. They also do not make their linked data usages directly linked.
They do be written in undo steps however.

This tag should be ignored in any non-Main IDs (e.g. evaluated data,
`NO_MAIN`, etc.).

This commit also adds a new RNA ID property, `is_runtime`. This is not a
direct mapping to the DNA tag, as a non-main ID will also return True,
and the property is only editable for Main IDs.

Some basic testing for expected behavior of that new tag was also added
to `blendfile_io` py unittest.

Required for brush asset project, see T101908.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16675
2022-12-20 13:15:51 +09:00
Campbell Barton 5a761a47e1 Cleanup: replace StringIO seek() & read() with a call to getvalue() 2022-12-18 14:18:01 +11:00
Campbell Barton 7571222a69 Cleanup: add trailing commas for multi-line collections
Avoid accidentally missing commas between strings, see: T101020.
Also use single quotes for enum identifiers.
2022-12-15 17:34:09 +11:00
Brecht Van Lommel ebff39d5bb Build: make running executables as part of build/tests work with shared libs
Ensure the environment is set up for blender_test, idiff and oslc so that they
can find the required shared libraries.

Also deduplicate add_bundled_libraries() between Linux and macOS.

Includes contributions by Ray Molenkamp and Brecht Van Lommel.

Ref T99618
2022-12-07 15:28:17 +01:00
Jacques Lucke ca2ca0ce5d Geometry Nodes: add instance test category 2022-12-05 17:56:47 +01:00
Jacques Lucke 44ab02fc5c Geometry Nodes: add texture regression test category 2022-12-05 12:06:18 +01:00
Campbell Barton cc6bdac921 Cleanup: format 2022-12-05 12:54:00 +11:00
Bastien Montagne 313c2e9105 Fix a test after recent changes to lib (in)directly linked ID handling.
rB133dde41bb5b changed handling of (in)directly linked status handling
for IDs, now IDs that are not directly linked get proper status and
handling on file save. this broke parts of the `pyapi_idprop_datablock`
tests.
2022-11-30 15:08:11 +01:00
Bastien Montagne 133dde41bb Improve handling of (in)direclty linked status for linked IDs.
This commit essentially ensures before writing .blend file that only
actualy locally used linked IDs are tagged as `LIB_TAG_EXTERN` (and
therefore get a reference stored in the .blend file).

Previously, a linked ID tagged as directly linked would never get back
to the indirectly linked status. Consequence was a lot of 'needless'
references to linked data in .blend files.

This commit also introduces a new flag for lib_query ID usage types,
`IDWALK_CB_DIRECT_WEAK_LINK`, used currently for base's Object
pointer, and for LayerCollection's Collection pointer.

NOTE: A side-effect of this patch is that even IDs explicitely linked by
the user won't be kept anymore when writing files, i.e. they will not be
there anymore after a file reload, if they are not actually used.

Overhead of new process is below 0.1% in whole file saving process in
a Heist production file e.g.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16605
2022-11-30 11:16:14 +01:00
Bastien Montagne 369914e7b1 Liblink: Add test over direct vs indirect link status.
Some checks are currently commented out, since Blender will never 'clear'
the directly linked status of an ID once it has been used by local data.
2022-11-24 10:52:27 +01:00
Wannes Malfait e83f46ea76 Geometry Nodes: Use Mesh instead of BMesh in split edges node
Rewrite the edge split code to operate directly on Mesh instead
of BMesh. This allows for the use of multi-threading and makes
the node around 2 times faster. Around 15% of the time is spent
just on the creation of the topology maps, so these being cached
on the mesh could cause an even greater speedup. The new node
gave identical results compared to the BMesh version on all the
meshes I tested it on (up to permutation of the indices).

Here are some of the results on a few simple test cases:
(Intel i7-7700HQ (8 cores) @ 2.800GHz , with 50% of edges selected)
|       | 370x370 UV Sphere | 400x400 Grid | Suzanne 4 subdiv levels |
| ----- | ----------------- | -------------- | --------------------- |
| Mesh  | 89ms              | 111ms          | 76ms                  |
| BMesh | 200ms             | 276ms          | 208ms                 |

Differential Revision: https://developer.blender.org/D16399
2022-11-20 15:42:10 -06:00
Campbell Barton 0fd94a1f5e Tests: enable element-wise multiplication for mathutils API tests 2022-11-20 10:42:17 +11:00
Hans Goudey 1ea169d90e Mesh: Move loose edge flag to a separate cache
As part of T95966, this patch moves loose edge information out of the
flag on each edge and into a new lazily calculated cache in mesh
runtime data. The number of loose edges is also cached, so further
processing can be skipped completely when there are no loose edges.

Previously the `ME_LOOSEEDGE` flag was updated on a "best effort"
basis. In order to be sure that it was correct, you had to be sure
to call `BKE_mesh_calc_edges_loose` first. Now the loose edge tag
is always correct. It also doesn't have to be calculated eagerly
in various places like the screw modifier where the complexity
wasn't worth the theoretical performance benefit.

The patch also adds a function to eagerly set the number of loose
edges to zero to avoid building the cache. This is used by various
primitive nodes, with the goal of improving drawing performance.
This results in a few ms shaved off extracting draw data for some
large meshes in my tests.

In the Python API, `MeshEdge.is_loose` is no longer editable.
No built-in addons set the value anyway. The upside is that
addons can be sure the data is correct based on the mesh.

**Tests**
There is one test failure in the Python OBJ exporter: `export_obj_cube`
that happens because of existing incorrect versioning. Opening the
file in master, all the edges were set to "loose", which is fixed
by this patch.

Differential Revision: https://developer.blender.org/D16504
2022-11-18 16:05:06 -06:00
Rateeb Riyasat cce4271b31 Add regression test for triangulate faces
Basic test for `quads_convert_to_tris`

As the operator name in blender is different from the bpy name, the operator
name in blender was opted in terms of the blend file collection name as well
as the test name. This was done so that new developers in the future can
easier understand which operator this corresponds to. Although it might be
better to change this to the bpy name so as to be consistent with the rest
of the codebase.

Updated blend file `lib/tests/modeling/operators.blend` has been
committed as rBL63101.

Reviewed By: zazizizou, mont29

Differential Revision: https://developer.blender.org/D16072
2022-11-16 18:34:11 +01:00
Sergey Sharybin 3153bd0f5d SVG: Add more sophisticated test suit
This test suit tests SVG on a big files, as opposite of testing one
specific aspect of the standard by atomic files.
2022-11-10 11:04:30 +01:00
Campbell Barton b320597697 Tests: don't create byte-code cache when calling Python from SVN
Creating `__pycache__` directories in SVN's lib/ directory can cause
updating SVN to fail. Add the -B flag when TEST_PYTHON_EXE from LIBDIR
is used so so Python doesn't generate this cache.
2022-11-03 11:51:52 +11:00
Michael Jones ba67a383fa Cycles: Enable MNEE on Metal (macOS >= 13)
This patch enables MNEE on macOS >= 13. There was an inefficiency in the calculation of spill requirements, fixed as of macOS 13. This patch also adds a temporary inlining workaround for a Metal compiler bug which causes `mnee_compute_constraint_derivatives` to behave incorrectly.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D16235
2022-10-12 17:06:50 +01:00
Campbell Barton 3f64b88684 Cleanup: use function style casts for C++, format & spelling 2022-10-12 10:39:12 +11:00
Sergey Sharybin be44fd9401 Fix SVG tests: Add missing file 2022-10-11 15:13:30 +02:00
Sergey Sharybin 223ba59cb0 Beginning of automated SVG regression test
This commit contains the CTest integration.

Starting with the very simple tests for the recent fixes in the
io_corve_svg addon which were related on closing path.

The idea is to use same framework as what we use for render tests
to make it easily visible what aspect of SVG changed or broke.

In order to achieve this both .blend and .svg files are used.
The .svg file defines the exact subject of test, and the .blend
file defines camera, and possibly material.

The longer term idea is to have a number of atomic tests for a
specific SVG features to help isolating problematic areas, as
well as a more comprehensive tests to perform QA.
2022-10-11 15:03:09 +02:00
Campbell Barton a66e584294 Cleanup: correct API usage for script access
In practice this didn't cause problems, but accessing scripts via
bpy.utils.resource_path('USER') ignores the BLENDER_USER_SCRIPTS
environment variable.
2022-09-29 17:22:32 +10:00
Joseph Eagar 0156a677c7 Sculpt: New Cavity Automasking Mode
Add new cavity automasking mode based on local mesh
curvature.  Cavity masking is a great way to quickly add
detail in crevices and the like.  It's meant to be used
with the Paint brush in color attribute mode.  It does
work with other brushes but the results can be unpredictable.

{F13131497}

The old "dirty mask" operator has been replace with a new
"mask from cavity" operator that shares the same code with
cavity automasking.

Differences from the sculpt-dev implementation:
    * It uses the word "cavity."  When I first implemented
this I wasn't aware
      this feature existed in other software (and other
paint modes in Blender),
      and for reasons that escape me today I initially
decided to call it a concave or
      concavity mask.
    * The cavity factor works a bit differently.  It's
      no longer non-linear and functions as a simple
      scale around 0.5f.
    * Supports custom curves.
    * Supports blurring.

Reviewed By: Julian Kaspar, Jeroen Bakker and Campbell Barton
Differential Revision: https://developer.blender.org/D15122
Ref D15122
2022-09-28 16:22:34 -07:00
Sebastian Herhoz 75a6d3abf7 Cycles: add Path Guiding on CPU through Intel OpenPGL
This adds path guiding features into Cycles by integrating Intel's Open Path
Guiding Library. It can be enabled in the Sampling > Path Guiding panel in the
render properties.

This feature helps reduce noise in scenes where finding a path to light is
difficult for regular path tracing.

The current implementation supports guiding directional sampling decisions on
surfaces, when the material contains a least one diffuse component, and in
volumes with isotropic and anisotropic Henyey-Greenstein phase functions.

On surfaces, the guided sampling decision is proportional to the product of
the incident radiance and the normal-oriented cosine lobe and in volumes it
is proportional to the product of the incident radiance and the phase function.

The incident radiance field of a scene is learned and updated during rendering
after each per-frame rendering iteration/progression.

At the moment, path guiding is only supported by the CPU backend. Support for
GPU backends will be added in future versions of OpenPGL.

Ref T92571

Differential Revision: https://developer.blender.org/D15286
2022-09-27 15:56:32 +02:00
Campbell Barton 998ace3463 Cleanup: use lowercase function calls & macros in for CMake
This is already the case for most CMake usage.
Although some find modules are an exception to this, as they were
originally maintained externally they use some different conventions.

Also corrected bad indentation in: intern/cycles/CMakeLists.txt
2022-09-23 14:33:44 +10:00
Campbell Barton 4baa6e57bd Cleanup: prefer 'arg' over 'params' for sphinx documentation
While both are supported, 'arg' is in more common use so prefer it.
2022-09-19 14:24:31 +10:00
Campbell Barton 39c341bf4a Cleanup: remove redundant braces from assert & raise
autopep8 v1.7 added a space after assert & raise,
remove the braces as they aren't needed.
2022-09-14 16:18:59 +10:00
Omar Emara 9990792e87 Compositor: Rename compositor build option
Currently, the compositor can be disabled using the WITH_COMPOSITOR
build option. Since, we intent to always build the realtime compositor,
we need to make the distinction between both compositors clear.

So this patch renames the option to WITH_COMPOSITOR_CPU. Additionally,
the check for the option was moved inside the compositor modules' own
CMake file in preparation for the realtime compositor code.

Differential Revision: https://developer.blender.org/D15622

Reviewed By: Jeroen Bakker, Ray Molenkamp
2022-08-09 15:59:56 +02:00
Campbell Barton 26b9c54b01 License headers: add missing license headers 2022-08-09 13:25:11 +10:00
Campbell Barton 1ec7f75b2a Cleanup: format 2022-08-04 07:41:03 +10:00
Hans Goudey 8081a05015 Tests: Remove deprecated/removed operators from tests
44aa9e40ff
2022-08-02 16:26:38 -05:00
Pratik Borhade 074ce49de0 Automated testing: Add operators tests
Part of {T84999}
This patch adds test for
- `dissolve_limited`
- `dissolve_mode`
- `merge_normals`

Updated blend file:
{F13162744}

Reviewed By: zazizizou, mont29

Differential Revision: https://developer.blender.org/D15187
2022-08-02 16:43:42 +02:00
Jeroen Bakker 3393b7137e RenderReport: Add option to add platform specific overrides.
Reference images in the reference_override_dir will be chosen before
images in reference_dir. This allows platform specific reference
images, with a common base.

Ignored when set to None. The caller is responsible
of setting the reference override dir as the unit test is more aware
what the definition of a platform is.

Patch adds `gpu.platform.device_type_get` function to get the device
type that blender has detected.

Reviewed By: brecht

Maniphest Tasks: T99046

Differential Revision: https://developer.blender.org/D15265
2022-08-01 10:57:32 +02:00
Campbell Barton ae6a4fcc7a Tests: add test to ensure restricted py-driver execution is working
Add internal function (only used for testing at the moment)
`_bpy._driver_secure_code_test`.

Add test `script_pyapi_bpy_driver_secure_eval` to serves two purposes:

- Ensure expressions that should be insecure remain so when upgrading
  Python or making any changes in this area.

- Ensure new versions of Python don't introduce new byte-codes that
  prevent existing expressions from being executed
  (happened when upgrading from 3.7, see [0]).

[0]: dfa5201763
2022-07-12 16:11:19 +10:00
Campbell Barton 8c33a53b17 Cleanup: format 2022-07-05 14:34:09 +10:00
Bastien Montagne b544225202 Fix (unreported) liboverride resync creating garbage data in some cases.
Regression caused by the introduction of partial resync in February 2022
(rB1695d38989fd482d3c). Code was missing adding some existing overrides
to the mapping in some specific cases, causing resync to create 'new'
ones instead of re-using existing ones.

This commit also adds a basic resync testcase that illustrates this
issue.
2022-06-30 10:33:44 +02:00
luzpaz 4d982cbb5d Cleanup: fix various typos
Differential Revision: https://developer.blender.org/D15304
2022-06-28 15:56:16 +02:00
Jeroen Bakker 585d81ba2b Workbench: Increase render tests fail threshold for hair.
When running the render test cases on MacOS/Intel the hair render
test fail. Most likely due to the dense geometry and the low
resolution of the test image.

This patch increases the fail threshold so these tests will pass.
Note that I haven't been able to test whether this is also the case
for Linux/Windows. If that is the case we should remove the platform
specific test.
2022-06-24 14:09:15 +02:00
Jeroen Bakker f748a81f25 Test/Eevee: Increase failure threshold for image tests.
Makes the current test cases pass on NVIDIA 1080Ti/515.
The tests still fail on other platforms (AMD, Intel). Some are actual failures.
Other require platform specific reference images.

Original patch provided by Brecht van Lommel.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D15264
2022-06-24 13:45:29 +02:00
Sybren A. Stüvel 4e96d71ddb Render report: better wording for reference image updating
The old text was suggesting to run `BLENDER_TEST_UPDATE=1 ctest` for
failed tests. Now it's more clear that this is for the regeneration of
reference (ground truth) images, and that it will not touch passing test
cases.

It now also mentions to commit the new reference images to SVN, driving
the point home that this is for updating those, and not for making
failing tests succeed in general.

Over-the-shoulder reviewed by: @sergey
2022-06-14 13:02:39 +02:00
Hans Goudey 6572ad8620 Cleanup: Use const, make format 2022-06-04 16:51:20 +02:00
Bastien Montagne 1a3ac2f750 Tests: Add basic testing for boolean modifiers.
Test basic Difference operation with both a single Objetc and a
collection of three objects as operands, using BMesh (aka 'FAST') mode.
2022-06-03 16:07:05 +02:00
Campbell Barton 3ca76ae0e8 Cleanup: remove "<pep8 compliant>" from headers
It can be assumed that all scripts comply with basic pep8 formatting
regarding white-space, indentation etc.

Also remove note in best practices page & update `tests/python/pep8.py`.

If we want to exclude some scripts from make format,
this can be done by adding them to `ignore_files` in:
source/tools/utils_maintenance/autopep8_format_paths.py

Or using `# nopep8` for to ignore for individual lines.

Ref T98554
2022-06-02 20:16:20 +10:00
Brecht Van Lommel e5ab1495e5 Merge branch 'blender-v3.2-release' 2022-06-01 10:30:30 +02:00
Brecht Van Lommel da7bc51210 Fix failing Cycles Metal MNEE test on buildbot, by disabling it
It appears that Metal and MNEE are still not working.
2022-06-01 10:28:09 +02:00
Brecht Van Lommel 610619c203 Merge branch 'blender-v3.2-release' 2022-05-31 17:35:16 +02:00
Brecht Van Lommel f2cd7e08fe Fix Cycles MNEE not working for Metal
Move MNEE to own kernel, separate from shader ray-tracing. This does introduce
the limitation that a shader can't use both MNEE and AO/bevel, but that seems
like the better trade-off for now.

We can experiment with bigger kernel organization changes later.

Differential Revision: https://developer.blender.org/D15070
2022-05-31 17:24:43 +02:00
Campbell Barton c582a2dbd9 Merge branch 'blender-v3.2-release' 2022-05-17 18:12:41 +10:00
Campbell Barton bdb5a50682 Update tests to account for Text.as_string not adding a trailing newline
Regression in tests from [0] tests were written to assume a newline was
added to the result of Text.as_string which is no longer the case.

[0]: f4ff36431c
2022-05-17 18:11:16 +10:00
Campbell Barton 1660eff1a2 Cleanup: format 2022-05-17 10:06:13 +10:00
Sybren A. Stüvel 8c24e29338 Fix broken unit test `bl_rigging_symmetrize`
Fix parameters used in `self.assertAlmostEqual()` call; the code was
passing the error message to the `places` parameter.
2022-05-16 13:03:06 +02:00
Campbell Barton e0e737b72b Cleanup: line length for Python scripts 2022-04-26 15:16:11 +10:00
Campbell Barton e3724d29ff Cleanup: autopep8 2022-04-26 15:03:04 +10:00
Campbell Barton 3035235def Cleanup: run autopep8 on tests/ 2022-04-19 15:25:55 +10:00
Clément Foucault 1440074cac Tests: Change force disable render test messages to be warnings
These were easilly missable and took some effort to find why the test
were disabled.
2022-04-14 13:10:26 +02:00
Campbell Barton ee292a1d66 PyAPI: use keyword only arguments for Text.region_{from/to} string
This is the convention for most parts of Blender Python API.
2022-04-08 13:28:55 +10:00
Matheus Santos f49a736ff4 Text Editor: Get/Set region text API
Add the ability to get/set the selected text.

**Calling the new methods:**

- `bpy.data.texts["Text"].region_as_string()`
- `bpy.data.texts["Text"].region_from_string("Replacement")`
2022-04-07 15:17:04 +10:00
Olivier Maury 1fb0247497 Cycles: approximate shadow caustics using manifold next event estimation
This adds support for selective rendering of caustics in shadows of refractive
objects. Example uses are rendering of underwater caustics and eye caustics.

This is based on "Manifold Next Event Estimation", a method developed for
production rendering. The idea is to selectively enable shadow caustics on a
few objects in the scene where they have a big visual impact, without impacting
render performance for the rest of the scene.

The Shadow Caustic option must be manually enabled on light, caustic receiver
and caster objects. For such light paths, the Filter Glossy option will be
ignored and replaced by sharp caustics.

Currently this method has a various limitations:

* Only caustics in shadows of refractive objects work, which means no caustics
  from reflection or caustics that outside shadows. Only up to 4 refractive
  caustic bounces are supported.
* Caustic caster objects should have smooth normals.
* Not currently support for Metal GPU rendering.

In the future this method may be extended for more general caustics.

TECHNICAL DETAILS

This code adds manifold next event estimation through refractive surface(s) as a
new sampling technique for direct lighting, i.e. finding the point on the
refractive surface(s) along the path to a light sample, which satisfies Fermat's
principle for a given microfacet normal and the path's end points. This
technique involves walking on the "specular manifold" using a pseudo newton
solver. Such a manifold is defined by the specular constraint matrix from the
manifold exploration framework [2]. For each refractive interface, this
constraint is defined by enforcing that the generalized half-vector projection
onto the interface local tangent plane is null. The newton solver guides the
walk by linearizing the manifold locally before reprojecting the linear solution
onto the refractive surface. See paper [1] for more details about the technique
itself and [3] for the half-vector light transport formulation, from which it is
derived.

[1] Manifold Next Event Estimation
Johannes Hanika, Marc Droske, and Luca Fascione. 2015.
Comput. Graph. Forum 34, 4 (July 2015), 87–97.
https://jo.dreggn.org/home/2015_mnee.pdf

[2] Manifold exploration: a Markov Chain Monte Carlo technique for rendering
scenes with difficult specular transport Wenzel Jakob and Steve Marschner.
2012. ACM Trans. Graph. 31, 4, Article 58 (July 2012), 13 pages.
https://www.cs.cornell.edu/projects/manifolds-sg12/

[3] The Natural-Constraint Representation of the Path Space for Efficient
Light Transport Simulation. Anton S. Kaplanyan, Johannes Hanika, and Carsten
Dachsbacher. 2014. ACM Trans. Graph. 33, 4, Article 102 (July 2014), 13 pages.
https://cg.ivd.kit.edu/english/HSLT.php

The code for this samping technique was inserted at the light sampling stage
(direct lighting). If the walk is successful, it turns off path regularization
using a specialized flag in the path state (PATH_MNEE_SUCCESS). This flag tells
the integrator not to blur the brdf roughness further down the path (in a child
ray created from BSDF sampling). In addition, using a cascading mechanism of
flag values, we cull connections to caustic lights for this and children rays,
which should be resolved through MNEE.

This mechanism also cancels the MIS bsdf counter part at the casutic receiver
depth, in essence leaving MNEE as the only sampling technique from receivers
through refractive casters to caustic lights. This choice might not be optimal
when the light gets large wrt to the receiver, though this is usually not when
you want to use MNEE.

This connection culling strategy removes a fair amount of fireflies, at the cost
of introducing a slight bias. Because of the selective nature of the culling
mechanism, reflective caustics still benefit from the native path
regularization, which further removes fireflies on other surfaces (bouncing
light off casters).

Differential Revision: https://developer.blender.org/D13533
2022-04-01 17:45:39 +02:00
Campbell Barton 27fb63381e Fix T94121: PyAPI: ID property group returns wrong type with iter()
Regression in 265d97556a.
Where iterating directly on a property group failed, e.g.:
`iter(group)`, tests missed this since only `group.keys()`
was checked.
2022-03-11 10:26:27 +11:00
Campbell Barton 0a4fdcbb5f Cleanup: unused Python variables & imports 2022-03-04 11:07:37 +11:00
Campbell Barton 7e4c031328 Cleanup: remove all tweak events from key-map presets 2022-03-02 17:29:27 +11:00
Campbell Barton 81df323df4 Tests: disable file output for bl_keymap_validate.py
Left on by accident but should only be used when debugging output.
2022-02-24 17:43:36 +11:00
Campbell Barton 813895f713 Cleanup: use strict type checking for bl_keymap_validate 2022-02-21 12:21:47 +11:00
Campbell Barton 167c4c6962 Tests: add duplicate key-map test, also test multiple configurations
Duplicate key-map items (while harmless in most cases) may cause
unexpected behavior or point to mistakes in the key-map,
so best avoid these.
2022-02-21 12:03:56 +11:00
Brecht Van Lommel e6f3bb984b Merge branch 'blender-v3.1-release' 2022-02-11 14:55:42 +01:00
Brecht Van Lommel 6175c569f9 Tests: enable full Cycles Metal device regression tests on buildbot
Now that all tests are passing. This does add about 5 minutes to the macOS
builds on buildbot.

Ref T92212
2022-02-11 14:35:10 +01:00
Campbell Barton f7bbec290d File headers: add license to Python scripts 2022-02-11 14:30:21 +11:00
Howard Trickey 4d29ec42bc Revert "Split Python OBJ importer and exporter, enabling only the importer."
This reverts commit ff9dc1986e.
2022-02-10 19:21:32 -05:00
Howard Trickey f39698de77 Revert "Split Python OBJ importer and exporter, enabling only the importer."
This reverts commit ff9dc1986e.
2022-02-10 18:29:29 -05:00
Campbell Barton c434782e3a File headers: SPDX License migration
Use a shorter/simpler license convention, stops the header taking so
much space.

Follow the SPDX license specification: https://spdx.org/licenses

- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile

While most of the source tree has been included

- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
  use different header conventions.

doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.

See P2788 for the script that automated these edits.

Reviewed By: brecht, mont29, sergey

Ref D14069
2022-02-11 09:14:36 +11:00
Campbell Barton 312d6925c4 Cleanup: make file headers more consistent
Also some descriptive text into doc-strings.
2022-02-09 23:47:34 +11:00
Sebastian Parborg 623ff64a27 Fix T81541: Symmetrize Transform Constraint, Y rotational axis unexpected results
The case where Y rotation is mapped to Y rotation was not handled.
This is now fixed.

Also added an automated test to make sure that the symmetrize operator
functions as intended.

Reviewed By: Sybren

Differential Revision: http://developer.blender.org/D9214
2022-02-04 14:21:20 +01:00
Howard Trickey 3bcbbf8992 Split Python OBJ importer and exporter, enabling only the importer.
This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
2022-02-03 09:30:55 -05:00
Howard Trickey ff9dc1986e Split Python OBJ importer and exporter, enabling only the importer.
This is from patch D13988. It removes the "- New" from the menu of the
new obj exporter, changes the default addon to just io_import_obj,
and does the right versioning thing.
Also disables the python tests for the old python exporter.
2022-02-03 07:56:55 -05:00
Campbell Barton d82372aee3 Cleanup: spelling in comments 2022-02-02 13:53:46 +11:00
Campbell Barton ebd0e76088 Cleanup: indentation for CMake files
Also minor white-space & case changes.
2022-01-28 14:52:47 +11:00
Brecht Van Lommel 13f2df3c28 Fix/workaround failing Cycles tests on macOS after ray offset changes
Temporarily blacklist a few tests with overlapping objects as they seem to
give different results on this platform.
2022-01-26 18:52:56 +01:00
William Leeson 74afc86d4b Cycles: remove ray offsetting
Remove small ray offsets that were used to avoid self intersection, and leave
that to the newly added primitive object/prim comparison. These changes together
significantly reduce artifacts on small, large or far away objects.

The balance here is that overlapping primitives are not handled well and should
be avoided (though this was already an issue). The upside is that this is
something a user has control over, whereas the other artifacts had no good
manual solution in many cases.

There is a known issue where the Blender particle system generates overlapping
objects and in turn leads to render differences between CPU and GPU. This will
be addressed separately.

Differential Revision: https://developer.blender.org/D12954
2022-01-26 17:51:05 +01:00
Hans Goudey 5a0c5912a4 Tests: Enable new tests for geometry nodes extrude node
rB95981c9876483256b28
2022-01-24 13:55:32 -06:00
Kévin Dietrich 0a08ac2528 Alembic: add support for reading override layers
Override layers are a standard feature of Alembic, where archives can override
data from other archives, provided that the hierarchies match.

This is useful for modifying a UV map, updating an animation, or even creating
some sort of LOD system where low resolution meshes are swapped by high resolution
versions.

It is possible to add UV maps and vertex colors using this system, however, they
will only appear in the spreadsheet editor when viewing evaluated data, as the UV
map and Vertex color UI only show data present on the original mesh.

Implementation wise, this adds a `CacheFileLayer` data structure to the `CacheFile`
DNA, as well as some operators and UI to present and manage the layers. For both
the Alembic importer and the Cycles procedural, the main change is creating an
archive from a list of filepaths, instead of a single one.

After importing the base file through the regular import operator, layers can be added
to or removed from the `CacheFile` via the UI list under the `Override Layers` panel
located in the Mesh Sequence Cache modifier. Layers can also be moved around or
hidden.

See differential page for tests files and demos.

Reviewed by: brecht, sybren

Differential Revision: https://developer.blender.org/D13603
2022-01-17 14:51:04 +01:00
Brecht Van Lommel d53738396f Tests: skip some compositor tests when WITH_LIBMV=OFF 2022-01-13 10:41:34 +01:00
Campbell Barton fe82b8d1e8 Docs: correct doc-string for bl_run_operators_event_simulate
The event() action swapped type/value arguments.
2022-01-11 09:13:25 +11:00
Brecht Van Lommel 1a27d20df3 Tests: disable all but one simple test for the Cycles Metal device
Until all tests are passing, this lets us run a basic test on the buildbot.

Ref T92212
2022-01-10 17:35:07 +01:00
Brecht Van Lommel 35b1e9fc3a Cycles: pointcloud rendering
This add support for rendering of the point cloud object in Blender, as a native
geometry type in Cycles that is more memory and time efficient than instancing
sphere meshes. This can be useful for rendering sand, water splashes, particles,
motion graphics, etc.

Points are currently always rendered as spheres, with backface culling. More
shapes are likely to be added later, but this is the most important one and can
be customized with shaders.

For CPU rendering the Embree primitive is used, for GPU there is our own
intersection code. Motion blur is suppored. Volumes inside points are not
currently supported.

Implemented with help from:
* Kévin Dietrich: Alembic procedural integration
* Patrick Mourse: OptiX integration
* Josh Whelchel: update for cycles-x changes

Ref T92573

Differential Revision: https://developer.blender.org/D9887
2021-12-16 20:54:04 +01:00
Brecht Van Lommel b815088416 Tests: add Cycles perspective/ortho/panoramic camera regression tests
Ref D12691
2021-12-07 20:08:12 +01:00
luzpaz 92dae5775f Cleanup: Fix typos in source code
Source typos corrected

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D13462
2021-12-06 22:23:17 -05:00
Hans Goudey 2b6c01d98c Fix: Updating geometry nodes test results fails
I ran into this when adding new geometry nodes tests.
The issue was caused by 7168a4fa5c.

Differential Revision: https://developer.blender.org/D13440
2021-12-01 21:22:00 -05:00
Jake 7168a4fa5c Tests: add edit-mesh operator tests
Added operator tests for hide, symmetry_snap, tris_convert_to_quads,
uvs_rotate, uvs_rotate, uv_texture_add, uv_texture_remove,
vert_connect_concave, vert_connect_nonplanar, vertex_color_add,
vertex_color_remove, vertices_smooth_laplacian, wireframe,
sculpt_vertex_color_add and sculpt_vertex_color_remove.

Ref D11798

Reviewed By: campbellbarton
2021-11-30 17:43:24 +11:00
Brecht Van Lommel 06691d1b21 Tests: disable Cycles volume test when WITH_MOD_FLUID is off 2021-11-19 13:21:48 +01:00
Brecht Van Lommel 7d5ef64bfb Cleanup: fix typos in comments and docs
Contributed by luzpaz.

Differential Revision: https://developer.blender.org/D13264
2021-11-19 12:46:49 +01:00
Bastien Montagne 06a74e7816 LibLink/Append tests: Add basic testing of `bpy.data.libraries.load` code. 2021-11-11 14:54:26 +01:00
Campbell Barton 0bcf014bcf Merge branch 'blender-v3.0-release' 2021-11-10 00:38:51 +11:00
Brecht Van Lommel 0b01b81754 Tests: disable Cycles tests based on more build options
WITH_OPENCOLORIO and WITH_COMPOSITOR are required to run the tests at all,
since they affect many tests.

WITH_OPENSUBDIV WITH_FREESTYLE, WITH_OPENVDB, WITH_OPENIMAGEDENOISE and
WITH_MOD_FLUID selectively disable some tests.
2021-11-09 13:55:35 +01:00
Campbell Barton 27b37517f8 Cleanup: use static sets 2021-11-08 17:00:36 +11:00
Campbell Barton c516659b5e Cleanup: use static sets 2021-11-08 14:52:08 +11:00
Bastien Montagne d3328fabc9 Attempt to fix failing lib link test on windows.
According to https://docs.python.org/3/library/os.html#os.rename,
`os.rename` has os-specific behavior, and will fail in case you attempt
to rename to an existing file on windows.

So using `os.replace` instead, which should be os-agnostic.

NOTE: Fact that temp test directory is not cleared after tests are
sucessfully ran does not sound great...
2021-11-04 15:06:58 +01:00
Bastien Montagne 2d6d8fc7ca Attempt fix for new lib reload/relocate tests on windows.
Try splitting them into their own class.
2021-11-04 11:25:30 +01:00
Bastien Montagne 1b2342b4d3 Tests: Add basic unittest for library reload and relocate operators. 2021-11-02 15:33:30 +01:00
Brecht Van Lommel aea2287af3 Tests: updated Python bundled modules test
Add the new zstandard module, as well as previously missing ones.

Ref D12777, T88438
2021-10-21 21:25:34 +02:00
Brecht Van Lommel f6af3d9197 Build: remove cmake messages about disabled tests when feature is disabled
No need to report this, it just adds noise to the cmake config. The messages
that we need to keep are the ones about disabling tests when the test file or
idiff are missing.
2021-10-21 13:06:57 +02:00
Michael Kowalski 0baa876b83 New test for USD import.
Added a basic test for importing a primitive hierarchy from a USDA
file into Blender.  This was reviewed by Sybren in patch D12479.
2021-10-20 12:07:28 -04:00
Bastien Montagne 6cd191a660 Link/Append tests: properly support and test with/without 'recursive' behaviors.
This requires adding an extra ('indirect') library to the test cases for
append.

Aftermath of T92224.
2021-10-20 11:58:06 +02:00
Campbell Barton d73f664790 Cleanup: trailing space, use single quotes for enums 2021-10-20 09:17:25 +11:00
Bastien Montagne a3d4ed20f9 Fix liblink tests after recent commit.
NOTE: This needs new tests, no time now, will do tomorrow.
2021-10-19 18:01:26 +02:00
Brecht Van Lommel 6e473a897c Tests: update Cycles GPU tests blacklist so all tests pass
More tests are matching now, mainly due to unified volume sampling.
2021-10-19 15:06:04 +02:00
Campbell Barton eb8afc39f8 Tests: remove noisy output from bl_pyapi_idprop_datablock
As part of expected behavior this printed an exception,
making it seem as if there was an error in the test.

Now the exception is suppressed from the output, ensuring it matches
an the expected output.
2021-10-12 17:58:52 +11:00
Campbell Barton 6139782d81 Tests: script_pyapi_idprop now cleans up after it's self
This test left blend files in the users temporary directory.
2021-10-12 17:58:52 +11:00
Campbell Barton 3d35d4a9e5 Tests: support running ID-property test without numpy 2021-10-12 17:57:38 +11:00
Campbell Barton 7b0b050dd5 Tests: quiet warning for UIList class name 2021-10-12 17:57:37 +11:00
Himanshi Kalra 22c61e8060 Tests: Disable tests for non-compiled libraries
This diff disables tests for Boolean, subdivision surface and volume
when GMP, Opensubdiv and Openvdb are not compiled respectively.
It also changes the existing file structure and adds sub-folders for
boolean and subdivison tests. The volume folder only has one test and
is as unchanged structure-wise.

Reviewed By: JacquesLucke, LazyDodo

Differential Revision: https://developer.blender.org/D12448
2021-09-29 23:52:52 +05:30
Campbell Barton 6dceaafe5a Cleanup: trailing space, newlines at EOF 2021-09-29 07:30:34 +10:00
Brecht Van Lommel cc653c9b02 Fix potential render tests error with invalid utf-8 characters
In general should not happen, but better to report the actual error instead
of the Python test code failing.
2021-09-28 20:50:38 +02:00
Bastien Montagne f48a4aa0f9 LibLink Append: Expose 'reuse ID' through new BLO flag, and add basic tests.
Option is now available to append operator, alsthough hidden and
disabled by default.
2021-09-23 12:56:05 +02:00
Brecht Van Lommel 0803119725 Cycles: merge of cycles-x branch, a major update to the renderer
This includes much improved GPU rendering performance, viewport interactivity,
new shadow catcher, revamped sampling settings, subsurface scattering anisotropy,
new GPU volume sampling, improved PMJ sampling pattern, and more.

Some features have also been removed or changed, breaking backwards compatibility.
Including the removal of the OpenCL backend, for which alternatives are under
development.

Release notes and code docs:
https://wiki.blender.org/wiki/Reference/Release_Notes/3.0/Cycles
https://wiki.blender.org/wiki/Source/Render/Cycles

Credits:
* Sergey Sharybin
* Brecht Van Lommel
* Patrick Mours (OptiX backend)
* Christophe Hery (subsurface scattering anisotropy)
* William Leeson (PMJ sampling pattern)
* Alaska (various fixes and tweaks)
* Thomas Dinges (various fixes)

For the full commit history, see the cycles-x branch. This squashes together
all the changes since intermediate changes would often fail building or tests.

Ref T87839, T87837, T87836
Fixes T90734, T89353, T80267, T80267, T77185, T69800
2021-09-21 14:55:54 +02:00
Himanshi Kalra a866a32ff2 Tests: Updated test message for Directory Not Found 2021-09-15 23:04:47 +05:30
Bastien Montagne 0ed089cebd LibLink: Enable unittest that was previously failing in append case.
Previous commit fixed it.
2021-09-14 17:59:18 +02:00
Bastien Montagne 81978594a8 Fix tests broken by rB58632a7f3c0f1be6.
Commits breaking RNA API should always run all tests, and do text search
in python code base to ensure everything is updated as needed.
2021-09-06 10:56:02 +02:00
Bastien Montagne 8355e3fc77 Unittest: Extend and basic linking tests and add basic append tests.
We could check many more things still, but this should already cover
most basic common cases.
2021-09-01 12:51:07 +02:00
Hans Goudey 8b9a3b94fc Refactor IDProperty UI data storage
The storage of IDProperty UI data (min, max, default value, etc) is
quite complicated. For every property, retrieving a single one of these
values involves three string lookups. First for the "_RNA_UI" group
property, then another for a group with the property's name, then for
the data value name. Not only is this inefficient, it's hard to reason
about, unintuitive, and not at all self-explanatory.

This commit replaces that system with a UI data struct directly in the
IDProperty. If it's not used, the only cost is of a NULL pointer. Beyond
storing the description, name, and RNA subtype, derived structs are used
to store type specific UI data like min and max.

Note that this means that addons using (abusing) the `_RNA_UI` custom
property will have to be changed. A few places in the addons repository
will be changed after this commit with D9919.

**Before**
Before, first the _RNA_UI subgroup is retrieved the _RNA_UI group,
then the subgroup for the original property, then specific UI data
is accessed like any other IDProperty.
```
prop = rna_idprop_ui_prop_get(idproperties_owner, "prop_name", create=True)
prop["min"] = 1.0
```

**After**
After, the `id_properties_ui` function for RNA structs returns a python
object specifically for managing an IDProperty's UI data.
```
ui_data = idproperties_owner.id_properties_ui("prop_name")
ui_data.update(min=1.0)
```
In addition to `update`, there are now other functions:
 - `as_dict`: Returns a dictionary of the property's UI data.
 - `clear`: Removes the property's UI data.
 - `update_from`: Copy UI data between properties,
   even if they have different owners.

Differential Revision: https://developer.blender.org/D9697
2021-08-27 08:27:24 -05:00
Himanshi Kalra 30d3dd4de1 Added more Geometry Node tests
* Attributes
* Utilities
* Volume

Test folder located in `lib\tests\modeling\geometry_nodes`
It contains around 34 new tests.
* attribute clamp + other attribute nodes
* Curve Primitive nodes
* Mesh Primitive nodes
* delete geometry
* convex hull
* subdivision surface
* boolean intersect
* boolean diff
* volume to mesh

Reviewed By: zazizizou, JacquesLucke

Differential Revision: https://developer.blender.org/D12250
2021-08-24 13:27:36 +05:30
Bastien Montagne 58ba75f9e3 LibOverride RNA API: add removal of properties and operations.
This should complete the basics of RNA API for library overrides.

Ref. T86656.
2021-08-04 16:57:08 +02:00
Bastien Montagne a8185d2d74 LibOverride: Add RNA API to reset/delete overrides.
Ref. T86656.
2021-08-04 16:57:08 +02:00
Bastien Montagne add719e31a Tweak to recent liboverride API addition: naming.
Rename new API function introduced in recent rB3b0fab6dfaa0 to match our
convention to put the action (verb) at the end of names:
`operations_update`.

Sorry for not catching that during review.
2021-08-04 12:38:13 +02:00
Jeroen Bakker 3b0fab6dfa Override: API update_operations.
The update_operations function will update the override structure of the
local object. When working with overrides the override structure is only
updated when the work-file is stored. When using scripts you might want
to enforce the update of override properties and operations.

This function removes a hack on the test cases.

Reviewed By: mont29

Maniphest Tasks: T86656

Differential Revision: https://developer.blender.org/D10848
2021-08-04 09:28:18 +02:00
Jacques Lucke 3fd5c93f9c Geometry Nodes: increase threshold to make regression tests pass
The real fix here is to use some kind of relative error in `customdata_compare`
instead of the absolute error used now. If vertex coordinates get larger in magnitude,
the allowed error should increase as well.
2021-08-02 10:38:11 +02:00
Campbell Barton bc0a7d3fae PyAPI: support multi-dimensional arrays for bpy.props vector types
- Multi-dimensional boolean, int and float vector types are supported.
- A sequence of int's for the "size" is used to declare dimensions.
- Nested sequences are required for default arguments.

Now it's possible to define matrix properties, for e.g:

  bpy.props.FloatVectorProperty(size=(4, 4), subtype='MATRIX')
2021-07-29 11:09:21 +10:00
Himanshi Kalra 4a02b9ffeb 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:01:15 +05:30
Campbell Barton b90b1af25c Event Simulate: and a --time-actions command line argument
When enabled, print the time taken between running actions.
2021-07-13 14:50:52 +10:00
Campbell Barton 2289e26fa3 Cleanup: correct spelling in comments, remove profanity 2021-07-11 15:31:36 +10:00
Philipp Oeser 834e87af7b Alembic: remove non-functional "Renderable Objects" only option
When introduced in {rB61050f75b13e} this was actually working (meaning
it checked the Outliner OB_RESTRICT_RENDER flag and skipped the object if
desired).

Behavior has since then been commented in rBae6e9401abb7 and apparently
refactored out in rB2917df21adc8.

If checked, it seemed to be working (objects marked non-renderable in
the Outliner were pruned from the export), however unchecking that
option did not include them in the export.

Now it changed - for the worse if you like - in rBa95f86359673 which
made it so if "Renderable Objects" only is checked, it will still export
objects invisible in renders. So since we now have the non-functional
option with a broken/misleading default, it is better to just remove it
entirely.

In fact it has been superseeded by the "Visible Objects" option (this
does the same thing: depsgraph is evaluated in render mode) and as a
second step (and to make this even clearer) a choice whether
Render or Viewport evaluation is used can be added (just like the USD
exporter has). When that choice is explicit, it's also clear which
visibility actually matters.

This is breaking API usage, should be in release notes.

ref. T89594

Maniphest Tasks: T89594

Differential Revision: https://developer.blender.org/D11808
2021-07-06 13:22:07 +02:00
Campbell Barton 432bfbf7a3 Cleanup: pep8 2021-07-06 12:05:27 +10:00