mat3_polar_decompose gives the right polar decomposition of given matrix,
as a pair (U, P) of matrices.
interp_m3_m3m3 uses that polar decomposition to perform a correct matrix interpolation,
even with non-uniformly scaled ones (where blend_m3_m3m3 would fail).
interp_m4_m4m4 just adds translation interpolation to the _m3 variant.
Extensions such as ".tar.gz" are now also supported. Before this patch,
ensure_ext('demo.tar.gz', '.tar.gz') would return 'demo.tar.tar.gz'.
This results in issues with the `ExportHelper` mix-in class; clicking
an existing file in the file dialogue warns about overwriting it
(highlighting the input box in red), but then saves to a different
file.
Also added a unit test for the new behaviour.
Reviewers: mont29, campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D1498
This commit:
* Adds a 'compare_ff' function for absolute 'almost equal' comparison of floats.
* Makes 'compare_vxvx' functions use that new 'compare_ff' one.
* Adds a 'compare_ff_relative' function for secured ulp-based relative comparison of floats.
* Adds matching 'compare_vxvx_relative' functions.
* Adds some basic tests for compare_ff_relative.
See https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
Note that we could replace our python/mathutils' EXPP_FloatsAreEqual() by BLI's compare_ff_relative
(using a very small absolute max_diff), but these do not have exact same behavior...
Left a comment there for now, we can do it later if/when we are sure it won't break anything!
Performance tests now have their own CMake macro, which ensures they do not get
added to ctest list, so we do not have to bother about them anymore, and can always
build them (when GTests are enabled, of course).
Alternative to T32894, simple test which creates new data and compares with RNA defaults.
Can be used to keep the values in sync without having to maintain a large set of defines.
We could likely add much more, but those already covers basic behavior and should be able
to catch most errors when editing this code.
Also added some performances tests as well (timing ghash insert/lookup under heavy loads,
for different kinds of keys).
Added conversion to and from exponential map representation. This
representation is useful for interpolation of > 2 quaternions, or in
PD controllers.
Implementation in C functions quat_to_expmap,
quat_normalized_to_expmap, and expmap_to_quat with Python API, unit
tests and documentation.
Added Quaternion.to_exponential_map() and Quaternion(3-vector) to
Python API.
Reviewers: campbellbarton
Projects: #bf_blender
Differential Revision: https://developer.blender.org/D1049
This reverts commit d390e24c49ba8543b56948402622563cae6e860f.
Forcing tests to success is really bad idea. It'll only lead to cases when
you see PASSED and will think everything is OK.
Long story short: never force tests to pass!
Recent addons commit meant that addons would be enabled even if they weren't found.
This would give an error (which is fine), but also remove from preferences.
The idea is to use the set of really small images from the lib folder
and run Cycles render on them comparing render output to reference
images in the tests repository.
For sure same thing could become more generic for BI or Freestyle
render engines.
Thanks Campbell for review and code tweaks!
Too many contrib addons are in an unstable state making the test not so useful.
Thanks to Sergey initial patch: D1012, redid mostly - but outcome is the same.
`BLI_strncpy_ensure_pad()` is also useful with current master code.
The two others (`BLI_strcmp_ignore_pad()` and `BLI_filelist_duplicate()`)
are only used in asset branch currently, but think they could be useful
in other places too, and simplifies handling of asset branch & future patch review.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D965
Main purpose of this is to bring new gflags library which is more likely
to have a fix for undefined order of static variables initialization and
also to bring new glog where some compilation error are fixed (which are
only visible with more strict checks with clang and c++11 enabled).
Murmur2a is a very fast hashing function generation int32 hashes.
It also features a very good distribution of generated hashes.
However, it is not endianness-agnostic, meaning it will usually generate
different hashes for a same key on big- and little-endian architectures.
Consequently, **it shall not be used to generate persistent hashes**
(never store them in .blend file e.g.).
This implementation supports incremental hashing, and is a direct
adaptation of reference implementation (in c++):
https://smhasher.googlecode.com/svn-history/r130/trunk/MurmurHash2.cpp
That cpp code was also used to generate reference values in gtests file.
Reviewers: sergey, campbellbarton
Reviewed By: campbellbarton
Projects: #bf_blender
Differential Revision: https://developer.blender.org/D892
Collection of test cases from libGDX and our own tracker
Tests:
- combine triangle area matches polygon area.
- tris have same winding.
- tris don't have duplicates.
- correct number of internal & boundary edges.
- degenerate polys still give topologically correct output.
also checks all possible start-vert offsets, forwards and backwards.
optional OBJ output, for debugging.