Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2020-07-03Fix T72214: Fluids: noise does not work with negative frame numbersJacques Lucke
The issue is duplicated code. There are two functions that zero-fill the frame number. They worked the same for positive frames numbers, but behaved differently for negative ones. On frame `-100`, `BLI_path_frame` outputs `-0100` and `fluid_cache_get_framenr_formatted_$ID$` outputted `-100`. I changed the behavior of the latter, because we depend on the behavior of the former for much longer already. Reviewers: sebbas Differential Revision: https://developer.blender.org/D8107
2020-07-03Cleanup: use nested namespacesJacques Lucke
2020-06-30Fix compile errorJacques Lucke
This is the same issue as in rBbcf49d13e53454.
2020-06-30Functions: add two more customizable multi-functionsJacques Lucke
2020-06-30Cleanup: move tests into their corresponding namespaceJacques Lucke
2020-06-30BLI: add Array constructor that does not initialize non-trivial typesJacques Lucke
This should rarely be necessary, but I have a use case coming up soon.
2020-06-30Alembic: new exporter based on the USD exporter structureSybren A. Stüvel
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
2020-06-29BLI: remove blender::Optional in favor of std::optionalJacques Lucke
`std::optional` can be used now, because we switched to C++17.
2020-06-27Functions: add MutableAttributesRef data structureJacques Lucke
This will be used to reference the content of a CustomData structure in C++ code, that does not need to know who owns the data but only works with it.
2020-06-27Cleanup: make it easier to check if a CPPType is a specific compile time typeJacques Lucke
2020-06-23Functions: Multi Function NetworkJacques Lucke
A multi-function network is a graph data structure, where nodes are multi-functions (or dummies) and links represent data flow. New multi-functions can be derived from such a network. For that one just has to specify two sets of sockets in the network that represent the inputs and outputs of the new function. It is possible to do optimizations like constant folding on this data structure, but that is not implemented in this patch yet. In a next step, user generated node trees are converted into a MFNetwork, so that they can be evaluated efficiently for many particles. This patch also includes some tests that cover the majority of the code. However, this seems to be the kind of code that is best tested by some .blend files. Building graph structures in code is possible, but is not easy to understand afterwards. Reviewers: brecht Differential Revision: https://developer.blender.org/D8049
2020-06-22Functions: add utilities that allow creating some multi-functions with less ↵Jacques Lucke
typing
2020-06-22Functions: Various improvements to the spans and generic data structuresJacques Lucke
Most of this code is covered by unit tests.
2020-06-19Cleanup: Alembic, move the C++ code to `blender::io::alembic` namespaceSybren A. Stüvel
This commit only moves code into the `blender::io::alembic` namespace, it does not move `static` functions into an anonymous namespace. No functional changes.
2020-06-19Cleanup: Alembic, moved exporter code into separate directorySybren A. Stüvel
This moves most of the exporter-related code from `source/blender/io/alembic/intern` to `source/blender/io/alembic/exporter` This is to prepare the Alembic code for the switchover to using `blender::io::AbstractHierarchyIterator`. When that happens, a few more files will be added, and having things in a separate 'exporter' directory makes things less cluttered. Note that exporting consists of multiple steps (determine export hierarchy, create Alembic archive, and then write data into it), which is why the directory is called "exporter", but many of the files are called "writer". No functional changes.
2020-06-19USD Test: Don't use designated initializersSergey Sharybin
This isn't really in C++ standard, some corner cases work in some compilers (like when all fields are specified), but in general they do not work. For some reason MSVC builder started to complain about it now, weird but better not rely on compiler specifics.
2020-06-19Tests: Use explicit signature constantsSergey Sharybin
Are reported by MSVC 2019 after C++17 switch. One might suggest lets just silence the warning, I will say why to have specific signed/unsigned types in API just to then (usafely) ignore the sign conversion.
2020-06-19Make BLI_edgehash_test compatible with C++17Sergey Sharybin
random_shuffle was removed (at least the used version).
2020-06-19Alembic: always export transforms as inheritingSybren A. Stüvel
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.
2020-06-19Alembic: prevent spaces in names of exported particle systemsSybren A. Stüvel
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.
2020-06-19Alembic: export object data with object data nameSybren A. Stüvel
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
2020-06-19IO: Allow exporting a subset of the writersSybren A. Stüvel
This is in order to prepare for compatibility with the Alembic exporter. That exporter is capable of writing object transforms and object data at different (sub)frames. The rename from `created_writers` to `used_writers` is necessary, as not all created writers will be actually used in each iteration. The Universal Scene Description (USD) exporter does not make use of this. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D7670
2020-06-19IO: Move Abstract Hierarchy Iterator into `io/common`Sybren A. Stüvel
The goal of the `AbstractHierarchyIterator` class (and supporting classes) was to use it in different exporters. It shouldn't be part of the USD module + namespace any more, now that it will also be used in the upcoming Alembic exporter rewrite. The source files are moved into `io/common`, which is compiled & linked into a new library `bf_io_common`. The unittests are still inside the `tests/gtests/usd` directory. They should be moved to a separate test module too, but that will be delayed until after T73268 has been resolved. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D7669
2020-06-18Allow interpolation of matrices with negative scale / axis flipsSybren A. Stüvel
The matrix interpolation function `interp_m3_m3m3()` decomposes the matrices into rotation and scale matrices, converts the rotation matrices to quaternions, SLERPs the quaternions, and converts the result back to a matrix. Since quaternions cannot represent axis flips, this results in interpolation problems like described in T77154. Our interpolation function is based on "Matrix Animation and Polar Decomposition", by Ken Shoemake & Tom Duff. The paper states that it produces invalid results when there is an axis flip in the rotation matrix (or negative determinant, or negative scale, those all indicate the same thing). Their solution is to multiply the rotation matrix with `-I`, where `I` is the identity matrix. This is the same as element-wise multiplication with `-1.0f`. My proposed solution is to not only do that with the rotation matrix `R`, but also with the scale matrix `S`. This ensures that the decomposition of `A = R * S` remains valid, while also making it possible to conver the rotation component to a quaternion. There is still an issue when interpolating between matrices with different determinant. As the determinant represents the change in volume when that matrix is applied to an object, interpolating between a negative and a positive matrix will have to go through a zero determinant. In this case the volume collapses to zero. I don't see this as a big issue, though, as without this patch Blender would also produce invalid results anyway. Reviewed By: brecht, sergey Differential Revision: https://developer.blender.org/D8048
2020-06-18Tests: added simple unittests for matrix interpolationSybren A. Stüvel
The interpolation of 4x4 and 3x3 matrices will fail when the rotation component has a singularity, i.e. when there is one axis mirrored. Two mirrored axes are just a rotation of 180 degrees around the third, and three mirrored axes are such a rotation + a single axis mirror. To prepare for a fix, I first wanted to cover the basic functionality with a few unit tests. These tests check that `interpolate(A, B, alpha)` always returns `A` for `alpha=0`, always return `B` for `alpha=1`, and something in between for `alpha=0.5`.
2020-06-17Refactor duplicate of data-blocks.Bastien Montagne
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.
2020-06-16Functions: Multi FunctionJacques Lucke
This adds the `MultiFunction` type and some smallish utility types that it uses. A `MultiFunction` encapsulates a function that is optimized for throughput by always processing many elements at once. This is an important part of the new particle system, because it allows us to execute user generated node trees for many particles efficiently. Reviewers: brecht Differential Revision: https://developer.blender.org/D8030
2020-06-16BLI: fix Map.foreach_item methodJacques Lucke
2020-06-12Functions: Wrap into blender namespaceSergey Sharybin
Similar to previous commit, aims to resolve compilation on devtoolset-6.
2020-06-12Fix/workaround compilation error on devtoolset-6Sergey Sharybin
Smells like GCC bug [1], which is backed up by the fact that locally GCC-10 and CLang-10 works fine. Since the change is trivial (and, arguably, correct since there is no real difference between tests code and actual code) seems fine to fix. Fix suggested by Jacques Lucke, thanks! [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56480
2020-06-11BLI: define default hash function for const typesJacques Lucke
2020-06-11BLI: make Map::Item and Map::MutableItem more accessibleJacques Lucke
This makes it easier to write range-for loops over all items in the map without using auto.
2020-06-10BLI: add Map.pop_default methodJacques Lucke
There is a nice use case for this in depsgraph code. Also I added some previously missing calls to std::move.
2020-06-10BLI: support constructing StringRef from start and end pointerJacques Lucke
2020-06-10Cleanup: improve custom data type namesJacques Lucke
This is related to T76659. This just renames data type names to `CD_PROP_STRING`, `CD_PROP_FLOAT` and `CD_PROP_INT32`. It makes them a bit more specific and removes unnecessary abbreviations. Reviewers: brecht Differential Revision: https://developer.blender.org/D7980
2020-06-10BLI: rename tests from "array_ref" to "span"Jacques Lucke
This was missing in an earlier commit.
2020-06-10BLI: add Map.pop_try methodJacques Lucke
I found this pattern in depsgraph code more than once.
2020-06-10BLI: update behavior of Map.lookup_or_addJacques Lucke
Previously, this function would expect a callback function as parameter. This behavior is now in Map.lookup_or_add_cb. The new version just takes the key and value directly.
2020-06-09BLI: rename ArrayRef to SpanJacques Lucke
This also renames `MutableArrayRef` to `MutableSpan`. The name "Span" works better, because `std::span` will provide similar functionality in C++20. Furthermore, a shorter, more concise name for a common data structure is nice.
2020-06-09BLI: put C++ data structures in "blender" namespace instead of "BLI"Jacques Lucke
We plan to use the "blender" namespace in other modules as well.
2020-06-09BLI: generally improve C++ data structuresJacques Lucke
The main focus here was to improve the docs significantly. Furthermore, I reimplemented `Set`, `Map` and `VectorSet`. They are now (usually) faster, simpler and more customizable. I also rewrote `Stack` to make it more efficient by avoiding unnecessary copies. Thanks to everyone who helped with constructive feedback. Approved by brecht and sybren. Differential Revision: https://developer.blender.org/D7931
2020-06-08Functions: Run-time type system and index maskJacques Lucke
This adds a new `CPPType` that encapsulates information about how to handle instances of a specific data type. This is necessary for the function evaluation system, which will be used to evaluate most of the particle node trees. Furthermore, this adds an `IndexMask` class which offers a surprisingly useful abstraction over an array containing unsigned integers. It makes two assumptions about the underlying integer array: * The integers are in ascending order. * There are no duplicates. `IndexMask` will be used to "select" certain particles that will be processed in a data-oriented way. Sometimes, operations don't have to be applied to all particles, but only some, those that are in the indexed by the `IndexMask`. The two limitations imposed by an `IndexMask` allow for better performance. Reviewers: brecht Differential Revision: https://developer.blender.org/D7957
2020-06-05Code Cleanup: fcurve function namingJeroen Bakker
2020-06-05CleanUp: Introduce BKE_fcurve_createJeroen Bakker
2020-05-26Merge remote-tracking branch 'origin/blender-v2.83-release'Sybren A. Stüvel
2020-05-26Fix T77021: Alembic export of animated mesh with multiple UV maps failsSybren A. Stüvel
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.
2020-05-25Merge remote-tracking branch 'origin/blender-v2.83-release'Dalai Felinto
2020-05-25Fix T76941: "Set Inverse" in Child Of constraint broken with armaturesSybren A. Stüvel
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.
2020-05-25Merge branch 'blender-v2.83-release'Campbell Barton
2020-05-25Tests: correct the blender path for non-portable installationsCampbell Barton