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
AgeCommit message (Collapse)Author
2020-07-06Cleanup: rename namespace TimeIt to timeitJacques Lucke
According to our style guide, namespaces should have lower case names.
2020-07-06BLI: improve exception safety of memory utilsJacques Lucke
Even if we do not use exception in many places in Blender, our core C++ library should become exception safe. Otherwise, we don't even have the option to work with exceptions if we decide to do so.
2020-07-06BLI: refactor how buffers for small object optimization are storedJacques Lucke
Previously, there was an error when operator-> was returning an invalid type. See error C2839.
2020-07-06Cleanup: warnings, spellingCampbell Barton
2020-07-05Revert "BLI: refactor how buffers for small object optimization are stored"Jacques Lucke
This reverts commit 5d79f9f276b4b3e6289308c534c58e7ee3bb5e2d. This was introducing build errors in windows. Need a bit more time to check it.
2020-07-05BLI: refactor how buffers for small object optimization are storedJacques Lucke
2020-07-04BLI: fix mistake in move constructor of StackJacques Lucke
2020-07-03Clang-tidy: Enable braces-around-statements warningSebastian Parborg
2020-07-03Clang-Tidy: enable readability-named-parameterJacques Lucke
2020-07-03Cleanup: add const in various placesJacques Lucke
2020-07-03Cleanup: bring operator overloads closer togetherJacques Lucke
2020-07-03Cleanup: use nested namespacesJacques Lucke
2020-07-03Cleanup: Use trailing underscore for non-public data membersJacques Lucke
This makes the code conform better with our style guide.
2020-07-03BLI: Use TBB spin_mutex as SpinLock implementationSergey Sharybin
When building without TBB use native to the platform spin lock implementation. For Windows it is an atomic-based busy-wait, for Linux it is pthreads' spin lock. For macOS it is a mutex lock. The reason behind this is to stop using atomics library which has been declared deprecated in SDK version 10.12. So this changes fixes a lot of noisy warnings on the newer SDK. Differential Revision: https://developer.blender.org/D8180
2020-07-03BLI: Switch threads implementation file to C++Sergey Sharybin
Allows to use C++ primitives in the primitive implementation.
2020-07-03Cleanup: spellingCampbell Barton
2020-07-02Cleanup: spellingCampbell Barton
2020-07-01Cleanup: spellingCampbell Barton
2020-06-30BLI: support constructing Color4f from float pointerJacques 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-30Cleanup: spellingCampbell Barton
2020-06-29Fix compile error on Apple ClangJulian Eisel
Needs to compile with `CMAKE_OSX_DEPLOYMENT_TARGET` of 10.14 at least to have `std::optional<>::value()` available. So we have to increase the minimum required compiler version, but that requires more changes. Just fix the build error for now.
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-29Cleanup: use std::make_unique instead of blender::make_uniqueJacques Lucke
This is possible, because we use C++17 now.
2020-06-29Cleanup: rename namespace DotExport to dotJacques Lucke
2020-06-27Docs: correct invalid doxygen params & referencesCampbell Barton
2020-06-25Cleanup: spellingCampbell Barton
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-18Transform: Snap to the intersection between constraint and geometryGermano Cavalcante
This commit changes the behavior of 4 snapping combinations: **1. While constraining to a plane, snap to an edge element:** The snap is made at the intersection between the edge direction and the constraint plane. **2. While constraining to a plane, snap to a face element:** The snap is made to the nearest point between the snap point and the line that intersects the face plane with the constraint plane. **3. While constraining to an axis, snap to an edge/line element:** The snap is made to the nearest point on the axis to the edge/line. **4. While constraining to an axis, snap to a face element:** The snap is made at the intersection of the axis and the plane defined by the face. To avoid unpredictable jumps outside view boundaries, an alignment check is made for each of these snapping combinations. Resolve/fix T66422 Differential Revision: https://developer.blender.org/D5608
2020-06-16Fix bitscan_reverse_uint on MSVC compilerSergey Sharybin
Was a mistake from the very beginning of implementation.
2020-06-16BLI: fix Map.foreach_item methodJacques Lucke
2020-06-15Cleanup: remove unnecessary codeJacques Lucke
This got committed due to a stupid mistake of mine, it does not belong there at all.
2020-06-13Cleanup: spellingCampbell Barton
2020-06-11BLI: define default hash function for const typesJacques Lucke
2020-06-11BLI: fix forwarding with incorrect typeJacques Lucke
2020-06-11Cleanup: fix terminology in commentJacques Lucke
2020-06-11BLI: don't pass const pointers to placement new operatorJacques Lucke
This resulted in compile errors.
2020-06-11BLI: include <new> headerJacques Lucke
This header defines default placement versions of operator new.
2020-06-11BLI: fix printing name in print_stats methods of Map, Set and VectorSetJacques 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: fix type forwarding in MapJacques Lucke
Without this change, the code might do an unwanted conversion.
2020-06-10BLI: support constructing StringRef from start and end pointerJacques Lucke
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: remove incorrect constJacques Lucke
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-09Fix warning-as-error about int to uint conversion in new BLI CPP code.Bastien Montagne
Was breaking build for me here...
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