Don't use the current mouse position at the time the event is handled, but
rather the position at the time of the event. This should make e.g. brush
stroke paths more accurate.
In addition, this may solve issues with other software that does mouse
position smoothing. Ref T82143.
Use of the current mouse position was added in 12b642062c6f as part of a
large commit that also made continuous grab work. But it appears to still
work getting the mouse position from the event.
The issue stems from the fact that scene arrays are not cleared when rendering is done. This was not really an issue before the introduction of the ownership system (rB429afe0c626a) as the id_map would recreate scene data arrays based on their new content. However, now that the id_maps do not have access to the scene data anymore the arrays are never created.
Another related issue is that the BlenderSync instance is never freed when the persistent data option is activated.
To fix this, we delete nodes created by the id_maps in their destructors, and delete the BlenderSync instance before creating a new one, so the id_maps destructors are actually called.
Reviewed By: brecht
Maniphest Tasks: T82129
Differential Revision: https://developer.blender.org/D9378
Code was assuming frustrum planes are symmetrical which is not the case
for shifting. This lead to a shrinking region if shift was negative (and
a growing region if shift was positive)
So instead of only keeping track of plane on one side (and mirroring
over in code) get the actual planes after shifting and use these
instead.
This code corrects this for ortho and perspective cameras, it does not
touch panoramic cameras.
Reviewed By: brecht
Maniphest Tasks: T69911
Differential Revision: https://developer.blender.org/D9342
Don't allocate a new buffer for refitting meshes, but update the existing one.
It's not clear from the API docs if this is required, but it appears to solve
the issue and should be more efficient.
Being able to adjust the distance between fluid and obstacles comes in handy when trying to achieve a fluid motion over inclined obstacles.
Depending on the slope of such obstacles, already small adjustments of this value can help when particles stick to obstacle surfaces (i.e. make particles not stick to obstacles).
Use the newly introduced packed intrinsics, which allows to remove
code which was initializing parameters block based on distortion
model type.
Now such initialization is done by a particular implementation of
a distortion model.
Differential Revision: https://developer.blender.org/D9192
This is a common class which can be used in all sort of minimization
problems which needs camera intrinsics as a parameter block.
Currently unused, but will replace a lot of hard-coded logic in the
bundle adjustment code.
Only build avx/avx2 unit tests if supported by the compiler and
WITH_CYCLES_NATIVE_ONLY is off, otherwise the appropriate compiler flags
are not available.
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required.
Differential Revision: https://developer.blender.org/D9250
Reviewed by Campbell Barton
There would be eigen alignment issues with the custom libmv vector
class when compiling with AVX optimizations. This would lead to
segfaults.
Simply use the std::vector base class as suggested by the old TODO in
the class header.
Reviewed By: Sergey
Differential Revision: http://developer.blender.org/D8968
A general refactor / fix commit that should clear out the issues that have been reported on external forces and moving effectors (e.g. T79537, T81660, T80088).
Caused by rBe65c78cd43aa.
Since above commit, only geometry and lights received the update,
previous to this check an instancer would receive that is well (in case
of 'is_updated_shading').
Now check for an instancer (checking OB_DUPLI via ob.is_instancer()) and
do an update then as well.
Reviewers: brecht
Maniphest Tasks: T81729
Differential Revision: https://developer.blender.org/D9222
We need a separate time stamp for each axis, and we have to add a few
milliseconds of padding to those, to ensure wrapping on both axes get
properly performed when it happens almost simultaneously, and avoid
extra wrapping caused by very close events sometimes.
This only addresses the Linux (X11 backend) case.
Differential Revision: https://developer.blender.org/D9209
With this patch the build system checks whether the "CUDA10_NVCC_EXECUTABLE" CMake
variable is set and if so will use that to build sm_30 kernels. Similarily for sm_8x kernels it
checks "CUDA11_NVCC_EXECUTABLE". All other kernels are built using the default CUDA
toolkit. This makes it possible to use either the CUDA 10 or CUDA 11 toolkit by default and
only selectively use the other for the kernels where its a hard requirement.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D9179
That was a suboptimal decision from back in the days, which ended up
being problematic. It is no longer used, so remove it from API making
it so new code does not depend on this weak concept.
The order got broken when Brown distortion model has been added.
Made it so the indexing of parameters is strictly defined in the
parameter block, matching how parameters are used in the cost
function.
There is some duplication going on accessing parameters. This can
be refactored in the future, by either moving common parts packing
and cost function to an utility function in bundle.cc.
Alternatively, can introduce a public PackedIntrinsics class which
will contain a continuous block of parameters, and each of the
camera models will have API to be initialized from packed form and
to create this packed form.
The benefit of this approach over alternative solutions previously
made in the master branch or suggested in D9116 is that the specific
implementation of BA does not dictate the way how public classes need
to be organized. It is API which needs to define how implementation
goes, not the other way around.
Thanks Bastien and Ivan for the investigation!
This reverts commit 7e836bde11ce6521953c9f246cacd442a3ef6c0e.
Reverting the incomplete workaround, due to the following reasoning:
- There should be no dependency between CameraIntrinsics and the bundler
code. This violates intended abstraction of the intrinsics class.
- The fix was not complete, or wrong. Even in the world where there is
a requirement to the parameters storage size this should have applied
to all distortion models, including Divisions, Nuke.
Proper fix will be committed next.
The leak was happening when problem did not have any parameters blocks
defined. This happens, for example, if there are no 3D points at all,
or when all markers are set to 0 weight.
Was noticeable in libmv_modal_solver_test when building with LSAN
enabled.
After tests were bundled in a single executable and cycles and libmv
created their own tests, the warnings on macOS have gone over 800.
The reason is setting `*_LIBRARIES` to names of the libraries
and later using `link_directories` to link them properly.
https://cmake.org/cmake/help/latest/command/link_directories.html
> Note This command is rarely necessary and should be avoided where
> there are other choices. Prefer to pass full absolute paths to
> libraries where possible, since this ensures the correct library
> will always be linked. The find_library() command provides the
> full path, which can generally be used directly in calls to
> target_link_libraries().
Warnings like the following popup for every target/executable,
for every library it links to.
```
ld: warning: directory not found for option
'-L/Users/me/blender-build/blender/../lib/darwin/jpeg/lib/Debug'
```
The patch completes a step towards removing `link_directories` as
mentioned in TODO at several places.
The patch uses absolute paths to link libraries and removes
all `*_LIBPATH`s except `PYTHON_LIBPATH` from
`platform_apple.cmake` file. (The corner case where it's used seems
like dead code. Python is no longer shipped with that file structure.)
Also, unused code for LLVM-3.4 has been removed.
Also, guards to avoid searching libraries in system directories have
been added.
`APPLE` platform now no longer needs `setup_libdirs`,
`cycles_link_directories`, and `link_directories`.
The number of warnings now is less than 100, most of them being
deprecation ones in dependencies.
This patch depended on {rBb746179d0add}, {rB2fdbe4d05011},
{rB402a4cadba49} and {rBd7f482f88ecb}.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8855
The flood-fill helper serves as a sanity check for scenes with complex obstacles. Similarly to the holes filler function it ensures that there are no holes in obstacles.
In addition, it ensures that there will be no holes resulting from multiple intersecting obstacles.
In general, this commit should improve stability.
NanoVDB is a platform-independent sparse volume data structure that makes it possible to
use OpenVDB volumes on the GPU. This patch uses it for volume rendering in Cycles,
replacing the previous usage of dense 3D textures.
Since it has a big impact on memory usage and performance and changes the OpenVDB
branch used for the rest of Blender as well, this is not enabled by default yet, which will
happen only after 2.82 was branched off. To enable it, build both dependencies and Blender
itself with the "WITH_NANOVDB" CMake option.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8794
Current libmv_modal_solver_test fails since rB3a7d62cd1f5e.
It appears that the issue is caused by the insertion of the new OFFSET_K4 parameter,
as, if camera intrinsics are not required to implement/use all of those deform
parameters, they absolutely have to keep order (values) matching those defined
in bundle.cc, otherwise `PackIntrinisicsIntoArray` and `UnpackIntrinsicsFromArray`
will mangle them around.