Age | Commit message (Collapse) | Author |
|
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
|
|
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
|
|
Was a mistake from the very beginning of implementation.
|
|
|
|
This got committed due to a stupid mistake of mine, it does not belong
there at all.
|
|
|
|
|
|
|
|
|
|
This resulted in compile errors.
|
|
This header defines default placement versions of operator new.
|
|
|
|
This makes it easier to write range-for loops over all items
in the map without using auto.
|
|
There is a nice use case for this in depsgraph code.
Also I added some previously missing calls to std::move.
|
|
Without this change, the code might do an unwanted conversion.
|
|
|
|
I found this pattern in depsgraph code more than once.
|
|
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.
|
|
|
|
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.
|
|
Was breaking build for me here...
|
|
We plan to use the "blender" namespace in other modules as well.
|
|
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
|
|
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
|
|
|
|
|
|
|
|
|
|
This implements a generic color datalayer and its functions. Based on
D5975.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7838
|
|
|
|
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
|
|
Recent commit deaff945d0b96 broke release builds but not debug builds,
with this change the warning happens in both cases.
|
|
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
|
|
|
|
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
|
|
Thanks to Howard for pointing that out.
|
|
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.
|
|
|
|
|
|
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
|
|
Adds an Correction to properly handle possibility of overflow of path name.
Differential Revision: https://developer.blender.org/D7739
Reviewed by Brecht Van Lommel
|
|
|
|
Lite builds without TBB and still needs the alternative codepath
|
|
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D7731
|
|
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
|
|
|
|
Reviewers: Severin
Differential Revision: https://developer.blender.org/D7705
|
|
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.
|
|
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
|
|
|