All headers in the svn libraries should be
building with /W0 however MSVC 16.8/16.9
has broken this functionality making OpenVDB
emit lots of warnings.
The breakage was reported [1] in august to MS
but they still have not gotten around to
addressing the issue.
This change explicitly suppresses C4251 in the
module that emitted these warnings. As the warning
is useful in other parts of blender a localized
approach is taken rather than a global suppression.
[1] https://developercommunity.visualstudio.com/content/problem/1167590/bug.html
* USD and OpenVDB headers use deprecated TBB headers, suppress all deprecation
warnings there since we have no control over them.
* For our own TBB includes, use the individual headers rather than the tbb.h that
includes everything to avoid warnings, rather than suppressing all.
This is in anticipation of the TBB 2020 upgrade in D10359. Ref D10361.
This updates fixes the following issues (critical for 2.92):
- Issue that prevented dense 'int' grids from being exported (incorrect clip value)
- Issue with particles outside out of domain bounds (position between -1 and 0) not being deleted
Includes improvements for the file IO. Namely, more meta data will be written from now on.
This change is required to prevent IO issues (e.g. T84649) that arised through the use of sparse grids caching (introduced in 2.92).
The issue was that sounds were always faded from 0 volume when they
started and depending on the currently used buffer size, the fading took
longer or shorter.
The solution stores whether the sound has ever been played back and
consequently does not fade when starting to play back.
Mainly updated the Mantaflow version. It includes the new viscosity solver plugin based on the method from 'Accurate Viscous Free Surfaces for Buckling, Coiling, and Rotating Liquids' (Batty & Bridson).
In the UI, this update adds a new 'Viscosity' section to the fluid modifier UI (liquid domains only). For now, there is a single 'strength' value to control the viscosity of liquids.
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
Mantaflow.
- `PYTHON_INSTALL` options only decide whether we copy python (and
some extra modules) in our Blender installation. On linux it
makes much more sense to use global python installation.
- Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
module.
- In current Debian testing, modules are under `python3.9`
directory, while headers are under `python3` directory.
- Now we properly `find_path` for headers as well, modifying
`find_python_package` to take an optional argument for headers.
Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.
Differential Revision: https://developer.blender.org/D9773
Issues were:
* Abusing of `WITH_PYTHON_INSTALL_NUMPY` by both Audaspace and
Mantaflow.
- `PYTHON_INSTALL` options only decide whether we copy python (and
some extra modules) in our Blender installation. On linux it
makes much more sense to use global python installation.
- Now we have instead a proper `WITH_PYTHON_NUMPY`
* Bad assumptions regarding path of headers relative to path of python
module.
- In current Debian testing, modules are under `python3.9`
directory, while headers are under `python3` directory.
- Now we properly `find_path` for headers as well, modifying
`find_python_package` to take an optional argument for headers.
Note that the required changes done to `extern` libraries are in
blender-specific files that do not exist upstream.
Differential Revision: https://developer.blender.org/D9773
This update introduces two improvements from the Mantaflow repository:
(1) Improved particle sampling:
- Liquid and secondary particles are sampled more predictably. With all parameters being equal, baked particles will be computed at the exact same position during every bake.
- Before, this was not guaranteed.
(2) Sparse grid caching:
- While saving grid data to disk, grids will from now on be saved in a sparse structure whenever possible (e.g. density, flame but not levelsets).
- With the sparse optimization grid cells with a value under the 'Empty Space' value (already present in domain settings) will not be cached.
- The main benefits of this optimization are: Smaller cache sizes and faster playback of simulation data in the viewport.
- This optimization works 'out-of-the-box'. There is no option in the UI to enable it.
- For now, only smoke simulation grids will take advantage of this optimization.
We already were using one of earlier RC of the library, so there is no
expected big changes. Just making the update official, using official
version and stating it in the readme file.
Basic support for velocity updates with the APIC method.
This commit adds APIC to the already existing dropdown menu for the simulation method. The APIC plugin within Mantaflow has been updated to the latest version.
This resolves a long list of linker warnings that is currently only showing up on macOS arm builds.
The warnings themselves are of this shape (one example):
```
ld: warning: direct access in function 'Manta::MeshDataImpl<Manta::Vector3D<float> >::_W_39(_object, object, object*)' from file '../../lib/libextern_mantaflow.a(mesh.h.reg.cpp.o)' to global weak symbol 'typeinfo for Manta::MeshDataImpl<Manta::Vector3D<float> >' from file '../../lib/libextern_mantaflow.a(mesh.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
```
Just would like to get your opinion to make sure this is an acceptable way to handle this on all platforms.
Reviewed By: LazyDodo
Differential Revision: https://developer.blender.org/D9002
The animated objects was not updated for each internal substep for the rigidbody sim.
This would lead to unstable simulations or very annoying clipping artifacts.
Updated the code to use explicit substeps and tie it to the scene frame rate.
Fix T47402: Properly updating the animated objects fixes the reported issue.
Reviewed By: Brecht, Jacques
Differential Revision: http://developer.blender.org/D8762
The main CMakeLists.txt specifies C++17, quadriflow tries to add C++14
flags leading to the following warnings when building with MSVC
Command line warning D9025 : overriding '/std:c++17' with '/std:c++14`
This change removes the C++14 flags, and fixes a build error caused
by the removal of `std::unary_function` in C++17 in the .obj loader
(which isn't used by blender)
Reviewed By: zeddb
Differential Revision: https://developer.blender.org/D8720
For bullet we compile at /W0 for MSVC but we did not
remove the standard /W3 flag. Leading to the following
warning:
Command line warning D9025 : overriding '/W3' with '/W0'
This change removes the W3 flag for bullet to get rid
of the warning.
This patch changes openvdb from a static to a dynamic library.
this is in preparation for enabling pyopenvdb at some point
in the future.
Differential Revision: https://developer.blender.org/D8282
Reviewed by: brecht
This patch adds a new compound shape entry to the shape selection
dropdown. It also corrects wrong inertia calculation for convex hulls,
that resulted in strange behavior for small objects.
The compound shape take the collision shapes from its object children
and combines them. This makes it possible to create concave shapes from
primitive shapes. Using this instead of the mesh collision shape is
often many times faster.
Reviewed By: Sergey, Sebastian Parborg
Differential Revision: http://developer.blender.org/D5797
Adjusted the fluid build system so that plugins that depend on numpy can be compiled as well.
Note that in this commit numpy support is still disabled. It can be enabled by re-running the Mantaflow update script with USE_NUMPY=1 and enabling WITH_MANTA_NUMPY in extern/mantaflow/CMakeLists.txt. This will happen in a future commit.
No longer including unused dependencies. Should numpy IO be needed at some point, the Manta source update script can be configured so that the required dependencies are included again.
This updated set of Mantaflow files includes the improved OpenVDB file IO. With this update it is finally possible to store multiple grids per file. It is also possible to save particle systems and particle data to OpenVDB files.
Draco sets CMAKE_CXX_STANDARD to 14, given we
set the c++ standard in the root level CMakeLists.txt
to c++17 this generated build warnings.
Given the rootlevel one is the one we want we can
safely remove this line in dracos cmakelists
Using latest master because of various compilation error fixes.
Brings a lot of recent development. From most interesting parts:
- New threading model.
- Tiny solver.
- Compatibility with C++17.
- Changing API for time values from float to double for better precision.
- Fixing minor mistakes in the documentation.
- Fixing minor unnecessary large memory allocation.
Bullet currently generates the majority of the warnings
on windows all of them are silly. This patch disables
all warns from bullet for now.
We should revisit this if/when we update bullet
to a newer version.
Reviewed By: sergey brecht
Differential Revision: https://developer.blender.org/D7118
`google::LogMessageFatal::~LogMessageFatal` calls `abort`
which MSVC correctly identifies as 'not returning'
and warns about a potential memory leak.
Given this is intended behaviour and glog is not overly
concerned with shutting down the process nicely, we
can safely ignore this warning.
Updates include:
- std::move() cleanup in rcmatrix.h
- Enabled parallelization for fluid guiding (fairly noticeable speed improvement).
- More flexible flags setter function with control over boundary width.
- Fixed uninitialized result used in DynamicMusic::seek().
The comment to this function says false is returned if the handle
is invalid, while in practice non-initialized value will be returned.
- Spelling typos in comment.
- Silence -Wdelete-non-abstract-non-virtual-dtor warning.
Differential Revision: https://developer.blender.org/D6896
Updates include:
- A fix from Jacques that changed the loop order in the mesh creation function (the fix speeds up the function significantly due to fewer cache misses).
- Some of the grid copy helper functions are now multithreaded.
- A fix for Windows file IO. Now it possible to load files with non ASCII characters on Windows too.
This modifies the common CUDA implementation for adaptive kernel compilation slightly to support both CUBIN and PTX output (the latter which is then used in the OptiX device). It also fixes adaptive kernel compilation on Windows.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6851
MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]
This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.
- Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
- Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
- Ghost had some scoping issues regarding uninitialized variables and goto behaviour
Second landing of this patch, earlier commit was reverted due to some compiler configurations having slipped though testing
[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance
Differential Revision: https://developer.blender.org/D6824
Reviewed By: brecht
It is breaking compilation on some configurations, revert for now while
i see what is wrong.
This reverts commit 9fe469c110940af5d2525158305d5d365bd15276.
MSVC has a conformance mode (/permissive-) where the C++ standard is more strictly
enforced. This mode is available on MSVC 15.5+ [1]
This patch enables this mode on compilers that support it and cleans up the few violations it threw up in the process.
- Mantaflow was using M_PI without requesting them using the _USE_MATH_DEFINES define to opt in to non default behaviour.
- Collada did not include the right header for std::cerr, this seemingly was fixed for other platforms already but put inside a platform guard.
- Ghost had some scoping issues regarding uninitialized variables and goto behaviour
[1] https://docs.microsoft.com/en-us/cpp/build/reference/permissive-standards-conformance
Differential Revision: https://developer.blender.org/D6824
Reviewed By: brecht
Glew.obj is one of the more expensive targets we have to build clocking in
at 34.907 seconds.
The root cause [1] is the msvc inliner is not super thrilled with the
glewIsSupported supported function, this patch changes the buildflags
of extern_glew to optimize for size rather than speed.
Given glew is only in play at initalization time there will be no
performance impact.
Time to build glew.obj
Before: 34.907s
After : 1.961s
[1] https://developercommunity.visualstudio.com/content/problem/732941/slow-compilation-of-glewc-for-visual-studio-2019-x.html
Differential Revision: https://developer.blender.org/D6656
Reviewers: brecht, sergey, fclem
This is a more correct fix to the issue Brecht was fixing in D6600.
While the fix in that patch worked fine for linking it broke ASAN
runtime under some circumstances.
For example, `make full debug developer` would compile, but trying
to start blender will cause assert failure in ASAN (related on check
that ASAN is not running already).
Top-level idea: leave it to CMake to keep track of dependency graph.
The root of the issue comes to the fact that target like "blender" is
configured to use a lot of static libraries coming from Blender sources
and to use external static libraries. There is nothing which ensures
order between blender's and external libraries. Only order of blender
libraries is guaranteed.
It was possible that due to a cycle or other circumstances some of
blender libraries would have been passed to linker after libraries
it uses, causing linker errors.
For example, this order will likely fail:
libbf_blenfont.a libfreetype6.a libbf_blenfont.a
This change makes it so blender libraries are explicitly provided
their dependencies to an external libraries, which allows CMake to
ensure they are always linked against them.
General rule here: if bf_foo depends on an external library it is
to be provided to LIBS for bf_foo.
For example, if bf_blenkernel depends on opensubdiv then LIBS in
blenkernel's CMakeLists.txt is to include OPENSUBDIB_LIBRARIES.
The change is made based on searching for used include folders
such as OPENSUBDIV_INCLUDE_DIRS and adding corresponding libraries
to LIBS ion that CMakeLists.txt. Transitive dependencies are not
simplified by this approach, but I am not aware of any downside of
this: CMake should be smart enough to simplify them on its side.
And even if not, this shouldn't affect linking time.
Benefit of not relying on transitive dependencies is that build
system is more robust towards future changes. For example, if
bf_intern_opensubiv is no longer depends on OPENSUBDIV_LIBRARIES
and all such code is moved to bf_blenkernel this will not break
linking.
The not-so-trivial part is change to blender_add_lib (and its
version in Cycles). The complexity is caused by libraries being
provided as a single list argument which doesn't allow to use
different release and debug libraries on Windows. The idea is:
- Have every library prefixed as "optimized" or "debug" if
separation is needed (non-prefixed libraries will be considered
"generic").
- Loop through libraries passed to function and do simple parsing
which will look for "optimized" and "debug" words and specify
following library to corresponding category.
This isn't something particularly great. Alternative would be to
use target_link_libraries() directly, which sounds like more code
but which is more explicit and allows to have more flexibility
and control comparing to wrapper approach.
Tested the following configurations on Linux, macOS and Windows:
- make full debug developer
- make full release developer
- make lite debug developer
- make lite release developer
NOTE: Linux libraries needs to be compiled with D6641 applied,
otherwise, depending on configuration, it's possible to run into
duplicated zlib symbols error.
Differential Revision: https://developer.blender.org/D6642
The gflags library was not fully configured to be built as a static
library, only one of two files was changed.
Differential Revision: https://developer.blender.org/D6611
This aligns with the VFX reference platform 2020 along with the decision
to stick to Python 3.7, see T68774.
Blosc was downgraded to 1.5 as recommended by the OpenVDB documentation.
IlmBase and OpenEXR are now built together with CMake rather separately
using autoconf.
Differential Revision: https://developer.blender.org/D6593
A bug in llvm < 9.0.1 causes the compiler to crash when
openmp is enabled. Since mantaflow uses tbb we can safely
disable this flag temporarily for this module.
Reviewed By: sebbas
Differential Revision: https://developer.blender.org/D6446
A collection of smaller changes that are required in the /blender/source files. A lot of them are also due to variable renaming.
Reviewed By: sergey
Maniphest Tasks: T59995
Differential Revision: https://developer.blender.org/D3855
Includes preprocessed Mantaflow source files for both OpenMP and TBB (if OpenMP is not present, TBB files will be used instead).
These files come directly from the Mantaflow repository. Future updates to the core fluid solver will take place by updating the files.
Reviewed By: sergey, mont29
Maniphest Tasks: T59995
Differential Revision: https://developer.blender.org/D3850
`BLI_strncpy_wchar_from_utf8` internally assumes `wchar_t` is 32 bits
which is not the case on windows.
The solution is to replace `wchar_t` with `char32_t`.
Thanks to @robbott for compatibility on macOS.
Differential Revision: https://developer.blender.org/D6198
Due to some floating point errors the last frame of a VSE audio strip can
cause integer overflow and crash Blender. This overflow was caused by a
cast from `int64_t` to `int` without prior check. The crash is fixed by
keeping the variable as `int64_t` for as long as possible.
Data was not quantified properly. It also lets the library choose the suitable
encoding method rather than forcing it to use the edgebreaker method.
Differential Revision: https://developer.blender.org/D6183
Namely addresses -Wstringop-truncation
Not sure if there is anything to be done for strncpy.
Differential Revision: https://developer.blender.org/D6006
This has already been fixed in 8d207cdc3b307fa20bc5b29059c596306aa2a65c
as fix for T52472: VSE Audio Volume not set immediately, but I failed to
backport it to upstream audaspace which is the reason the problem was
back.
Boost 1.68 has a bug in its type_traits where it does not include the right
header for the is_assignable macro when building with Clang. Temporarily work
around it until we upgrade to a newer Boost version that fixes it.
Differential Revision: https://developer.blender.org/D5962
The config.h file is autogenerated during compile by a 3rd party library
quadriflow uses. Now we put this file in the build directory to avoid
adding this to the git repository in the future.
The issue was that Audaspace options ended up in the cmake cache though
they should not be there.
Also reverting indentation change by @ideasman42.
Thanks to @mont29 for reporting and helping with the fix.
- Silence now has an optional sample rate parameter.
- Fix: wrong length reported by modulator and superpose.
- Minor formatting, include and documentation fixes.
No functional change, this adds LIB definition and args to cmake files.
Without this it's difficult to migrate away from 'BLENDER_SORTED_LIBS'
since there are many platforms/configurations that could break when
changing linking order.
Manually add and enable WITHOUT_SORTED_LIBS to try building
without sorted libs (currently fails since all variables are empty).
This check will eventually be removed.
See T46725.
Draco is added as a library under extern/ and builds a shared library that is
installed into the Python site-packages. This is then loaded by the glTF add-on
to do mesh compression.
Differential Revision: https://developer.blender.org/D4501