This commit implements described in the #104573.
The goal is to fix the confusion of the submodule hashes change, which are not
ideal for any of the supported git-module configuration (they are either always
visible causing confusion, or silently staged and committed, also causing
confusion).
This commit replaces submodules with a checkout of addons and addons_contrib,
covered by the .gitignore, and locale and developer tools are moved to the
main repository.
This also changes the paths:
- /release/scripts are moved to the /scripts
- /source/tools are moved to the /tools
- /release/datafiles/locale is moved to /locale
This is done to avoid conflicts when using bisect, and also allow buildbot to
automatically "recover" wgen building older or newer branches/patches.
Running `make update` will initialize the local checkout to the changed
repository configuration.
Another aspect of the change is that the make update will support Github style
of remote organization (origin remote pointing to thy fork, upstream remote
pointing to the upstream blender/blender.git).
Pull Request #104755
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)
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
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
- 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.
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
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
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
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
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).
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.
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
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
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.
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
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
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
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
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.
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
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.
In practice this didn't cause problems, but accessing scripts via
bpy.utils.resource_path('USER') ignores the BLENDER_USER_SCRIPTS
environment variable.
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
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
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
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
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
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
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]: dfa52017638abdf59791e5588c439d3a558a191d
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.
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.
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
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
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
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
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]: f4ff36431ccfac2f0a99fc23c18fe0d9de38b36d
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")`
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
Regression in 265d97556aa0f0f2a0e4dd7584e3b8573bbddd54.
Where iterating directly on a property group failed, e.g.:
`iter(group)`, tests missed this since only `group.keys()`
was checked.
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
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
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.
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.
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
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
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
I ran into this when adding new geometry nodes tests.
The issue was caused by 7168a4fa5c785c29483.
Differential Revision: https://developer.blender.org/D13440
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.
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...
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.
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.
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
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/Cycleshttps://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
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
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.
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
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.
- 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')
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
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
This constraint can be naturally viewed as a prototype for a future
4x4 matrix math node (or subset thereof), since its basic semantics
already is matrix assignment. Thus it makes sense to add math options
to this constraint to increase flexibility in the meantime.
This patch adds support for several operations that would be useful:
- An option to remove shear in the incoming target matrix.
Shear is known to cause issues for various mathematical operations,
so an option to remove it at key points is useful.
Constraints based on Euler like Copy Rotation and Limit Rotation
already have always enabled shear removal built in, because their
math doesn't work correctly with shear.
In the future node system shear removal would be a separate node
(and currently Limit Rotation can be used as a Remove Shear constraint).
However removing shear from the result of the target space conversion
before mixing (similar to Copy Rotation) has to be built into
Copy Transforms itself as an option.
- More ways to combine the target and owner matrices.
Similar to multiple Inherit Scale modes for parenting, there are
multiple ways one may want to combine matrices based on context.
This implements 3 variants for each of the Before/After modes
(one of them already existing).
- Full implements regular matrix multiplication as the most basic
option. The downside is the risk of creating shear.
- Aligned emulates the 'anti-shear' Aligned Inherit Scale mode,
and basically uses Full for location, and Split for rotation/scale.
(This choice already existed.)
- Split Channels combines location, rotation and scale separately.
Looking at D7547 there is demand for Split Channels in some cases,
so I think it makes sense to include it in Copy Transforms too, so that
the Mix menu items can be identical for it and the Action constraint.
Differential Revision: https://developer.blender.org/D9469
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.
Differential Revision: https://developer.blender.org/D11663
Reviewed by Harley Acheson
A utility that supports passing in actions as command line arguments for
writing reproducible interactions, benchmarking, profiling and testing.
Unlike regular scripts this is able to control model operators usefully.
Typical ways of controlling Blender using this utility are via
operator id's, menu search and explicit events.
Others methods can be added as needed.
See the doc-string for example usage.
Combining location, rotation and scale channels into a matrix is
a standard task, so while it is easily accomplished by constructing
and multiplying 3 matrices, having a standard utility allows for
more clear code.
The new constructor builds a 4x4 matrix from separate location,
rotation and scale values. Rotation can be represented as a 3x3
Matrix, Quaternion or Euler value, while the other two inputs
are vectors. Unneeded inputs can be replaced with None.
Differential Revision: https://developer.blender.org/D11264
- Matches changes in Python 3.x dictionary methods.
- Iterating now raises a run-time error if the property-group changes
size during iteration.
- IDPropertyGroup.iteritems() has been removed.
- IDPropertyGroup View & Iterator types have been added.
- Some set functionality from dict_keys/values/items aren't yet
supported (isdisjoint method and boolean set style operations).
Proposed as part of T85675.
This is functionality that isn't accessible via the user interface. The
API allows the creation and modification of an override template that
holds rules that needs to be checked when overriding the asset.
The API is setup that it cannot be changed after creation. Later on when
the system is more mature we will allow changing overrides operations.
NOTE: This is an experimental feature and should not be used in productions.
Reviewed By: mont29, sebbas
Differential Revision: https://developer.blender.org/D10792
Added support for compositor tests. Compositor tests can be added, executed and viewed in a similar way to cycles
and other render engines tests.
Running test:
`ctest -R compositor`
Updating test:
`BLENDER_TEST_UPDATE=1 ctest -R compositor`
Viewing test results:
typically saved under `build_folder/tests/compositor/report.html`
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D6334
Added a first test case for review. This will be the base for future test cases.
The current API is sufficient for what is expected for such a low level API.
One concern is that you need to trigger a save in order to update the library overrides
structure. Not expected from TD/Dev point of view.
Test cases are very important when implementing restrictive mode as it is a second evaluation mode that
has impact on the (current) permissive mode.
Reviewed By: Sebastián Barschkis, Bastien Montagne
Differential Revision: https://developer.blender.org/D10747
This checks the generated key-map data matches the result of
re-exporting and re-importing.
This shows up various inconsistencies, including:
- Unused keymaps.
- Unknown/unused data in the keymap.
- Event arguments that don't make sense.
- Event values that don't match the event type
(tweak direction on keyboard event for example).
MeshTest now compares selection between evaluated mesh and expected mesh. This way, we can test more operators
such as `faces_select_linked_flat`
Note: selection comparison intentionally does not happen in BKE_mesh_cmp() on C side but rather on Python side, because
selection is independent of mesh generation.
Reviewed By: calra, mont29
Differential Revision: https://developer.blender.org/D10279
Print number of total tests with each test to show how many tests have been executed and how many are left.
Example: `Running test 27/36: PlaneFaceSplitByEdges...`
Reviewed By: calra, mont29
Differential Revision: https://developer.blender.org/D10278
Tests are not identified with indexes, so no need to maintain comments with indexes anymore
Reviewed By: calra, mont29
Differential Revision: https://developer.blender.org/D10277
When building opensubdiv with more aggressive optimization flags
(-march=native -02) the output meshes would differ a bit from what we
expected in the current automated modifier test file.
The differences in vertex position is within the 1e-6 range, which I
would call is acceptable for floats. In addition to this, all the
modifier test that tests the subdiv modifier in particular pass without
any modifications. I've updated two tests in the modifier test file and
script to make it pass (listed below).
Updated following test categories:
1. Decimate test
Here there was a subdiv modifier applied before the actual decimate
modifier. Because the decimate modifier creates a queue of potential
vertices it can remove, it is highly sensitive to even small changes as
it drastically changes in which order the vertices are decimated in.
As this test should only be testing the decimate modifier, I pre-applied
the subdiv modifier in the test file.
2. RandomCubeModifier
For these tests I removed the subdiv modifier as well. As with decimate,
a small change in vertex position here can lead to quite different
results.
Reviewed By: Sergey, Bastien
Differential Revision: http://developer.blender.org/D9004
This adds a basic set of tests for curve sampling and bevel generation.
At the moment there are basic test cases for bevels, caps, and the
filling of 2D curves, but more tests can be added in the future.
Curves are actually converted to "DispLists" for displaying them in the
viewport, so it's much simpler to rely on the mesh conversion operator
instead of building a new test framework for another data structure.
Differential Revision: https://developer.blender.org/D9958
This revision contains the following changes-
- Updated the existing testing framework for Modifiers for Regression
Testing.
- Tests for Physics modifiers and remaining Generate and Deform modifiers are added.
- The existing `ModifierSpec` is updated with backward compatibility to support Physics Modifiers.
- Now there is support for frame number and giving nested parameters for attributes.
- Some Deform modifiers required Object Operators, e.g. "Bind" in Mesh Deform, so a new class was added to support that functionality.
- A separate class for holding Particles System, they are tested by converting all the particles to mesh and joining it to the mesh they were added.
- Updated the format to add tests for Bevel, Boolean and Operators as
well.
Reviewed By: zazizizou, mont29, campbellbarton
Differential Revision: https://developer.blender.org/D8507
Add Custom Space to the list of space conversions for constraints.
Constraints can use World Space, Local Space, Pose Space, Local with
Parent, and now also Custom Space with a custom object to define the
evaluation space.
The Custom Space option uses the Local Space of an other
object/bone/vertex group. If selected on owner or target it will show a
box for object selection. If an armature is selected, then it will also
show a box for bone selection. If a mesh object is selected it will show
the option for using the local space of a vertex group.
Reviewed By: #animation_rigging, sybren, Severin, angavrilov
Differential Revision: https://developer.blender.org/D7437
Blacklist a bunch of tests on the GPU, which are known to currently have
differences with CPU. These can be enabled as they are fixed or the test
is modified to give compatible results when there are known limitations.
OSL tests were also moved to their own directory since those are not
supported on the GPU.
Ref T82193
CYCLES_TEST_DEVICES is a list of devices (CPU, CUDA, OPTIX, OPENCL). It is set
to CPU only by default.
Test output is now writen to build/tests/cycles/<device>, and the HTML report
has separate report pages for the different devices, with option to compare
between CPU and GPU renders.
Various GPU tests are still failing due to CPU/GPU differences, these are to be
fixed or blacklisted still.
Ref T82193
This new discontinuity filter performs actions on the entire Euler
rotation, rather than only on the individual X/Y/Z channels. This makes
it fix a wider range of discontinuities, for example those in T52744.
The filter now runs twice on the selected channels, in this order:
- New: Convert X+Y+Z rotation to matrix, then back to Euler angles.
- Old: Add/remove factors of 360° to minimize jumps.
The messaging is streamlined; it now reports how many channels were
filtered, and only warns (instead of errors) when there was an actual
problem with the selected channels (like selecting three or more
channels, but without X/Y/Z triplet).
A new kernel function `BKE_fcurve_keyframe_move_value_with_handles()` is
introduced, to make it possible to move a keyframe's value and move its
handles at the same time.
Manifest Task: T52744
Reviewed By: looch
Differential Revision: https://developer.blender.org/D9602
Tests files are based on test from D8393
Test files should be in `lib\tests\sequence_editing`
These are files, I will add few more tests including animation test.
{F9155273}
Using generic tool to compare rendered vs reference image as other render engines.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9394
Don't override other `LSAN_OPTIONS` like suppression file set in
the environment variable.
Old code added in {rB38ff5064b33ccb8} and {rB5f4e99b7a2b8376}
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D9207
More agressive optimization made the results differ a bit more than the
current error margin would allow. Bump the error margin to be 1e-6
instead of the previous 0.5e-7.
Relax limits of FCurve Bézier handles during evaluation. FCurve handles
can be scaled down to avoid the curve looping backward in time. This
scaling was done correctly but over-carefully, posing unnecessary
limitations on the possible slope of FCurves. This commit changes the
scaling approach such that the FCurve can become near-vertical.
Bump Blender's subversion from 291.0.1 to 291.0.2 to ensure that older
animation files are correctly updated.
Reviewed By: sybren
Differential Revision: https://developer.blender.org/D8752
Write custom properties (aka ID properties) to Alembic, to the
`.userProperties` compound property.
Manifest Task: https://developer.blender.org/T50725
Scalar properties (so single-value/non-array properties) are written as
single-element array properties to Alembic. This is also what's done by
Houdini and Maya exporters, so it seems to be the standard way of doing
things. It also simplifies the implementation.
Two-dimensional arrays are flattened by concatenating all the numbers
into a single array. This is because ID properties have a limited type
system. This means that a 3x3 "matrix" could just as well be a list of
three 3D vectors.
Alembic has two container properties to store custom data:
- `.userProperties`, which is meant for properties that aren't
necessarily understood by other software packages, and
- `.arbGeomParams`, which can contain the same kind of data as
`.userProperties`, but can also specify that these vary per face of a
mesh. This property is mostly intended for renderers.
Most industry packages write their custom data to `.arbGeomParams`.
However, given their goals I feel that `.userProperties` is the more
appropriate one for Blender's ID Properties.
The code is a bit more involved than I would have liked. An
`ABCAbstractWriter` has a `uniqueptr` to its `CustomPropertiesExporter`,
but the `CustomPropertiesExporter` also has a pointer back to its owning
`ABCAbstractWriter`. It's the latter pointer that I'm not too happy
with, but it has a reason. Getting the aforementioned `.userProperties`
from the Alembic library will automatically create it if it doesn't
exist already. If it's not used to actually add custom properties to, it
will crash the Alembic CLI tools (and maybe others too). This is what
the pointer back to the `ABCAbstractWriter` is used for: to get the
`.userProperties` at the last moment, when it's 100% sure at least one
custom property will be written.
Differential Revision: https://developer.blender.org/D8869
Reviewed by: sergey, dbystedt
These were disabled in the newboolean merge commit.
This commit renables them, using the original 'FAST' solver
so that the result objects need not change.
A TODO to add more tests using the 'EXACT' solver,
though most functionality there is now covered by unit gtests.
This is for design task T67744, Boolean Redesign.
It adds a choice of solver to the Boolean modifier and the
Intersect (Boolean) and Intersect (Knife) tools.
The 'Fast' choice is the current Bmesh boolean.
The new 'Exact' choice is a more advanced algorithm that supports
overlapping geometry and uses more robust calculations, but is
slower than the Fast choice.
The default with this commit is set to 'Exact'. We can decide before
the 2.91 release whether or not this is the right choice, but this
choice now will get us more testing and feedback on the new code.
This adds a new `--debug-exit-on-error` flag. When it is set, Blender
will abort with a non-zero exit code when there are internal errors.
Currently, "internal errors" includes memory leaks detected by
guardedalloc and error/fatal log entries in clog.
The new flag is passed to Blender in various places where automated
tests are run. Furthermore, the `--debug-memory` flag is used in tests,
because that makes the verbose output more useful, when dealing
with memory leaks.
Reviewers: brecht, sergey
Differential Revision: https://developer.blender.org/D8665
Add a new depsgraph builder class that includes invisible objects and
use that in the Alembic exporter.
Alembic supports three options for visibility, "visible", "inherited",
and "hidden". This means that parents can be hidden and still have
visible children (contrary to USD, where invisibility is used to prune
an entire scene graph subtree). Because of this, the visibility is
stored on the transform node, as that represents the Object in Blender
and thus keeps the Alembic file as close to Blender's own structure as
possible.
Reviewed By: Sergey
Differential Revision: https://developer.blender.org/D8595
Rename test `alembic_tests` to `alembic_export_tests`, so that its name
is consistent with the Python file containing the tests,
`alembic_export_tests.py`.
No functional changes.
Instead of checking for the length of a list, just handle the error that
occurs when the length is incorrect.
No functional changes to any actual test.
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.
This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.
Tests are adjusted and still pass.
Each duplicated (a.k.a. instanced) object has a Persistent ID, which
identifies a dupli within the context of its duplicator. This ID
consists of several numbers when there are nested duplis (for example a
mesh instancing empties on its vertices, where each empty instances a
collection). When exporting to Alembic/USD, these are used to uniquely
name the duplicated objects in the export.
This commit reverses the order of the persistent ID numbers, so that the
first number identifies the first level of recursion. This produces
trees like this:
ABC
`--Triangle
|--Triangle
|--Empty-1
| `--Pole-1-0
| |--Pole
| `--Block-1-1
| `--Block
|--Empty
| `--Pole-0
| |--Pole
| `--Block-1
| `--Block
|--Empty-2
| `--Pole-2-0
| |--Pole
| `--Block-2-1
| `--Block
`--Empty-0
`--Pole-0-0
|--Pole
`--Block-0-1
`--Block
It is now clearer that `Pole-2-0` and `Block-2-1` are instanced by
`Empty-2`. Before this commit, they would have been named `Pole-0-2` and
`Block-1-2`.
Exporting a scene to USD or Alembic would fail when there are multiple
duplicates of parent & child objects, duplicated by the same object. For
example, this happens when such a hierarchy of objects is contained in a
collection, and that collection is instanced multiple times by mesh
vertices. The problem here is that the 'parent' pointer of each
duplicated object points to the real parent; Blender would not figure
out properly which duplicated parent should be used.
This is now resolved by keeping track of the persistent ID of each
duplicated instance, which makes it possible to reconstruct the
parent-child relations of duplicated objects. This does use up some
memory for each dupli, so it could be heavy to export a Spring scene
(with all the pebbles and leaves), but it's only a small addition on top
of the USD/Alembic writer objects that have to be created anyway. At
least with this patch, they're created correctly.
Code-wise, the following changes are made:
- The export graph (that maps export parent to its export children) used
to have as its key (Object, Duplicator). This is insufficient to
correctly distinguish between multiple duplis of the same object by
the same duplicator, so this is now extended to (Object, Duplicator,
Persistent ID). To make this possible, new classes `ObjectIdentifier`
and `PersistentID` are introduced.
- Finding the parent of a duplicated object is done via its persistent
ID. In Python notation, the code first tries to find the parent
instance where `child_persistent_id[1:] == parent_persistent_id[1:]`.
If that fails, the dupli with persistent ID `child_persistent_id[1:]`
is used as parent.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8233
The Alembic exporter has been restructured by leverages the
`AbstractHierarchyIterator` introduced by the USD exporter. The produced
Alembic files have not changed much (details below), as the Alembic
writing code has simply been moved from the old exporter to the new. How
the export hierarchy is handled changed a lot, though, and also the way
in which transforms are computed. As a result, T71395 is fixed.
Differences between the old and new exporter, in terms of the produced
Alembic file:
- Duplicated objects now have a unique numerical suffix.
- Matrices are computed differently, namely by simply computing the
evaluated transform of the object relative to the evaluated transform
of its export-parent. This fixes {T71395}, but otherwise should
produce the same result as before (but with simpler code).
Compared to the old Alembic exporter, Subdivision modifiers are now
disabled in a cleaner, more efficient way (they are disabled when
exporting with the "Apply Subdivisions" option is unchecked). Previously
the exporter would move to a new frame, disable the modifier, evaluate
the object, and enable the modifier again. This is now done before
exporting starts, and modifiers are only restored when exporting ends.
Some issues with the old Alembic exporter that have NOT been fixed in
this patch:
- Exporting NURBS patches and curves (see T49114 for example).
- Exporting flattened hierarchy in combination with dupli-objects. This
seems to be broken in the old Alembic exporter as well, but nobody
reported this yet.
Differential Revision: https://developer.blender.org/D7664
Reviewed By: Sergey
Blender now always exports transforms as as "inheriting", as Blender has
no concept of parenting without inheriting the transform.
Previously only objects with an actual parent were marked as
"inheriting", and parentless objects as "non-inheriting". However,
certain packages (for example USD's Alembic plugin) are incompatible
with non-inheriting transforms and will completely ignore such
transforms, placing all such objects at the world origin.
When importing non-inheriting transforms from Alembic, Blender will
break the parent-child relation and thus force the child to (correctly)
interpret the transform as world matrix.
Other types already had spaces, periods, and colons replaced by
underscores. The upcoming Alembic exporter (based on the
`AbstractHierarcyIterator` class) will be more consistent and apply the
same naming rules everywhere. This is in preparation for that change.
The `get_…_name()` functions in `abc_util.{cc,h}` will be removed then.
Previously the Alembic exporter exported a mesh object to
`{object.name}/{object.name}Shape`. Now it exports to
`{object.name}/{mesh.name}` instead. The same change also applies to
other object data types.
Note that the code now is a bit hackish, as `m_name` is set even in
cases where it isn't used. This hackishness was already there, though,
but it's now just more visible. This will all be cleaned up when the
Alembic exporter is ported to use the `AbstractHierarchyImporter`
structure of the Universal Scene Description (USD) exporter.
Reviewed By: mont29
Differential Revision: https://developer.blender.org/D7672
Main change from user side, besides that all pointers should now be
properly remapped to new IDs, is that linked objects are no longer
preserved when doing a full copy of scenes.
Will open a task to check whether we actually still want that behavior
(and re-code it in a more correct way then).
This is the main part of work done here, it aims at uniformizing and
sanitizing that 'deep copy' process for supported IDs (currently scenes,
collections and objects).
Note that there will be more follow up commits after that one, but this
should be the most risky and changing one.
This was caused by a side-effect of our exporting code's memory
management (Alembic considers data "written" and "final" when its C++
objects go out of scope) in combination with my change in
rB65574463fa2d. I removed an "only export UVs on the first frame" clause
because it was unclear why this restriction was there. As it turns out,
it breaks the export of the 2nd and subsequent UV maps on an animated
mesh. Effectively, on every frame the Alembic library thought we want to
create a new UV map, instead of continuing to write a new frame of data
to the existing one.
This is resolved by keeping a reference to the C++ objects for the UV
maps in memory while the exporter is running.
When the Child Of constraint is owned by a bone, before the constraint is
run the matrix is converted from world to pose space. However, setting the
inverse should also take the armature object's transform into account.
Blender was not configured to exit with non-zero return code on Python errors.
A bunch of tests worked around this but not all. This removes the need for such
workarounds.
This uses the same framework as automated modifier tests. It adds a physics
modifier, bakes and compares vertex coordinates on the end frame.
Differential Revision: https://developer.blender.org/D7017
Submitting on behalf of Jesse Y (deadpin).
In test harness for modifier testing, now run mesh validation
on output mesh. Also, fix printing so it interleaves properly.
CentOS on the buildbot still runs Python 3.6, which is also used for the
unit tests. This means that the tests can't use language features that
are available to Blender itself. And testing with a different version of
Python than will be used by the actual code seems like a bad idea to me.
This commit adds `TEST_PYTHON_EXECUTABLE` as advanced CMake option. This
will allow us to set a specific Python executable when we need it. When
not set, a platform-specific default will be used:
- On Windows, the `python….exe` from the installation directory. This is
just like before this patch, except that this patch adds the
overridability.
- On macOS/Linux, the `${PYTHON_EXECUTABLE}` as found by CMake.
Every platform should now have a value (configured by the user or
detected by CMake) for `TEST_PYTHON_EXE`, so there is no need to allow
running without. This also removes the need to have some Python files
marked as executable.
If `TEST_PYTHON_EXE` is not user-configured, and thus the above default
is used, a status message is logged by CMake. I've seen this a lot in
other projects, and I like that it shows which values are auto-detected.
However, it's not common in Blender, so if we want we can either remove
it now, or remove it after the buildbot has been set up correctly.
Differential Revision: https://developer.blender.org/D7395
Reviewed by: campbellbarton, mont29, sergey
Submitting on behalf of Jesse Y (deadpin).
In test harness for modifier testing, now run mesh validation
on output mesh. Also, fix printing so it interleaves properly.