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-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
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-05Cleanup: use 'r_' prefix for return arguments in math_colorCampbell Barton
2020-06-05Cleanup: maybe uninitialized variable warningCampbell Barton
2020-06-05Cleanup: spellingCampbell Barton
2020-05-28Cleanup: spellingCampbell Barton
2020-05-27CD_PROP_COL datalayerPablo Dobarro
This implements a generic color datalayer and its functions. Based on D5975. Reviewed By: brecht Differential Revision: https://developer.blender.org/D7838
2020-05-27Cleanup: sort file, structsCampbell Barton
2020-05-26UI: Windows Shell Links & Improved Mac AliasesHarley Acheson
Adds support for Windows Shell Links (shortcuts) to the File Browser. Extended Mac Alias usage. Better visualization of linked items. Differential Revision: https://developer.blender.org/D7380 Reviewed by Campbell Barton
2020-05-26BLI_assert: prevent abort from suppressing return-type warningCampbell Barton
Recent commit deaff945d0b96 broke release builds but not debug builds, with this change the warning happens in both cases.
2020-05-25Calculate epsilon values for interp_weights_poly to improve accuracySebastian Parborg
interp_weights_poly_v2 would have too large epsilon values for small polygons. To solve this we now calculate the appropriate epsilon value so it can gracefully handle big and small values. To make sure there was no regression, these changes were tested with the files in T36105, T31581. Also with a surface deform modifier test file attached in the differential below. Reviewed By: Brecht Differential Revision: http://developer.blender.org/D7772
2020-05-25Cleanup: unused variable warningsCampbell Barton
2020-05-25Task: Graph Flow Task SchedulingJeroen Bakker
Add TBB::flow graph scheduling to BLI_task. Using flow graphs, a graph of nodes (tasks) and links can be defined. Work can flow though the graph. During this process the execution of the nodes will be scheduled among the available threads. We are planning to use this to improve the threading in the draw manager. The implemented API is still limited it only supports sequential flows. Joins and buffers are not supported. We could eventually support them as part of an CPP API. These features from uses compile time templates and are hard to make a clean C-API for this. Reviewed By: Sergey Sharybin, Brecht van Lommel Differential Revision: https://developer.blender.org/D7578
2020-05-20BLI: Fix VectorSet copy constructorJacques Lucke
Thanks to Howard for pointing that out.
2020-05-20Cleanup: make guarded memory allocation always thread safeBrecht Van Lommel
Previously this would be enabled when threads were used, but threads are now basically always in use so there is no point. Further, this is only needed for guarded allocation with --debug-memory which is not performance critical.
2020-05-20Merge branch 'blender-v2.83-release'Brecht Van Lommel
2020-05-19Merge remote-tracking branch 'origin/blender-v2.83-release'Sybren A. Stüvel
2020-05-19Fix T76375: UDIM Rectangular Tiled Image EEVEE freezes BlenderJeroen Bakker
When packing the image the height of the tile was checked to the width of the packing area. This resulted that the tile was ignored. Reviewed By: Clément Foucault Differential Revision: https://developer.blender.org/D7784
2020-05-15blenlib: BLI_file_attributes() CorrectionHarley Acheson
Adds an Correction to properly handle possibility of overflow of path name. Differential Revision: https://developer.blender.org/D7739 Reviewed by Brecht Van Lommel
2020-05-15BLI: add missing include for size_tJacques Lucke
2020-05-14Fix: Broken build with TBB disabled.Ray Molenkamp
Lite builds without TBB and still needs the alternative codepath
2020-05-14BLI: deduplicate address sanitizer codeJacques Lucke
Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D7731
2020-05-14Fix T76553: Blender Freezes When Playing Back AnimationJeroen Bakker
In some cases blender could freeze. When threads are blocked (waiting for other tasks completion) the scheduler can let the thread perform a different task. If this task wants a write-lock for something that was read-locked in the stack a dead lock will happen. For task pools every task is isolated. For range tasks the inner loop will be isolated. The implementation is limited as isolation in TBB uses functors which are tricky to add to a C API. We decided to start with a simple and adapt were we need to. During testing we came to this setup as it was reliable (we weren't able to let it freeze or crash) and didn't had noticeable performance impact. Reviewed By: Brecht van Lommel Differential Revision: https://developer.blender.org/D7688
2020-05-13Merge branch 'blender-v2.83-release'Antonio Vazquez
2020-05-13Fix T76665: Wrong files selected when using box selectJacques Lucke
Reviewers: Severin Differential Revision: https://developer.blender.org/D7705
2020-05-10Windows: Ignore context record for backtrace is address is 0.Ray Molenkamp
T76602 reported a crash with the exception address being 0, this stack naturally could not be walked and no backtrace was reported for the main thread. Which would have been helpful. This change modifies the behaviour of the crash handler to ignore the context record if it contains no useful information and walk the current stack to get some information about what lead to the crash.
2020-05-09Fix T76427: edit mesh undo hanges when building without TBBBrecht Van Lommel
Background task pools would not restart threads if reused multiple times, thanks to Jeroen for identifying the cause of this problem. Differential Revision: https://developer.blender.org/D7659
2020-05-09Fix building on NetBSDCampbell Barton